summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_ratectrl.c
AgeCommit message (Collapse)Author
2014-10-28Merge "Allow update of golden refernce buffer in CBR mode"Yaowu Xu
2014-10-28Allow update of golden refernce buffer in CBR modeYaowu Xu
This commit changes to allow the usage of golden reference frame in VP9 CBR mode to improve quality. VP9 supports potentially up to 8 reference buffers, it has reference buffers available for this purpose. This was not possible in VP8 as golden and alt-ref buffers were used for temporal scalability purpose in CBR mode in WebRTC. For frames that update golden frame, there can be a quality boost. The amount of allowed bitrate boost can be controlled via parameter rc_max_inter_bitrate_pct. The inital value of the boost ratior is currently based on over_shoot_pct. Further experiments will work out the adaption of this boost value. Change-Id: I0c5f010c8fd8b7b598f69779c1b30e5b2ac30a4d
2014-10-27Merge "Add a new control of max bitrate for inter frame"Yaowu Xu
2014-10-24Add a new control of max bitrate for inter frameYaowu Xu
Change-Id: I205de3611622cff7f751ea8baf9f82784581730a
2014-10-23Enable dual arf with constant q.Paul Wilkins
Add second level arf Q adjustment when using dual arfs in constant Q mode. Previously in constant Q mode enabling dual arf hurt by ~5% but with this change the average benefit is ~1-1.5% with some mid range data points up ~10%. Note however that it still hurts on some clips including some very low motion show content. Change-Id: I5b7789a2f42a6127d9e801cc010c20a7113bdd9b
2014-10-16Change initialization of static_scene_max_gf_interval.Paul Wilkins
This removes an unnecessary restriction that causes a problem (noticed by AWG) when the forced key frame interval is set to a very small value, such as 10. In this case we were being forced to code minimal length GF groups. Change-Id: I76ef5861a09638ff51f61fea02359554184ada53
2014-10-13Add adaptation option for VBR.Paul Wilkins
Allow min and maxQ to creep when the undershoot or overshoot exceeds thresholds controlled by the command line under_shoot_pct and over_shoot_pct values. Default is 100%,100% which ~disables adaptation. Derf results for example undershoot% / overshoot%:- Head:- Mean abs (%rate error) = 14.4% This check in:- 25%/25% - Mean abs (%rate error) = 6.7% PSNR hit -1% SSIM -0.1% 5% / 5% - Mean abs (%rate error) = 2.2% PSNR hit -3.3% SSIM - 1.1% Most of the remaining error and most of the quality hit is at extreme data rates. The adaptation code still has an exception for material that is in effect static so that we don't over adjust and over spend on YT slide show type content. (Rebase of If25a2449a415449c150acff23df713e9598d64c9 to resolve a auto-merge error) Change-Id: Iec4e1613ef0d067454751d8220edb7058dfbd816
2014-10-10Revert "Add adaptation option for VBR."Alex Converse
This reverts commit 869d4ca51957614dcf5093ebb9e322cc8a8405ca. This breaks the build via conflict with e18edd5eb651f9b7563cbd829744807402bfe0d8. Change-Id: If544b99e367a449452834eb8cce600f58c34ec0d
2014-10-10Merge "Add adaptation option for VBR."Paul Wilkins
2014-10-10Add adaptation option for VBR.Paul Wilkins
Allow min and maxQ to creep when the undershoot or overshoot exceeds thresholds controlled by the command line under_shoot_pct and over_shoot_pct values. Default is 100%,100% which ~disables adaptation. Derf results for example undershoot% / overshoot%:- Head:- Mean abs (%rate error) = 14.4% This check in:- 25%/25% - Mean abs (%rate error) = 6.7% PSNR hit -1% SSIM -0.1% 5% / 5% - Mean abs (%rate error) = 2.2% PSNR hit -3.3% SSIM - 1.1% Most of the remaining error and most of the quality hit is at extreme data rates. The adaptation code still has an exception for material that is in effect static so that we don't over adjust and over spend on YT slide show type content. Change-Id: If25a2449a415449c150acff23df713e9598d64c9
2014-10-08Merge "Force better lower quantizer keyframe in case of high quantizer."Jim Bankoski
2014-10-07Force better lower quantizer keyframe in case of high quantizer.Jim Bankoski
Change-Id: Ie69a164bc166b6a8819777038d65a7d9f9c3361f
2014-10-06Improve two pass VBR accuracy.Paul Wilkins
Adjustments to the GF interval choice and minimum boost. Adjustment to the calculation of 2 pass worst q. Compared to 09/29 head there is metrics hit on derf of (-0.123%,-0.191%) Compared to the September 29 head and a baseline on September 18 baseline the accuracy of the VBR rate control measured on the derf set is as follows:- Mean error % / Mean abs(error %) Sept 18 baseline (-7.0% / 14.76%) Sept 29 head (-15.7%, 19.8%) This check in (-1.5% / 14.4%) The mean undershoot is reduced slightly but the worst case overshoot on e.g. harbour/highway is increased. This will be addressed in a later patch. Change-Id: Iffd9b0ab7432a131c98fbaaa82d1e5b40be72b58
2014-09-18Substantial reworking of code for arf and kf groups.Paul Wilkins
Substantial restructuring of the way we estimate the rate of decay in prediction quality and determine the arf interval and amount of boost used. Also other changes to support moving to a lower first pass Q which exposes some new features and allows us to better distinguish genuinely static blocks from low motion or noisy blocks. Net gains now visible on all the test sets with std-hd PSNR up 1.87%. There are still some bad outlier cases but most of these are low motion or slide show type content where the metrics are already high at any given rate. The best + case is up by more than 10%. Change-Id: I18e25170053bdf3188f493ff8062f48a74515815
2014-09-16Adds high bitdepth quantization functionsDeb Mukherjee
Adds various high bitdepth quantization functions. Change-Id: I36fc0bf75a1bd15128ed271df8723de0ac134b0c
2014-09-02[svc] Temporal svc with two pass rate controlMinghai Shang
It's built based on current spatial svc code. We only support one spatial two temporal layers at this time. Change-Id: I1fdc8584354b910331e626bfae60473b3b701ba1
2014-08-19vp9_ratectrl.c : remove dead assignment to clear warningJim Bankoski
Change-Id: Iacc0b5c58032bde372ed9f99b87712547c4d8454
2014-08-14Merge "Moving framerate from VP9EncoderConfig to VP9_COMP."Dmitry Kovalev
2014-08-12Minor Two pass rate control adjustments.Paul Wilkins
Alter way in which we identify static scenes. Remove some redundant code. Change-Id: I883c2ea2e341770648a8663d8881f720ed099b61
2014-08-08Moving framerate from VP9EncoderConfig to VP9_COMP.Dmitry Kovalev
Framerate changes over time, VP9EncoderConfig supposed to have static read-only data. Change-Id: I36580a7ee71243c1eabb57691089691731d03e67
2014-08-08Moving pass from VP9_COMP to VP9EncoderConfig.Dmitry Kovalev
We had a very complicated way to initialize cpi->pass from cfg->g_pass: switch (cfg->g_pass) { case VPX_RC_ONE_PASS: oxcf->mode = ONE_PASS_GOOD; break; case VPX_RC_FIRST_PASS: oxcf->mode = TWO_PASS_FIRST; break; case VPX_RC_LAST_PASS: oxcf->mode = TWO_PASS_SECOND_BEST; break; } cpi->pass = get_pass(oxcf->mode). Now pass is moved to VP9EncoderConfig and initialization is simple: switch (cfg->g_pass) { case VPX_RC_ONE_PASS: oxcf->pass = 0; break; case VPX_RC_FIRST_PASS: oxcf->pass = 1; break; case VPX_RC_LAST_PASS: oxcf->pass = 2; break; } Change-Id: I8f582203a4575f5e39b071598484a8ad2b72e0d9
2014-08-06[spatial svc]Add is_spatial_svc() helper function.Minghai Shang
Change-Id: Ice5376100d8e27cbdaddfd3cd06898cedd2720fe
2014-08-04[spatial svc]Enabl golden frame for base layer and fix wrong ref_frame_flag ↵Minghai Shang
for upper layers in first frame Change-Id: I1fec9c084b499b2f445b79726066d01b136b59fa
2014-07-23[spatial svc]Fix reference issuesMinghai Shang
1. Remove last reference flag for first frame upper layers in one pass mode. 2. Disable refresh golden frame flag for key frames. Change-Id: I44ac1bd2c795169e4fbfdd078ea79a1d33a204d6
2014-07-16Merge "vp9_ratectrl.c: refactor get_active_quality usage"Guillaume Martres
2014-07-14[spatial svc]Implement alt reference framesMinghai Shang
All changes are for spatial svc only. 1. Enable encoding hidden frames in each layer and use alt reference idex to reference the hidden frame in each layer 2. Use golden reference idx for spatial reference 3. For those layers that don't have hidden frames (caused by lack of frame buffers), reference a hidden frame in lower layers 4. Add "auto-alt-refs" in svc options Change-Id: Idf27d1fd2fb5f3ffd9e86d2119235e3dad36c178
2014-07-06vp9_ratectrl.c: refactor get_active_quality usageGuillaume Martres
Change-Id: I53db06acf5bc434f9584136b848322f5870300b3
2014-06-24Dual ARF changes: Buffer index selection.Paul Wilkins
Add indirection to the section of buffer indices. This is to help simplify things in the future if we have other codec features that switch indices. Limit the max GF interval for static sections to fit the gf_group structures. Change-Id: I38310daaf23fd906004c0e8ee3e99e15570f84cb
2014-06-24Adjust arf Q limits with multi-arf.Paul Wilkins
Adjust enforced minimum arf Q deltas for non primary arfs in the middle of an arf/gf group. Change-Id: Ie8034ffb3ac00f887d74ae1586d4cac91d6cace2
2014-06-24Clean out old CONFIG_MULTIPLE_ARF code.Paul Wilkins
Remove the old experimental multi arf code that was under the flag CONFIG_MULTIPLE_ARF. Change-Id: Ib24865abc11691d6ac8cb0434ada1da674368a61
2014-06-24Experiment for mid group second arf.Paul Wilkins
This patch implements a mechanism for inserting a second arf at the mid position of arf groups. It is currently disabled by default using the flag multi_arf_enabled. Results are currently down somewhat in initial testing if multi-arf is enabled. Most of the loss is attributable to the fact that code to preserve the previous golden frame (in the arf buffer) in cases where we are coding an overlay frame, is currently disabled in the multi-arf case. Change-Id: I1d777318ca09f147db2e8c86d7315fe86168c865
2014-06-13Replacing RC_MODE with vpx_rc_mode.Dmitry Kovalev
Both enums are identical. Change-Id: I06653f9c90a2d3a2dd5c741e75b17ee7d066a56f
2014-06-12Adding is_altref_enabled() function.Dmitry Kovalev
Change-Id: I54cdb4ce11590511e6f86bc2fd55771f1c18a20a
2014-06-05Fixes qindex for first frame in 1-pass cq/q modesDeb Mukherjee
Produces sane qindex for the first frame in 1-pass constant and constrained qualirty modes. Change-Id: Ib2a5091df15a23489e9bb5534a2019cf2689755e
2014-06-03Using 2 instead of 3 elements for avg_frame_qindex array.Dmitry Kovalev
The third array element was unused. 2 elements now: key- and interframe. Change-Id: I5b8b9f5d889cc96a204cedfc432059293256298e
2014-06-03Adding buffer levels to RATE_CONTROL struct.Dmitry Kovalev
Change-Id: Ib35ff854378764dc3c6745844c67a33dee545663
2014-05-30Merge "Re-factor some duplicate code."Paul Wilkins
2014-05-28Re-factor some duplicate code.Paul Wilkins
Change-Id: I89a1dbea39c50c7633f746d9c93fec3a289f1b42
2014-05-27Using 2 instead of 3 elements for last_q array.Dmitry Kovalev
Change-Id: I2c6950e7d79fc89c6f97e6dcf47317ef66c453a5
2014-05-22Fix for missing initialization of ratectrl varsDeb Mukherjee
Initializes total_actual_bits and total_target_bits to 0 Change-Id: Ia50d3bf5df765146a44aa1f6045e73367ccf50df
2014-05-22vp9_ratectrl.c: Fix MSVC warnings.Tom Finegan
Change-Id: I4bd635949240880ced5f581c24e981ccd0374e40
2014-05-22Adjust cq_level in constrained quality modeDeb Mukherjee
If we are already saving a lot in bits from the target (maximum) bitrate in the constrained quality mode, allow the quantizer to go lower than the cq level. This hopefully will solve issues with getting too low a bitrate and consequently poor quality for certain videos in cq mode. Change-Id: I1c4e8b0171fcf58f95198b3add85eea5f3c8f19f
2014-05-15Merge "vp9_ratectrl.c: cleanup -wextra warning"Yaowu Xu
2014-05-14vp9_ratectrl.c: cleanup -wextra warningYaowu Xu
Change-Id: I7ca46fa26acd80a21210cb8d9584ad812cb995bf
2014-05-13Tune minq index table for P frames in one_pass_cbr coding modeJingning Han
Allow slightly larger minq-maxq range for P frames. This improves the compression performance of speed -5 for rtc set by 2.7% in psnr. Change-Id: I438653d52d0fe51111509c6092e2334bac2de0cf
2014-05-09Allow speed 5 losslessAlex Converse
tx_mode supercedes whatever mechanism is used to push for 16x16 allowing for the use of the 4x4 transform. Change-Id: I6c3f05ab9fe52050e40cc6303de9334653763289
2014-05-07Remove separate arf and gf minq tables.Paul Wilkins
Merged minq tables for arf and gf cases. These tables were almost the same and for VBR the arf table was not used at all. Change-Id: Ie3c87e91dab613cf06f6945ac1ace0e0e4213d34
2014-05-07Rate control adjustment.Paul Wilkins
Small adjustment to the active Q range calculations. These changes should slightly extend the available Q range for KF/GF/ARF and narrow it for other frames. The results for this change in isolation are broadly positive for SSIM and average PSNR and slightly up but mixed for opsnr. derf +0.293% opsnr, +1.286% SSIM std-hd + 0.528% opsnr, + 1.746% SSIM yt +0.056% opsnr, +0.457% SSIM yt-hd -0.147% opsnr, + 0.226% SSIM Change-Id: If065280342027ecc5d44b49fc1d440dfef041002
2014-05-05Merge "[spatial svc] No need to code full width and height for non key frame"Minghai Shang
2014-05-02[spatial svc] No need to code full width and height for non key frameMinghai Shang
Change-Id: I62ab0f4346b4157a90dc5b5f73ab5e597d69c1bd