]> granicus.if.org Git - libvpx/commitdiff
vp9: 1 pass cbr: Fix to qp clamping when gf_cbr_boost_pct is used.
authorMarco <marpan@google.com>
Mon, 9 Jan 2017 20:46:01 +0000 (12:46 -0800)
committerMarco <marpan@google.com>
Mon, 9 Jan 2017 20:52:50 +0000 (12:52 -0800)
Avoid the qp-clamping on gf/alt frame if gf_cbr_boost_pct is set.

Change only affect CBR mode when  gf_cbr_boost_pct is set.

Change-Id: I0655ed4f2b047c8ed1ed33a070c17960ad776704

vp9/encoder/vp9_ratectrl.c

index 1eb8b50f01fc1ca00e207424956cdade1158feb1..02059a7054461de3bfd65335b203b7a20e86e694 100644 (file)
@@ -560,6 +560,8 @@ int vp9_rc_regulate_q(const VP9_COMP *cpi, int target_bits_per_frame,
   // In CBR mode, this makes sure q is between oscillating Qs to prevent
   // resonance.
   if (cpi->oxcf.rc_mode == VPX_CBR &&
+      (!cpi->oxcf.gf_cbr_boost_pct ||
+       !(cpi->refresh_alt_ref_frame || cpi->refresh_golden_frame)) &&
       (cpi->rc.rc_1_frame * cpi->rc.rc_2_frame == -1) &&
       cpi->rc.q_1_frame != cpi->rc.q_2_frame) {
     q = clamp(q, VPXMIN(cpi->rc.q_1_frame, cpi->rc.q_2_frame),