summaryrefslogtreecommitdiff
path: root/vp8/encoder/ratectrl.c
AgeCommit message (Collapse)Author
2012-08-03Merging in high_precision_mv experimentDeb Mukherjee
Merged in the high_precision_mv experiment to make it easier to work on new mv encoding strategies. Also removed coef_update_probs3(). Change-Id: I82d3b0bb642419fe05dba82528bc9ba010e90924
2012-08-0216x16 DCT blocks.Daniel Kang
Set on all 16x16 intra/inter modes Features: - Butterfly fDCT/iDCT - Loop filter does not filter internal edges with 16x16 - Optimize coefficient function - Update coefficient probability function - RD - Entropy stats - 16x16 is a config option Have not tested with experiments. hd: 2.60% std-hd: 2.43% yt: 1.32% derf: 0.60% Change-Id: I96fb090517c30c5da84bad4fae602c3ec0c58b1c
2012-07-30Adds support for switchable interpolation filters.Deb Mukherjee
Allows for swtiching/setting interpolation filters at the MB level. A frame level flag indicates whether to use a specifc filter for the entire frame or to signal the interpolation filter for each MB. When switchable filters are used, the encoder chooses between 8-tap and 8-tap sharp filters. The code currently has options to explore other variations as well, which will be cleaned up subsequently. One issue with the framework is that encoding is slow. I tried to do some tricks to speed things up but it is still slow. Decoding speed should not be affected since the number of filter taps remain unchanged. With the current version, we are up 0.5% on derf on average but some videos city/mobile improve by close to 4 and 2% respectively. If we did a full-search by turning the SEARCH_BEST_FILTER flag on, the results are somewhat better. The framework can be combined with filtered prediction, and I seek feedback regarding that. Rebased. Change-Id: I8f632cb2c111e76284140a2bd480945d6d42b77a
2012-07-17Restyle codeJohn Koleszar
Approximate the Google style guide[1] so that that there's a written document to follow and tools to check compliance[2]. [1]: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml [2]: http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py Change-Id: Idf40e3d8dddcc72150f6af127b13e5dab838685f
2012-06-28Add lossless compression mode.Hui Su
This commit adds lossless compression capability to the experimental branch. The lossless experiment can be enabled using --enable-lossless in configure. When the experiment is enabled, the encoder will use lossless compression mode by command line option --lossless, and the decoder automatically recognizes a losslessly encoded clip and decodes accordingly. To achieve the lossless coding, this commit has changed the following: 1. To encode at lossless mode, encoder forces the use of unit quantizer, i.e, Q 0, where effective quantization is 1. Encoder also disables the usage of 8x8 transform and allows only 4x4 transform; 2. At Q 0, the first order 4x4 DCT/IDCT have been switched over to a pair of forward and inverse Walsh-Hadamard Transform (http://goo.gl/EIsfy), with proper scaling applied to match the range of the original 4x4 DCT/IDCT pair; 3. At Q 0, the second order remains to use the previous walsh-hadamard transform pair. However, to maintain the reversibility in second order transform at Q 0, scaling down is applied to first order DC coefficients prior to forward transform, and scaling up is applied to the second order output prior to quantization. Symmetric upscaling and downscaling are added around inverse second order transform; 4. At lossless mode, encoder also disables a number of minor features to ensure no loss is introduced, these features includes: a. Trellis quantization optimization b. Loop filtering c. Aggressive zero-binning, rounding and zero-bin boosting d. Mode based zero-bin boosting Lossless coding test was performed on all clips within the derf set, to verify that the commit has achieved lossless compression for all clips. The average compression ratio is around 2.57 to 1. (http://goo.gl/dEShs) Change-Id: Ia3aba7dd09df40dd590f93b9aba134defbc64e34
2012-06-27Added Prediction Filter to Mode SelectionAdrian Grange
Added the ability to optionally filter the prediction data when inter modes are selected (excludes SPLITMV, for now). The mode selection loop considers both the filtered and non-filtered prediction data when choosing mode. The filter can be turned on/off at the frame-level, or signaled for each MB. Change-Id: I1b783c71d95a361ab36c761b07e8a6b06bc36822
2012-06-25Continued adaptive entropy codingDeb Mukherjee
Incorporates mv_ref, mbsplit and second_mv into the adaptive entropy framework. The mv_ref framework has been modified from before. Adds some clean-ups and fixes. Results with the adaptive entropy experiment are currently up by +1.93% on derf; +2.33% std-hd and +1.87% yt-hd. Fixed a nasty intermittent bug. Change-Id: I4b1ac9f9483b48432597595195bfec05f31d1e39
2012-06-18Fix a bunch of warnings.Christian Duvivier
Change-Id: I883b4f63559c1cf66a25016e946b1b1ae98a20da
2012-06-15Adaptive entropy coding of coefficients, modes, mv.Deb Mukherjee
This patch incorporates adaptive entropy coding of coefficient tokens, and mode/mv information based on distributions encountered in a frame. Specifically, there is an initial forward update to the probabilities in the bitstream as before for coding the symbols in the frame, however at the end of decoding each frame, the forward update to the probabilities is reverted and instead the probabilities are updated towards the actual distributions encountered within the frame. The amount of update is weighted by the number of hits within each context. Results on derf/hd/std-hd are all up by 1.6%. On derf, the most of the gains come from coefficients, however for the hd and std-hd sets, the most of the gains come from the mode/mv information updates. Change-Id: I708c0e11fdacafee04940fe7ae159ba6844005fd
2012-05-15Adds new Directional Intra prediction modes.Deb Mukherjee
Adds 6 directional intra predictiom modes for 16x16 and 8x8 blocks. Change-Id: I25eccc0836f28d8d74922e4e9231568a648b47d1
2012-04-20change to allow 8x8 transform alwaysYaowu Xu
This commit changed to enable the usage 8x8 transform for all frame type, all resolution and all quantizer range. This has an overall benefit .2% to .3% in term of compression, but more importantly, the difficult clips benefits much more, up to 2% to 3% on clips like football, harbour and so on. We observed some weird humps on very high end on a couple of youtube clips, but have determined the underly cause was the aggressive zbin having an effect of lowering rate with lower quality, which have an impact on slide show clips around 60DB. The commit does not change the association between prediction mode and transform size. Change-Id: I33043bdce6207528ae00b4a4b26d8ff63cfea1f4
2012-04-17Added intra mode probabilites into coding_contextYaowu Xu
These contexts need to be saved and restored for recode, otherwise encoder/decoder mismatch happens for some clips (eg._mobcal 720p) Change-Id: Ic65cfa0bf56ed0472ecab962ce31394d59d344bf
2012-04-11Refactoring of encode loop and bitstream packingPaul Wilkins
Some code re-factored / moved to allow the main pack operation inside the recode loop so that the size estimate is accurate. Deletion of some redundant code relating to one pass. Aproximate improvement over March 27 code base: Derf 0.0%, YT 0.5%, YThd 0.3% Std_hd 0.25% Change-Id: Id2d071794ab44f0b52935f6fcdb5733d09a6bb86
2012-03-21enable 8x8 transform for MBs in intra framesYaowu Xu
When ac_yquant>171, a key frame is enabled to use 8x8 transform. In such case, MBs with DC_PRED or TM_PRED are selected to use T8x8. This change helped the full STD-HD set by ~.1% or so, which is reasonable considering how often key frame occurs in these encodings. Change-Id: Id17009ef6327252177b19e6bf0d6628827febaf1
2012-03-14fixed a bug of context overwritten by key frame recodingYaowu Xu
The recoding loop save and restore frame coding context for recodes. However in recoding of key frames, some of the coding context saved was stale from last encoded inter frame. The save/restore sometimes overwrites the re-inintialized coding context with saved context from last frame, resulting in encoder/decoder mismatch Change-Id: I354ae2f71074d142602d51d06544c05a2462caaf
2012-03-01Merge t8x8 experimentsYaowu Xu
Change-Id: I8e9b6b154e1a0d0cb42d596366380d69c00ac15f
2012-03-01disable usage of 8x8 for resolution below 360pYaowu Xu
need further investigation on some odd behavior on one youtube clip Change-Id: Iec477986a86b54ef26df2ef69d2f9484e2d1a043
2012-02-28Initial refactoring of high_precision mv code.Deb Mukherjee
This is the first patch for refactoring of the code related to high-precision mv, so that 1/4 and 1/8 pel motion vectors can co-exist in the same bit-stream by use of a frame level flag. The current patch works fine for only use of 1/4th and only use of 1/8th pel mv, but there are some issues with the mode switching in between. Subsequent patches on this change Id will fix the remaining issues. Patch 2: Adds fixes to make sure that multiple mv precisions can co-exist in the bit-stream. Frame level switching has been tested to work correctly. Patch 3: Fixes lines exceeding 80 char Patch 4: http://www.corp.google.com/~debargha/vp8_results/enhinterp.html Results on derf after ssse3 bugfix, compared to everything enabled but the 8-tap, 1/8-subpel and 1/16-subpel uv. Overall the gains are about 3% now. Hopefully there are no more bugs lingering. Apparently the sse3 bug affected the quartel subpel results more than the eighth pel ones (which is understandabale because one bad predictor due to the bug, matters less if there are a lot more subpel options available as in the 1/8 subpel case). The results in the 4th column correspond to the current settings. The first two columns correspond to two settings of adaptive switching of the 1/4 or 1/8 subpel mode based on initial Q estimate. These do not work as good as just using 1/8 all the time yet. Change-Id: I3ef392ad338329f4d68a85257a49f2b14f3af472
2012-02-28Try to enable 8x8 tranform for smaller resolutionYaowu Xu
The commit overall on derf test is break even to very slightly positive comparing to all 4x4 transform. Change-Id: I2a7c19599aa54c2d3a5b35db0dc891ba8a6a2b26
2012-02-26Code Cleanup.Paul Wilkins
Removal of error_resilient_mode features. The interface has been left in place but does nothing. Change-Id: I2407863bd0d3c98407354507423ca48d29f63b17
2012-02-25Removal of temporal re sampling code.Paul Wilkins
For now the interface elements have been left in place to make sure existing parameter files work but parameters relating to drop frame wont do anything. Change-Id: I579ee614726387381c546845dac4bc03c74c6a07
2012-02-24Further code simplification and clean up.Paul Wilkins
Change-Id: Ifdb17b56090a317b2aa82cf125d57934902c5298
2012-02-17Code base simplification.Paul Wilkins
Removal of most code to do with 1 pass. Removal of cyclic refresh code. Change-Id: I74971082bc19dd76e795d4d2e781a0424cec5c8c
2012-02-16Code simplificationPaul Wilkins
Removal of the pickinter.c and .h files and calls to this code. Removal of some code relating to real time and one pass settings though there is more to be done in this regard. However, vp8_set_speed_features() now only supports modes 0 and 1 and speeds up to 3 so rd should always be set. Change-Id: I62c0c1b6154ab499785baef310536080e87bc4d8
2012-02-10Improved coding using 8x8 transformRonald S. Bultje
In summary, this commit encompasses a series of changes in attempt to improve the 8x8 transform based coding to help overall compression quality, please refer to the detailed commit history below for what are the rationale underly the series of changes: a. A frame level flag to indicate if 8x8 transform is used at all. b. 8x8 transform is not used for key frames and small image size. c. On inter coded frame, macroblocks using modes B_PRED, SPLIT_MV and I8X8_PRED are forced to using 4x4 transform based coding, the rest uses 8x8 transform based coding. d. Encoder and decoder has the same assumption on the relationship between prediction modes and transform size, therefore no signaling is encoded in bitstream. e. Mode decision process now calculate the rate and distortion scores using their respective transforms. Overall test results: 1. HD set http://www.corp.google.com/~yaowu/no_crawl/t8x8/HD_t8x8_20120206.html (avg psnr: 3.09% glb psnr: 3.22%, ssim: 3.90%) 2. Cif set: http://www.corp.google.com/~yaowu/no_crawl/t8x8/cif_t8x8_20120206.html (avg psnr: -0.03%, glb psnr: -0.02%, ssim: -0.04%) It should be noted here, as 8x8 transform coding itself is disabled for cif size clips, the 0.03% loss is purely from the 1 bit/frame flag overhead on if 8x8 transform is used or not for the frame. ---patch history for future reference--- Patch 1: this commit tries to select transform size based on macroblock prediction mode. If the size of a prediction mode is 16x16, then the macroblock is forced to use 8x8 transform. If the prediction mode is B_PRED, SPLITMV or I8X8_PRED, then the macroblock is forced to use 4x4 transform. Tests on the following HD clips showed mixed results: (all hd clips only used first 100 frames in the test) http://www.corp.google.com/~yaowu/no_crawl/t8x8/hdmodebased8x8.html http://www.corp.google.com/~yaowu/no_crawl/t8x8/hdmodebased8x8_log.html while the results are mixed and overall negative, it is interesting to see 8x8 helped a few of the clips. Patch 2: this patch tries to hard-wire selection of transform size based on prediction modes without using segmentation to signal the transform size. encoder and decoder both takes the same assumption that all macroblocks use 8x8 transform except when prediciton mode is B_PRED, I8X8_PRED or SPLITMV. Test results are as follows: http://www.corp.google.com/~yaowu/no_crawl/t8x8/cifmodebase8x8_0125.html http://www.corp.google.com/~yaowu/no_crawl/t8x8/hdmodebased8x8_0125log.html Interestingly, by removing the overhead or coding the segmentation, the results on this limited HD set have turn positive on average. Patch 3: this patch disabled the usage of 8x8 transform on key frames, and kept the logic from patch 2 for inter frames only. test results on HD set turned decidedly positive with 8x8 transform enabled on inter frame with 16x16 prediction modes: (avg psnr: .81% glb psnr: .82 ssim: .55%) http://www.corp.google.com/~yaowu/no_crawl/t8x8/hdintermode8x8_0125.html results on cif set still negative overall Patch 4: continued from last patch, but now in mode decision process, the rate and distortion estimates are computed based on 8x8 transform results for MBs with modes associated with 8x8 transform. This patch also fixed a problem related to segment based eob coding when 8x8 transform is used. The patch significantly improved the results on HD clips: http://www.corp.google.com/~yaowu/no_crawl/t8x8/hd8x8RDintermode.html (avg psnr: 2.70% glb psnr: 2.76% ssim: 3.34%) results on cif also improved, though they are still negative compared to baseline that uses 4x4 transform only: http://www.corp.google.com/~yaowu/no_crawl/t8x8/cif8x8RDintermode.html (avg psnr: -.78% glb psnr: -.86% ssim: -.19%) Patch 5: This patch does 3 things: a. a bunch of decoder bug fixes, encodings and decodings were verified to have matched recon buffer on a number of encodes on cif size mobile and hd version of _pedestrian. b. the patch further improved the rate distortion calculation of MBS that use 8x8 transform. This provided some further gain on compression. c. the patch also got the experimental work SEG_LVL_EOB to work with 8x8 transformed macroblock, test results indicates it improves the cif set but hurt the HD set slightly. Tests results on HD clips: http://www.corp.google.com/~yaowu/no_crawl/t8x8/HD_t8x8_20120201.html (avg psnr: 3.19% glb psnr: 3.30% ssim: 3.93%) Test results on cif clips: http://www.corp.google.com/~yaowu/no_crawl/t8x8/cif_t8x8_20120201.html (avg psnr: -.47% glb psnr: -.51% ssim: +.28%) Patch 6: Added a frame level flag to indicate if 8x8 transform is allowed at all. temporarily the decision is based on frame size, can be optimized later one. This get the cif results to basically unchanged, with one bit per frame overhead on both cif and hd clips. Patch 8: Rebase and Merge to head by PGW. Fixed some suspect 4s that look like hey should be 64s in regard to segmented EOB. Perhaps #defines would be bette. Bulit and tested without T8x8 enabled and produces unchanged output. Patch 9: Corrected misalligned code/decode of "txfm_mode" bit. Limited testing for correct encode and decode with T8x8 configured on derf clips. Change-Id: I156e1405d25f81579d579dff8ab9af53944ec49c
2012-02-09Merge Extended Q experiment.Paul Wilkins
Merge the extended Q experiment as indicated by the Change-Id: I02d9e654fff9998cc7e9e2f1f5cd838dad8fb431
2012-02-06Merged NEWNEAR experimentPaul Wilkins
This commit merges the NEWNEAR experiment such that it is effectively always on. The fact that there were changes in the threading code again highlights the need to strip out such features during the bitstream development phase as trying to maintain this code (especially as it is not being tested) slows the development cycle. Change-Id: I8b34950a1333231ced9928aa11cd6d6459984b65
2012-01-17Rate control on static scenes plus Y2dc delta Q fix.Paul Wilkins
A problem can arise on static clips with force key frames where attempts to avoid popping lead to a progressive reduction in key frame Q that ultimately may lead to unexpected overspend against the rate target. The changes in this patch help to insure that in such clips the quality of the key frames across the clip is more uniform (rather than starting bad and getting better - especially at low target rates). This patch also includes a fix that removes a delta on the Y2DC when the baseline q index < 4 as this is no longer needed. There is also a fix to try and prevent repeat single step Q adjustment in the recode loop leading to lots of recodes, especially where the use of forced skips as part of segmentation has made the impact of Q on the number of bits generated much smaller. Patch 2: Amend "last_boosted_qindex" calculation for arf overlay frames. Change-Id: Ia1feeb79ed8ed014e4239994fcf5e58e68fd9459
2011-12-12QINDEX_RANGE fixed tables.Paul Wilkins
Removed a couple more fixed tables for the extended quantizer experiment that depend on QINDEX_RANGE. Change-Id: I2c15ffc7488c2a2b8d6504e2c4b6b2339799d117
2011-12-09Revised coding using adaptive mode context to depend on frame typeYaowu Xu
A previous commit 76feb965 made the vp8_mode_context adaptive on a frame frame basis, this commit further made the coding context adaptive to two frame types separately. Tests on derf set showed a further small gain on all metrics: avg psnr 0.10%, glb psnr: 0.11%, ssim: 0.08% http://www.corp.google.com/~yaowu/no_crawl/newNearMode_1209.html Change-Id: I7b3e32ec8729de1903d14a3f1213f1624b78cdee
2011-12-07Removed #if CONFIG_MULCONTEXTYaowu Xu
This commit removed the macro CONFIG_MULCONTEXT, which was used to indicate the experiment code for using separate context for altref and normal frames. This commit made the change fully merged in. Change-Id: I525f927f68e2365d37b340ef23b836a136a4f70b
2011-12-07made vp8_mode_context adaptiveYaowu Xu
vp8_mode_contexts[] is an entropy table used to code inter mode choices. It was a fixed constant table. This commit made the entropy context adaptive. Tests on derf set showed very good consistent gains on all metrics: avg psnr .47%, overall psnr .46% and ssim .40%. http://www.corp.google.com/~yaowu/no_crawl/newModeContext.html Change-Id: Ia62b14485c948e2b74586118619c5eb2068b43b2
2011-12-07fixed a crash when MODE_STATS is enabledYaowu Xu
The MODE_STATS macro was used to #ifdef around code for mode entropy stats collection, this commit fixed a crash when MODE_STATS is on. The commit also changed a number of array definitions to use defined macros instead of hard-coded numbers. Change-Id: I114592f53a1e44e31e455f5725f036ae6168735a
2011-12-06Some further QIndex issues with extended QPaul Wilkins
Resolved or factored out some further issues with Q index. Put in a 3rd order polynomial instead of less accurate power function as the best fit on gf and kf boost adjustment. Added avg_q value to use instead of ni_av_qi. Compute segment delta Q values based on avg_q. Fixed bug in adjust_maxq_qrange(). The extended range Q on the derf set, using standard data rates (which do not extend high enough to get big benefits) still show a shortfall of between 0.5 and 1% though so there would appear to be further issues that need to be tracked down. Change-Id: Icfd49b9f401906ba487ef1bef7d397048295d959
2011-12-02added separate entropy context for alt_refYaowu Xu
This commit added code to keep track of separate entropy contexts for normal frames and alt ref frames. The underly assumption was that the two type of frames have different entropy characteristics given they typically have quite different quantization levels. By keeping entropy contexts separate, it helps the entropy context distribution to be more closely adapted to each frame type. Tests on derf set showed a good and very consistent gain on all clips on all metrics, avg psnr: 0.89%, overall psnr: 0.84% and ssim 0.93%. http://www.corp.google.com/~yaowu/no_crawl/mulcontext.html Change-Id: I15bc9697f6ff7829042911fe0c62930585d7e65d
2011-11-22Removal of Qindex LUTS.Paul Wilkins
One of the problems arising when tweaking or adjusting the quantizer tables is that there are a lot of look up tables that depend on the QINDEX. Any adjustment to the link between QINDEX and real quantizer therefore tends to break aspects of for example the rate control. In this check in I have replaced several of the look up tables with functions that approximate the same results as the old Q luts but use a formulaic approach based on real Q values rather than QIndex. This should hopefully make it easier to experiment with changes to the Q tables without always having to go through and hand optimize a set of look up tables. Once things stabilize we may choose to re-instate luts for the sake of performance. Patch 2: Addressed Ronald's comments. vp8_init_me_luts() Added so luts only initialized once. Change-Id: Ic80db2212d2fd01e08e8cb5c7dca1fda1102be57
2011-11-17Clip buffer level to the maximum buffer size in CBRAdrian Grange
The buffer level was able to increase indefinitely rather than being clipped to the maximum buffer size specified by the user. This change checks the buffrer level and prevents it from going beyond the upper limit of the buffer. Change-Id: Ifff55f79d3c018e4d3d77e554b11ada543cc1654
2011-09-16add quantizer adaptive intra mb mode encodingYaowu Xu
make intra mode coding entropy distribution adaptive to baseQindex, an encoding test on hd clips with all key frame shows universal gain on all clips in both .2%(psnr) and (ssim).3%. To build and test, configure with --enable-experimental --enable-qimode Change-Id: Iaa69241b984d4fdd8baa6d77ee78c0140f5ac00a
2011-09-16add 8x8 intra prediction modesYaowu Xu
Patch 1 to Patch 3 is an initial implementation of 8x8 intra prediction modes, here are with the following assumptions: a. 8x8 has 4 prediction modes DC, H, V and TM b. UV 4x4 block use the same mode as corresponding 8x8 area c. i8x8 modes are enabled for key frame only for now Patch 4: d. removed debug code from previous patches Patch 5: e. added stats code to collect entropy stats and further cleaned up Patch 6: f. changed mode stats code to collect finer stats of modes Patch 7: g. normalized i8x8 modes distribution to total at 256 (8bits). Patch 8: h. fixed a bug in decoder and removed debug printf output. Patch 9: i. more cleanups to address paul's comment Patch 10: j. messy rebase/merges to bring the commit up to date. Tests on HD clips encoded with all key frame showing consistent gain on all clips and all metrics:~0.5%(psnr) and 0.6%(ssim): http://www.corp.google.com/~yaowu/no_crawl/i8x8hd_allkey_fixedq.html To build and test, configure with: --enable-experimental --enable-i8x8 Change-Id: I9813fe07ae48cab5fdb5d904bca022514ad01e7f
2011-08-16Merge remote branch 'internal/upstream' into HEADJohn Koleszar
2011-08-12Revert "Improved 1-pass CBR rate control"John Koleszar
This reverts commit b5ea2fbc2c1554769848774c836aad262af95072. Further testing showed noticable keyframe popping in some cases, reverting this for now to give time for a proper fix. Conflicts: vp8/encoder/onyx_if.c vp8/encoder/ratectrl.c Change-Id: I159f53d1bf0e24c035754ab3ded8ccfd58fd04af
2011-07-27Merge remote branch 'origin/master' into experimentalJohn Koleszar
Change-Id: I1ae82458536ba2f0969e1bea78f41cd16fe96b79
2011-07-26cosmetics: consistently use [u]int64_tJames Zern
Removes mixed usage of (unsigned) long long and INT64. Fixes Issue #208. Change-Id: I220d3ed5ce4bb1280cd38bb3715f208ce23cf83a
2011-07-19Merge remote branch 'origin/master' into experimentalJohn Koleszar
Change-Id: Ida9204624fe3fb99fed1b149d1f88159480fdd83
2011-07-18Improved 1-pass CBR rate controlJohn Koleszar
This patch attempts to improve the handling of CBR streams with respect to the short term buffering requirements. The "buffer level" is changed to be an average over the rc buffer, rather than a long running average. Overshoot is also tracked over the same interval and the golden frame targets suppressed accordingly to correct for overly aggressive boosting. Testing shows that this is fairly consistently positive in one metric or another -- some clips that show significant decreases in quality have better buffering characteristics, others show improvenents in both. Change-Id: I924c89aa9bdb210271f2e03311e63de3f1f8f920
2011-06-27Merge remote branch 'origin/master' into experimentalJohn Koleszar
Change-Id: I689f4624a53184a72258df575305eb1aa97e61ca
2011-06-23Revert "Reduce overshoot in 1 pass rate control"John Koleszar
This reverts commit 212f6183739d448ad5fa2ccf1b4edd30829b2806. Further testing shows that the overshoot accumulation/damping is too aggressive on some clips. Allowing the accumulated overshoot to decay and limiting to damping to golden frames shows some promise. But some clips show significant overshoot in the buffer window, so I think this still needs work. Change-Id: Ic02a9ca34f55229f9cc04786f4fab54cdc1a3ef5
2011-06-17Merge remote branch 'origin/master' into experimentalJohann
Conflicts: vp8/encoder/encodeframe.c vp8/encoder/rdopt.c Change-Id: I8bab720889ac652361abdedfe2cc91a89742cb30
2011-06-03Reduce overshoot in 1 pass rate controlJohn Koleszar
This patch attempts to reduce the peak bitrate hit by the encoder when using small buffer windows. Tested on the CIF set over 200-500kbps using these settings: --buf-sz=500 --buf-initial-sz=250 --buf-optimal-sz=250 \ --undershoot-pct=100 Two pass encodes were tested at best quality. One pass encodes were tested only at realtime speed 4: --rt --cpu-used=-4 The peak datarate (over the specified 500ms window) was measured for each encode, and averaged together to get metric for "average peak," computed as SUM(peak)/SUM(target). This patch reduces the average peak datarate as follows: One pass: baseline: 1.29715 this patch: 1.23664 Two pass: baseline: 1.32702 this patch: 1.37824 This change had a positive effect on our quality metrics as well: One pass CBR: Min / Mean / Max (pct) Average PSNR -0.42 / 2.86 / 27.32 Overall PSNR -0.90 / 2.00 / 17.27 SSIM -0.05 / 3.95 / 37.46 Two pass CBR: Min / Mean / Max (pct) Average PSNR -4.47 / 4.35 / 35.99 Overall PSNR -3.40 / 4.18 / 36.46 SSIM -4.56 / 6.98 / 53.67 One pass VBR: Min / Mean / Max (pct) Average PSNR -5.21 / 0.01 / 3.30 Overall PSNR -8.10 / -0.38 / 1.21 SSIM -7.38 / -0.11 / 3.17 (note: most values here were close to the mean, there were a few outliers on files that were very sensitive to golden frame size) Two pass VBR: Min / Mean / Max (pct) Average PSNR 0.00 / 0.00 / 0.00 Overall PSNR 0.00 / 0.00 / 0.00 SSIM 0.00 / 0.00 / 0.00 Neither one pass or two pass CBR mode adheres particularly strictly to the short term buffer constraints, and two pass is less consistent, even in the baseline commit. This should be addressed in a later commit. This likely will hurt the quality numbers, as it will have to reduce the burstiness of golden frames. Aside: My work on this commit makes it clear that we need to make rate control modes "pluggable", where you can easily write a new one or work on one in isolation. Change-Id: I1ea9a48f2beedd59891f1288aabf7064956b4716
2011-05-21Merge remote branch 'origin/master' into experimentalJohn Koleszar
Change-Id: I90a1d0095712e0474b0c03773b57376911027fc6