diff options
author | Paul Wilkins <paulwilkins@google.com> | 2015-10-21 17:20:13 +0100 |
---|---|---|
committer | Paul Wilkins <paulwilkins@google.com> | 2015-10-23 14:45:48 -0700 |
commit | 762c0f22648db04c8722b0425e82ad95cc2034e2 (patch) | |
tree | e474c877219b03858cb0551bb2649c88c40e75bc /vp9/encoder/vp9_ratectrl.c | |
parent | 56cfbeefb43011aec4ef94e1296da0fe30747ee1 (diff) | |
download | libvpx-762c0f22648db04c8722b0425e82ad95cc2034e2.tar libvpx-762c0f22648db04c8722b0425e82ad95cc2034e2.tar.gz libvpx-762c0f22648db04c8722b0425e82ad95cc2034e2.tar.bz2 libvpx-762c0f22648db04c8722b0425e82ad95cc2034e2.zip |
Bug in clamping of base_frame_target.
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
Diffstat (limited to 'vp9/encoder/vp9_ratectrl.c')
-rw-r--r-- | vp9/encoder/vp9_ratectrl.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index 1d13199f2..d70068570 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -1816,6 +1816,11 @@ void vp9_set_target_rate(VP9_COMP *cpi) { RATE_CONTROL *const rc = &cpi->rc; int target_rate = rc->base_frame_target; + if (cpi->common.frame_type == KEY_FRAME) + target_rate = vp9_rc_clamp_iframe_target_size(cpi, target_rate); + else + target_rate = vp9_rc_clamp_pframe_target_size(cpi, target_rate); + // Correction to rate target based on prior over or under shoot. if (cpi->oxcf.rc_mode == VPX_VBR || cpi->oxcf.rc_mode == VPX_CQ) vbr_rate_correction(cpi, &target_rate); |