summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_ratectrl.c
AgeCommit message (Collapse)Author
2016-06-03Adjustment to VBR rate correction.paulwilkins
Changes to the function the redistributes bits from overshoot or undershoot throughout the rest of the clip to respond more quickly. Change-Id: I90f10900cdd82cf2ce1d8da4b6f91eb5934310da
2016-06-03Remove gf_zeromotion_pct.paulwilkins
The use of this value is preventing rate adjustment on clips or sections that have very little motion but high noise and this can give rise to some sections with massive overshoot. Change-Id: I9a65c7c1148dc5d3a7d8b23e50fc1733f3661621
2016-05-13vp9: Update to rc-metric for keeping track of average frame size.Marco
Rename and change to how its updated. Only affects 1 pass vbr. Small change in metrics (< ~0.1%) on ytlive set. Change-Id: Ibb1fe485699b6c4a8194951c8f229abe2f64b9a5
2016-05-11vp9: Fix to quality regression issue for 1 pass.Marco
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1217 Issue introduced in https://chromium-review.googlesource.com/#/c/339162/. The factor on avg_frame_qindex[INTER_FRAME] in that CL, used for q-basis to set active_best, can cause the QP to decrease too slowly or get stuck in some cases when max-q=63. Removing that factor fixes the regression in issue#1217. Change-Id: I97fe28dca3c2bc2d852b1775f39c62164e032d4f
2016-05-09vp9: 1 pass vbr: Reduce base qp for active_best_quality for inter-frames.Marco
Reduce factor for setting base-qp for active_best_quality (for inter-frames). Small increase in metrics on yt live set. Change-Id: I9cf0ac797783aeddbfaf1ff510696c9035d7c5ee
2016-05-05vp9: Modify logic for gf setting based on up-coming key frame.Marco
For 1 pass vbr mode: Refactor to move the logic for gf setting based on up-coming key frames to a separate function, so same logic can be used for scene-cuts/changes. Change-Id: Ic4ede308e08ba869bb62e4566e19ea31222c5229
2016-04-28vp9: Move the initialization of some rc variables to rc_init.Marco
And initialize a variable (avg_source_sad) that was not initialized to 0. Change-Id: I63223e20fffe2a2ea38f03da62dad16af0618ea4
2016-04-25vp9: 1 pass vbr: Adjust gf boost/interval on motion level.Marco
Add some adjustment for high motion case. Change-Id: If700be1ce849c187ed031221ea7cabbc8d91ec2b
2016-04-25vp9: Add rc quantity to track amount of low motion in scene.Marco
Use it for now in noise estimation to bypass estimation if motion level is high. Change-Id: I033662dc909f2060e4e81abf562a7ad262dc8170
2016-04-20vp9: 1 pass vbr: Small fix on reset avg_intersize_gfint on scene cut.Marco
Change-Id: Ie73d1bbc2c953d010b32097440698f0d060750be
2016-04-20vp9: 1 pass vbr: small adjustment to active_best factor for inter.Marco
Change-Id: I9c68aa9e72969b0ffbf57eb186380ff666745aeb
2016-04-19vp9: Adjust gf period for high average Q and overshoot.Marco
For 1 pass vbr mode. Increase the gf interval for case where average Q is close to max and high overshoot is detected. Small increase in overall avg_psnr/sssim metrics (~0.2/0.1%) for ytlive, but improves the low-end (low bitrate) for several clips (less overshoot). Change-Id: Ifba40f25b4861b2e0d9832c82d5359a6a3dce9f2
2016-04-18vp9: 1 pass vbr: More even spacing for gf near key frame.Marco
More even spacing near key frame and avoid gf on scene cut if its close to key frame. Small increase in metrics for ytlive set (which uses key-period=150). (~0.2% gain) Change only affects 1 pass vbr mode. Change-Id: If1e5a59baf1e0befbaf998522fbc47d94ac5b5df
2016-04-18vp9: Adjustment to active_best_quality for inter_frame, 1 pass vbr.Marco
Change only affects 1 pass vbr. Use a q value somewhat larger (~6%) than avg_frame_qindex[INTER] as basis for active_best_quality for inter-frames. And use the minium of this (avg_frame_qindex) and the active_worst_quality. This reduces some overshoot in ytlive clips. Overall small but positive average increase in metrics (up on average ~0.2%). Change-Id: Icdbaae7872d5675fd38a13c0ec6ce0e2e3b919ce
2016-04-13Merge "vp9: Adjustment to scene-cut detection."Marco Paniconi
2016-04-13vp9: Adjustment to scene-cut detection.Marco
Change recursive weight for average_source_sad and put some constraint on spacing between detected scene-cuts. Change only affects 1 pass real-time mode. Change-Id: I1917e748d845e244812d11aec2a9d755372ec182
2016-04-13Fix Visual Studio build warningYunqing Wang
Fixed warning C4244: '-=' : conversion from 'const double' to 'int', possible loss of data. Change-Id: Ic4691346037767b244e7f71248c2f871f92002f3
2016-04-12vp9: Adjust threshold for scene-change detection.Marco
For 1 pass vbr. Change-Id: I10b7eefc36d65c30844d205e139515bec7fed6af
2016-04-12Merge "vp9: Fix to active_best for GF/ARF in 1 pass vbr."Marco Paniconi
2016-04-12vp9: Fix to active_best for GF/ARF in 1 pass vbr.Marco
Correct the setting of Q basis of GF/ARF in 1 pass vbr. Existing logic would switch to using avg_QP of key frame if avg_QP of inter is less than active worst (even if key frame is not last frame). Instead fix the logic (as per the comment) to use the lower of active_worst_quality and avg_Q for inter as basis for GF/ARF active_best_quality (unless last frame was key frame). Increase in metrics: AvgPSNR/SSIM up by ~0.7/0.3 on ytlive set. Change-Id: I9a628378ec6684bfda9457ebfc2384ef6d8579f7
2016-04-09Step towards making the 2-pass cq mode perceptualDebargha Mukherjee
Uses a metric on fraction of smooth blocks derived from first pass stats in a frame to adjust down the cq_level modestly in the cq mode. The current implementation does not add much complexity, and is fairly light in the adaptation. Change-Id: Ic484e810d5bd51b7bb6b8945f378c7c3d9d27053
2016-04-07vp9: Some adjustments to scene-cut detection.Marco
Change only affects 1 pass vbr mode, speed >=5. Increase min_thresh, decrease boost, and set a min/max value for gf_interval. Change-Id: I9c1e1a1ab0c5780064eb62714ee39a72ea4d2107
2016-03-30vp9-1 pass vbr: Use average QP for active_worst_quality, for inter-frames.Marco
And replace some operation with shift. Change-Id: If1ea874ee05b7238d5f954e55bb3ceda804a091a
2016-03-22Increase min-max q range for normal inter frames.Paul Wilkins
Allow the encode loop to select from a wider range of Q values when encoding normal (non arf or kf) frames. This change is targeted at improving psycho-visual quality in some easy sections that are currently not getting enough bits. This is likely to be a little worse from a metrics perspective and may also have a small impact on encode speed in cases where extra recode iterations are triggered. Change-Id: I667eebf33c753bcbcf8b93596467369e5708b889
2016-03-15Merge "Revert "Fix bug in stats output for HBD.""Paul Wilkins
2016-03-15Revert "Fix bug in stats output for HBD."Paul Wilkins
This reverts commit c7780075ec0e87f74a1a5706dec914aad8dc9200. Change-Id: I2d2e1b387bf0c70cc7238ee4f8edab2aad873489
2016-03-15vp9: Fix to scene cut/content change detection.Marco
Use proper conditon on resolution check. Change-Id: Idf563eb4391f373baf79546414a075b6516a5d35
2016-03-14vp9: Scene cut/content change detection: Adjust gf update.Marco
For 1 pass vbr mode: Increase the period of gf update on scene cut (keep it same as orginal/default setting for now). Change-Id: I679c3bd21152f6c4e486c8098d931c00e1d26b5f
2016-03-14vp9: Scene cut/slide change detection: Increse min_thresh.Marco
Only affects vbr mode. Change-Id: I15e24c50343bc9171c734dfc7685491c7dbb8654
2016-03-11vp9: Fix issue in scene/content change detection.Marco
The change https://chromium-review.googlesource.com/#/c/329181/ also changed behavior for cbr mode, which causes some regression in screenshare test in webrtc. Resetting the specific change to leave the cbr behavior unchanged for now. Change-Id: I52df158806422f86398e1d2f522e92067d8325eb
2016-03-07vp9-svc: Fix to resetting pattern/flags on key frame.Marco
Chane only affects 1 pass cbr svc mode. Change-Id: Ie28557409eb87673ed0b66c6dfe1bf3509a18c4d
2016-03-04Merge "Fix bug in stats output for HBD."Paul Wilkins
2016-03-04Fix bug in stats output for HBD.paulwilkins
Change-Id: Ic3b033e22cdcdc4a0f78cef433b2208fd254c27b
2016-03-02vp9-svc: Fix issues with svc with periodic key frames.Marco
Use the superframe counter to set the key frame, and force it to the key frame on base spatial layer only. Also, update svc frame counters under frame dropping. Update unittest: add specific tests with short key frame period. https://bugs.chromium.org/p/webm/issues/detail?id=1150 Change-Id: I5b1c9a09253e6e5fbfce51b4cf603ae22d422b01
2016-02-23vp9: Update to scene/content change detection.Marco
Update some parameters and put check on frame size change. For 1 pass VBR mode, speed >= 5. Change-Id: If24ed94a21e705ea57d40b9bf235ad079db786fc
2016-02-22vp9 aq-mode=3: Allow it to be used for 1 pass VBR mode.Marco
Change-Id: I630b8e33106c78382545d49da5fb4c75b1b0b528
2016-02-19vp9: 1 pass vbr real-time mode: Adjust gf refresh for scene change.Marco
Use the existing scene/content change detection to better update/adjust golden frame refresh. Change only affects 1 pass real-time vbr mode, speed >=5. Change-Id: I2963a5bb7ca4a19f8cf8511b0a925e502f60e014
2016-01-25vp9: Be more responsive to massive overshoot.Alex Converse
Limit oscilation detection in the case where overshoot is very very large. This keeps the 9-bit cost patch from breaking the DownUp reisze test. The patch pushed us to an 11% undershoot right before a scene cut causing a 1200% overshoot. (Whereas before we were undershooting by only 6% before overshooting by 1200%). Change-Id: Id90ccfab8aba872ccadc45b73b3bb097b895677f
2015-12-15Fixed interval, fixed Q 1 pass test patch.paulwilkins
For testing implemented a fixed pattern and delta, 1 pass, fixed Q, low delay mode. This has not in any way been tuned or optimized. Change-Id: Idf5ee179b277fa15d07a97f14f2ce5bbaae80a04
2015-12-151 pass VBR mode bug fix.paulwilkins
The one pass VBR mode selects a Q range based on a moving average of recent Q values. This calculation should have been excluding arf overlay frames as these are usually coded at the highest allowed value. Their inclusion skews the average and can cause it to drift upwards even when the clip as a whole is undershooting. As such it can undermine correct adaptation of the allowed Q range especially for easy content. Change-Id: I7d10fe4227262376aa2dc2a7aec0f1fd82bf11f9
2015-12-08Changes to exhaustive motion search.paulwilkins
This change has been imported from VP9 and alters the nature and use of exhaustive motion search. Firstly any exhaustive search is preceded by a normal step search. The exhaustive search is only carried out if the distortion resulting from the step search is above a threshold value. Secondly the simple +/- 64 exhaustive search is replaced by a multi stage mesh based search where each stage has a range and step/interval size. Subsequent stages use the best position from the previous stage as the center of the search but use a reduced range and interval size. For example: stage 1: Range +/- 64 interval 4 stage 2: Range +/- 32 interval 2 stage 3: Range +/- 15 interval 1 This process, especially when it follows on from a normal step search, has shown itself to be almost as effective as a full range exhaustive search with step 1 but greatly lowers the computational complexity such that it can be used in some cases for speeds 0-2. This patch also removes a double exhaustive search for sub 8x8 blocks which also contained a bug (the two searches used different distortion metrics). For best quality in my test animation sequence this patch has almost no impact on quality but improves encode speed by more than 5X. Restricted use in good quality speeds 0-2 yields significant quality gains on the animation test of 0.2 - 0.5 db with only a small impact on encode speed. On most natural video clips, however, where the step search is performing well, the quality gain and speed impact are small. Change-Id: Iac24152ae239f42a246f39ee5f00fe62d193cb98
2015-12-03Fix bug when overlaying middle arfs in multi-arf groups.paulwilkins
Do not reset the alt ref active flag when overlaying the middle arf(s) of a multi arf group. Change-Id: Ia55a55a376973f3fd17161429fd2afb07b4df31f
2015-11-20vp9-svc: Fix the setting of is_key_frame.Marco
Change on affects 1 pass CBR. On key frame, temporal layer_id is reset to 0 for 1 pass CBR, but since "layer" is reset, the svc.layer_context[layer].is_key_frame was not correspondingly set properly. Change-Id: I08f6da0a55ac7429ccfbaddfb7be14479e43543b
2015-11-09VP9 dynamic resize: increase waiting time after key frame.jackychen
For 1 pass CBR mode: increase waiting time after key frame before we start sampling rate control behavior for determining resize. This change need to disable one internal resize(DownUp) temporally since it requires a longer clip to do so. Change-Id: If21beda1be23f169ee541ab4dd642f718347887a
2015-10-29Merge "VP9_resizing: add limitation to the downsacling resolution."Jacky Chen
2015-10-29VP9_resizing: add limitation to the downsacling resolution.jackychen
Width and height of downscaling resolution should not be lower than min_width and min_height which can be set as needed, both are 180 for now. Change-Id: I34d06704ea51affbdd814246e22ee8d41d991f00
2015-10-27VP9-SVC: Allow frame dropping due to overshoot for spatial layers.Marco
For 1 pass CBR mode. Change-Id: I8bceb489a850ec26f05382eecb5c0c32a1bb8883
2015-10-23Bug in clamping of base_frame_target.Paul Wilkins
Bug relating to issue:- http://b/25090786 base_frame_target is supposed to track the idealized bit allocation based on error score and not the actual bits allocated to each frame. The clamping of this value based on the VBR min and max pct values was causing a bug where in some cases the loop that adjusts the active max quantizer for each GF group was running out of bits at the end of a KF group. This caused a spike in Q and some ugly artifacts. A second change makes sure that the calculation of the active Q range for a group DOES, however, take account of clamping. Change-Id: I31035e97d18853530b0874b433c1da7703f607d1
2015-10-15Merge "VP9_resizing: adjust the threshold and another improvement."Jacky Chen
2015-10-15Merge "Fix resetting of cyclic refresh on dynamic resize change."Marco Paniconi