]> granicus.if.org Git - libvpx/commitdiff
Separate rate_correction_factor for boosted GFs
authorYaowu Xu <yaowu@google.com>
Fri, 21 Nov 2014 19:55:27 +0000 (11:55 -0800)
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>
Tue, 25 Nov 2014 22:32:07 +0000 (14:32 -0800)
When the golden frame is boosted, the rate correction factor is not
correlated well with other inter frames even in CBR mode. This commit
changes to use GF specific rate_correction_factor when gf_cbr_boost
is greater than 20%.

Change-Id: I6312c1564387bcacc11f4c5e8a9cfdc781b5c3ab

vp9/encoder/vp9_ratectrl.c

index 32acea0ffe4542249eea8ac99a6fdba23ffef220..97ededc5dd7075008165a673937088caa318e541 100644 (file)
@@ -370,7 +370,7 @@ static double get_rate_correction_factor(const VP9_COMP *cpi) {
   } else {
     if ((cpi->refresh_alt_ref_frame || cpi->refresh_golden_frame) &&
         !rc->is_src_frame_alt_ref && !cpi->use_svc &&
-        cpi->oxcf.rc_mode != VPX_CBR)
+        (cpi->oxcf.rc_mode != VPX_CBR || cpi->oxcf.gf_cbr_boost_pct > 20))
       return rc->rate_correction_factors[GF_ARF_STD];
     else
       return rc->rate_correction_factors[INTER_NORMAL];
@@ -389,7 +389,7 @@ static void set_rate_correction_factor(VP9_COMP *cpi, double factor) {
   } else {
     if ((cpi->refresh_alt_ref_frame || cpi->refresh_golden_frame) &&
         !rc->is_src_frame_alt_ref && !cpi->use_svc &&
-        cpi->oxcf.rc_mode != VPX_CBR)
+        (cpi->oxcf.rc_mode != VPX_CBR || cpi->oxcf.gf_cbr_boost_pct > 20))
       rc->rate_correction_factors[GF_ARF_STD] = factor;
     else
       rc->rate_correction_factors[INTER_NORMAL] = factor;