summaryrefslogtreecommitdiff
path: root/vp8/encoder/encodeframe.c
AgeCommit message (Collapse)Author
2011-01-24Added vp8_update_zbin_extraScott LaVarnway
vp8cx_mb_init_quantizer was being called for every mode checked in vp8_rd_pick_inter_mode. zbin_extra is the only value that really needs to be recalculated. This calculation is disabled when using the fast quantizer for mode selection. This gave a small performance boost (~.5% to 1%). Note: This needs to be verified with segmentation_enabled. Change-Id: I62716a870b3c82b4a998bdf95130ff0b02106f1e
2011-01-18Further CQ, Key frame and ARF changesPaul Wilkins
This code fixes a bug in the calculation of the minimum Q for alt ref frames. It also allows an extended gf/arf interval for sections of clips that completely static (or nearly so). Change-Id: I1a21aaa16d4f0578e5f99b13bebd78d59403c73b
2011-01-11Remove unused local variablesHenrik Lundin
Removing unused local variables causing compiler warnings in Visual Studio. Change-Id: I0e2096303be1fdbc01428a6e57cca9796bb32c8a
2011-01-07Removed cpi->target_bits_per_mbScott LaVarnway
cpi->target_bits_per_mb is currently not being used, so delete it. Also removed other unused code in rdopt.c. Change-Id: I98449f9030bcd2f15451d9b7a3b9b93dd1409923
2010-12-28Use the fast quantizer for inter mode selectionScott LaVarnway
Use the fast quantizer for inter mode selection and the regular quantizer for the rest of the encode for good quality, speed 1. Both performance and quality were improved. The quality gains will make up for the quality loss mentioned in I9dc089007ca08129fb6c11fe7692777ebb8647b0. Change-Id: Ia90bc9cf326a7c65d60d31fa32f6465ab6984d21
2010-12-17Add psnr/ssim tuning optionJohn Koleszar
Add a new encoder control, VP8E_SET_TUNING, to allow the application to inform the encoder that the material will benefit from certain tuning. Expose this control as the --tune option to vpxenc. The args helper is expanded to support enumerated arguments by name or value. Two tunings are provided by this patch, PSNR (default) and SSIM. Activity masking is made dependent on setting --tune=ssim, as the current implementation hurts speed (10%) and PSNR (2.7% avg, 10% peak) too much for it to be a default yet. Change-Id: I110d969381c4805347ff5a0ffaf1a14ca1965257
2010-12-03Merge 'Add simple version of activity masking.'John Koleszar
Merge commit 'refs/changes/79/779/2' of https://review.webmproject.org/p/libvpx Conflicts: vp8/encoder/encodeintra.c vp8/encoder/encodemb.c Change-Id: Id607063fabe92d99eeb3c380e8ca670b01bfb3ef
2010-11-11quantizer: fix assertion in fast quantizer pathJohn Koleszar
The fast quantizer assembly code has not been updated to match the new exact quantizer, which was made the default in commit 6adbe09. Specifically, they are not aware of the potential for the coefficient to be scaled, which results in the quantized result exceeding the range of the DCT. This patch restores the previous behavior of using the non-shifted coefficients when in the fast quantizer code path, but unfortunately requires rebuilding the tables when switching between the two. Change-Id: I0a33f5b3850335011a06906f49fafed54dda9546
2010-11-10Tuning for the more exact quantizer.Paul Wilkins
Small changes to the default zero bin and rounding tables. Though the tables are currently the same for the Y1 and Y2 cases I have left them as separate tables in case we want to tune this later. There is now some adjustment of the zbin based on the prediction mode. Previously this was restricted to an adjustment for gf/arf 0,0 MV. The exact quantizer now marginal outperforms and is the default. The overall average gain is about 0.5% Change-Id: I5e4353f3d5326dde4e86823684b236a1e9ea7f47
2010-10-21Convert [4][4] matrices to [16] arrays.Timothy B. Terriberry
Most of the code that actually uses these matrices indexes them as if they were a single contiguous array, and coverity produces reports about the resulting accesses that overflow the static bounds of the first row. This is perfectly legal in C, but converting them to actual [16] arrays should eliminate the report, and removes a good deal of extraneous indexing and address operators from the code. Change-Id: Ibda479e2232b3e51f9edf3b355b8640520fdbf23
2010-10-12Centralize mb skip state calculationJohn Koleszar
This patch moves the scattered updates to the mb skip state (mode_info_context->mbmi.mb_skip_coeff) to vp8_tokenize_mb. Recent changes to the quantizer exposed a bug where if a macroblock could be coded as a skip but isn't, the encoder would run the loopfilter but the decoder wouldn't, causing a reference buffer mismatch. The loopfilter is controlled by a flag called dc_diff. The decoder looks at the number of decoded coefficients when setting this flag. The encoder sets this flag based on the skip state, since any skippable macroblock should be transmitted as a skip. The coefficient optimization pass (vp8_optimize_b()) could change the coefficients such that a block that was not a skip becomes one. The encoder was not updating the skip state in this situation for intra coded blocks. The underlying issue predates it, but this bug was recently triggered by enabling trellis quantization on the Y2 block in commit dcd29e3, and by changing the quantizer range control in commit 305be4e. Change-Id: I5cce5da0dbc2d22f7d79ee48149f01e868a64802
2010-10-12Add simple version of activity masking.Timothy B. Terriberry
This uses MB variance to change the RDO weight for mode decision and quantization. Activity is normalized against the average for the frame, which is currently tracked using feed-forward statistics. This could also be used to adjust the quantizer for the entire frame, but that requires more extensive rate control changes. This does not yet attempt to adapt the quantizer within the frame, but the signaling cost means that will likely only be useful at very high rates. Change-Id: I26cd7c755cac3ff33cfe0688b1da50b2b87b9c93
2010-09-29Moved row-specific computation of MV bounds out of col loopAdrian Grange
Moved the bounds computation on vertical MV component out of the loop that processes MBs within a MB row.
2010-09-28Made AltRef filter adaptive & added motion compensationAdrian Grange
Modified AltRef temporal filter to adapt filter length based on macroblock coding modes selected during first-pass encode. Also added sub-pixel motion compensation to the AltRef filter.
2010-09-09Use WebM in copyright notice for consistencyJohn Koleszar
Changes 'The VP8 project' to 'The WebM project', for consistency with other webmproject.org repositories. Fixes issue #97. Change-Id: I37c13ed5fbdb9d334ceef71c6350e9febed9bbba
2010-09-03Reduced the size of MB_MODE_INFOScott LaVarnway
Moved partition_bmi and partition_count out of MB_MODE_INFO and placed into MACROBLOCK. Also reduced the size of other members of the MB_MODE_INFO struct. For 1080p, the memory was reduced by 1,209,516 bytes. The decoder performance appeared to improve by 3% for the clip used. Note: The main goal for this change is to improve the decoder performance. The encoder will be revisited at a later date for further structure cleanup. Change-Id: I4733621292ee9cc3fffa4046cb3fd4d99bd14613
2010-09-02Whitespace: nuke CRLFsJohn Koleszar
Change-Id: I8b9fdf9875a8fcff4cb49a3357ce44f18108c2e7
2010-09-02added separate rounding/zbin constants for 2nd orderYaowu Xu
This allows experiments of using different rounding and zerobin constants for 2nd order blocks. Change-Id: Idd829adba3edd1f713c66151a8d29bb245e33a71
2010-08-31Changed above and left context data layoutScott LaVarnway
The main reason for the change was to reduce cycles in the token decoder. (~1.5% gain for 32 bit) This layout should be more cache friendly. As a result of this change, the encoder had to be updated. Change-Id: Id5e804169d8889da0378b3a519ac04dabd28c837 Note: dixie uses a similar layout
2010-08-13move segmentation_common to encoderJohn Koleszar
vp8_update_gf_useage_maps() is only used by the encoder. This patch fixes the ability to build in decode-only or encode-only configurations. Change-Id: I3a5211428e539886ba998e09e8abd747ac55c9aa
2010-08-12Removed unnecessary MB_MODE_INFO copiesScott LaVarnway
These copies occurred for each macroblock in the encoder and decoder. Thetemp MB_MODE_INFO mbmi was removed from MACROBLOCKD. As a result, a large number compile errors had to be fixed. Change-Id: I4cf0ffae3ce244f6db04a4c217d52dd256382cf3
2010-08-11Moved gf_active code to encoder onlyScott LaVarnway
The gf_active code is only used by the encoder, so it was moved from common and decoder. Change-Id: Iada15acd5b2b33ff70c34668ca87d4cfd0d05025
2010-08-10Normalize quantizer's zero bin and rounding factorsYaowu Xu
This patch changes a few numbers in the two constant arrays for quantizer's zerobin and rounding factors, in general to make the sum of the two factors for any Q to be 128. While it might be beneficial to calibrate the two arrays for best quantizer performance, it is not the purpose of this patch. Normalizing the two arrays will enable quick optimization of the current faster quantizer, i.e .zerobin check can be removed. Change-Id: If9abfd7929bf4b8e9ecd64a79d817c6728c820bd
2010-07-28Enable the switch between two versions of quantizerYaowu Xu
To facilitate more testing related to quantizer and rate control, the old version quantizer is added back. old and new quantizer can be switched back and forth by define or un-define the macro "EXACT_QUANT". Change-Id: Ia77e687622421550f10e9d65a9884128a79a65ff
2010-07-23Swap alt/gold/new/last frame buffer ptrs instead of copying.Fritz Koenig
At the end of the decode, frame buffers were being copied. The frames are not updated after the copy, they are just for reference on later frames. This change allows multiple references to the same frame buffer instead of copying it. Changes needed to be made to the encoder to handle this. The encoder is still doing frame buffer copies in similar places where pointer reference could be done. Change-Id: I7c38be4d23979cc49b5f17241ca3a78703803e66
2010-07-23Make the quantizer exact.Timothy B. Terriberry
This replaces the approximate division-by-multiplication in the quantizer with an exact one that costs just one add and one shift extra. The asm versions have not been updated in this patch, and thus have been disabled, since the new method requires different multipliers which are not compatible with the old method. Change-Id: I53ac887af0f969d906e464c88b1f4be69c6b1206
2010-06-18cosmetics: trim trailing whitespaceJohn Koleszar
When the license headers were updated, they accidentally contained trailing whitespace, so unfortunately we have to touch all the files again. Change-Id: I236c05fade06589e417179c0444cb39b09e4200d
2010-06-04LICENSE: update with latest textJohn Koleszar
Change-Id: Ieebea089095d9073b3a94932791099f614ce120c
2010-05-18Initial WebM releaseJohn Koleszar