summaryrefslogtreecommitdiff
path: root/vp8/encoder/firstpass.c
AgeCommit message (Collapse)Author
2012-10-14Remove duplicate or unused code in encoder/encodemb.c.Ronald S. Bultje
Also make some minor stylistic changes to bring the code closer to the style guide. Remove distinction between inter and intra transform functions, since both do exactly the same thing except for the check against SPLITMV for the second-order transform. Remove some commented out debug code. Remove 8x8/16x16 transform code in encode_inter16x16y(), since the first-pass only uses 4x4 anyway. Change-Id: Ife54816ff759825b9141f95dc2ba43c253c14dba
2012-10-09convert copy16x16 to rtcdJim Bankoski
Convert copy16x16 from invoke to rtcd. The first in a long string of converts. Change-Id: I296b0aa32f40e9fb649f7a3cb914a4e5300cad63
2012-09-06New motion vector entropy codingDeb Mukherjee
Adds a new experiment with redesigned/refactored motion vector entropy coding. The patch also takes a first step towards separating the integer and fractional pel components of a MV. However the fractional pel encoding still depends on the integer pel part and so they are not fully independent. Further experiments are in progress to see how much they can be decoupled without affecting performance. All components including entropy coding/decoding, costing for MV search, forward updates and backward updates to probability tables, have been implemented. Results so far: derf: +0.19% std-hd: +0.28% yt: +0.80% hd: +1.15% Patch: Simplifies the fractional pel models: derf: +0.284% std-hd: +0.289% yt: +0.849% hd: +1.254% Patch: Some changes in the models, rebased. derf: +0.330% std-hd: +0.306% yt: +0.816% hd: +1.225% Change-Id: I646b3c48f3587f4cc909639b78c3798da6402678
2012-08-14Shut up warnings added by -WundefDaniel Kang
Change-Id: I9c7ef4a75c37aa0e10df75e165e3066614c955ef
2012-08-13Shut up some compiler warnings on gccDaniel Kang
Change-Id: I8548aebd3c39797b253eef472bfe1c40f2f7ec59
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-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-18Fix a bunch of warnings.Christian Duvivier
Change-Id: I883b4f63559c1cf66a25016e946b1b1ae98a20da
2012-06-12Merge of further two pass rc clean up and adjustments.Paul Wilkins
Changes to calculation of sr_coded_error to include 0,0 case. Experimental use of sr_coded_error in calculating correction factor for estimating the allowable Q range. Reinstated some code needed for calculating section_intra_rating. Add flash detection in calculation of KF boost Increased tolerance in testing candidate key frames (needed with longer motion search as this tends to slightly increase inter %. Zbin changes for 8x8. Other minor adjustments, refactoring and bug fixes. Reinstated some motion break out clauses in boost loop as their removal hurt a few 50fps clips badly in the std set. It may be possible to remove them again later if a better way can be found of preventing overly long gf intervals. Change-Id: Iee686d0c31072828bb1ccd2bc63f5f1c7c548ea2
2012-06-08Key frame and GF sizing changes.Paul Wilkins
Changes to the equations for kf and gf minQ and to the boost calculations for kg and gf Change-Id: I312031c910e6a575334f49075c32f49a8dfff239
2012-05-30Rate control fix.Paul Wilkins
This fix addresses some problems with very complex clips like handling of flashes on clips like crew (which was made worse by an earlier patch (derf and std-hd)). Most clips a small effect but some between 1 & 2% Derf +0.039, +0.211% YT +0.042, +0.083% Change-Id: I65fc7c13afc31482040068544dd65b8808f5cb4a
2012-05-29Remove "est_max_qcorrection_factor"Paul Wilkins
Removed the local scaling factor est_max_qcorrection_factor and related code to simplify estimateq calculation (little effect anyway) Cap range of total correction factor. Slight change to break out case to turn off arf. Change-Id: I748187737ba93cfadf016f3dfdf8d2741934067f
2012-05-17Experimental change to two pass prediction decay calculation.Paul Wilkins
Remove dependency on amount and speed of motion as this may not behave well across different image sizes. Tweak impact of % inter. Add in experimental adjustment based on relative quality of an older second reference frame. Cap range of decay values allowed. Some small + effect on derf but -ve on yt & hd at this stage. Change-Id: I390d6f6ebe67a2eb0b834980d0d4650124980d3e
2012-05-15Further firstpass.c changes.Paul Wilkins
base the static image test off a measure of 0,0 motion instead of the decay accumulator value. Change "transition to still detection" to compare the decay rate from successive frames. Minor tweak to the arf extra boost given based on the number of frames affected. Removed unused variable mod_err_per_mb_accumulator. Change-Id: Idd8360083ad409e45f133ce97dd2488259003e64
2012-05-15Move / re-factor some of boost calculation code.Paul Wilkins
Some marginal impact due to the fact that it makes use of arf more likely / stable even in hard sections. Change-Id: Ic72fda0f63eefc9433914b5d9cd374d515810129
2012-05-15Firstpass.c refactoringPaul Wilkins
Removed unused function. Added tentative code to take error score of an older frame into account when calculating Q range. However, for now it is disabled pending merging other changes and testing. Change-Id: Ie89955e70319dac31b79e3b833e3352712a061ec
2012-05-14Two pass refactoring continued.Paul Wilkins
Remove testing of whether we estimate that it will be possible to code an arf at a lower Q than the ambient Q. This adds quite a bit of extra code and complexity for marginal gain. Factored out some code relating to ARNR selection to a separate function as this is likely to be changed / simplified soon. Change-Id: Ia1cf060405637ef5bbf7018355437be21d12375f
2012-05-14Two pass rc refactoring.Paul Wilkins
Removed odd *100 >> 4 factor from boost calculations. Not all the calculations exactly match what was there before so there may be some minor impact on results. Some other minor tidying up in regard to coding conventions. The specific values of factors and thresholds will likely change as part of subsequent patches. Change-Id: Id976321484ac02ba50294cf54fafbc17dda85686
2012-05-11First pass overhaul preparatory change.Paul Wilkins
This is the first patch in a series of changes to the first pass code. (Broken down for ease of testing/merging/review). This patch introduces a new stats element "sr_coded_error". This is the coded error recorded vs the second reference frame (which is updated such that it lags by at least one frame). No use is made of the new structure in this change so this patch should have no material effect. Removed some ifdefs and deprecated code (#if NEW_BOOST). Removed twopass.gf_decay_rate (not used any more) Change-Id: I1be672a73017f7c13fd50fb4f99236aa2ed30916
2012-04-18Compound prediction for splitmv macroblocks.Ronald S. Bultje
Change-Id: I0af3395500b1cb0ed629249eb6636a0c9322cb18
2012-04-12Adjust the key frame placement conditionYaowu Xu
The commit removed a limit on key frame detection, which caused a big drop in all metric measurements for standard HD clip such as _mobcal. This single change helps two standard HD clips by a huge amount, which help the overall std-hd set by 2.4% (glb psnr), 0.9% (avg_psnr), 2.1% (vpxssim). In the result page: http://pafr9.prod.google.com:26163/?/cns/rc-d/home/on2-prod/sunkaras/borg-test/yaowu 2012_04_02_1649_yaowu_bugfix_std-hd 2012_04_03_1452_yaowu_hump_std-hd represent the encoding test results and std-hd set prior and after this commit respectively. Change-Id: Ie4313e317c737ea0e699c3a7919c1376744baa1a
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-04-11Superblock encoding orderAdrian Grange
This is the first patch to add superblock (32x32) coding order capabilities. It does not yet do any mode selection at the SB level, that will follow in a further patch. This patch encodes rows of SBs rather than MBs, each SB contains 2x2 MBs. Two intra prediction modes have been disabled since they require reconstructed data for the above-right MB which may not have been encoded yet (e.g. for the bottom right MB in each SB). Results on the one test clip I have tried (720p GIPS clip) suggest that it is somewhere around 0.2dB worse than the baseline version, so there may be bugs. It has been tested with no experiments enabled and with the following 3 experiments enabled: --enable-enhanced_interp --enable-high_precision_mv --enable-sixteenth_subpel_uv in each case the decode buffer matches the recon buffer (using "cmp" to compare the dumped/decoded frames). Note: Testing these experiments individually created errors. Some problems were found with other experiments but it is unclear what state these experiments are in: --enable-comp_intra_pred --enable-newentropy --enable-uvintra This code has not been extensively tested yet, so there is every likelihood that further bugs remain. I also intend to do some code cleanup & refactoring in tandem with the next patch that adds the 32x32 modes. Change-Id: I1eba7f740a70b3510df58db53464535ef881b4d9
2012-03-05Allow for frame overheads in min frame bandwidth.Paul Wilkins
Change-Id: I6ade229ff400fe492709010ac5bada37f8afa73e
2012-03-01Various bug fixes related to high precision mvDeb Mukherjee
Change-Id: Ie5a7c87d71bd4a541463b68704620d89cec142cf
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-28Experimental branch code clean up.Paul Wilkins
Removal of some further code relating to partitions and error resilience. Spelling correction. Change-Id: I36067aae67a4a23bec359541dda3400b0bbf26d0
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-24Code Simplification.Paul Wilkins
Removal of code relating to spatial re sampling Change-Id: Iff1bc651c62cd528f960c4b27f9673b172e68835
2012-02-24Further code simplification and clean up.Paul Wilkins
Change-Id: Ifdb17b56090a317b2aa82cf125d57934902c5298
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-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-19QRange experiements.Paul Wilkins
High Q end extended a little. Some clean up. Slightly better on SSIM, Slightly worse on PSNR over derf set. Change-Id: I3dceea8a39e11c26e1a389a40e40b86efc76d28c
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-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-11-29Extended Q Range:Paul Wilkins
Addressed a couple of other QIndex dependencies. Change-Id: I15b224bffd0210d3c7065cb6905156f2ca8e9ea9
2011-11-29Further work on extended Q range.Paul Wilkins
Fixed bug in firspass.c call to vp8_initialize_rd_consts() This was passing in vp8_dc_quant(cm->base_qindex, cm->y1dc_delta_q) instead of (cm->base_qindex + cm->y1dc_delta_q). It just so happens that for the value 26 used for cm->base_qindex in the unextended Q case, the two give similar results. However, when using the extended Q range the two are very different. Also added more stats output and partly disabled another broken feature. Change-Id: Iddf6cf5ea8467c44b7c133f38e629f6ba6f2581e
2011-11-23Two pass rate control code changes.Paul Wilkins
This comitt brings accross changes from the public branch commit number Icf74d13af77437c08602571dc7a97e747cce5066. The main puurpose of this comit relates to CQ mode but it also includes some refactoring of the two pass code which I hope will make tuning the experimental branch for the new quantizer range a little less painfull. Change-Id: I278e989436a928fc1fe7761068960048f9d7a376
2011-11-23Further resolution of QIndex LUTS;Paul Wilkins
This commit resolves further QIndex look up tables to facilitate experimentation with the quantizer range. In some cases rather than remove the look up tables completely I have created functions that are called once to populate them using a formulaic approach base on the actual quantizer. The use of these functions based on best fit of data from the original tables does affect the results on some clips but across the derf test set the effect was broadly neutral. Change-Id: I8baa61c97ce87dc09a6340d56fdeb681b9345793
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-08-26Merge remote branch 'internal/upstream' into HEADJohn Koleszar
2011-08-24Quiet warning by removing unused variable.Fritz Koenig
fwd_boost_score was not being computed or referenced, so remove declaration. Change-Id: Iece36cde1ec113e3c6afaff1407d24cdf12bd0a8
2011-08-18Merge remote branch 'internal/upstream' into HEADJohn Koleszar
2011-08-17Small boost to every other frame.Paul Wilkins
Instead of a single mid GF boost apply a few extra bits to every other frame. This gives a very small average metrics improvement on both derf and YT sets. Also use min GF interval as min KF interval. Change-Id: Iee238b8cae0ffaed850a5a944ac825cee18da485
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