]> granicus.if.org Git - libvpx/commitdiff
vp8: Apply gf target-size boost only when refresh_golden_frame = 1.
authorMarco <marpan@google.com>
Thu, 20 Oct 2016 18:28:48 +0000 (11:28 -0700)
committerMarco <marpan@google.com>
Thu, 20 Oct 2016 18:32:29 +0000 (11:32 -0700)
Change only affects 1 pass cbr, error resilience off.

Change-Id: I68b896b09d722995a71c44331233e97bd862bcfc

vp8/encoder/ratectrl.c

index c0de39093c43f5f8a6e1cc2946b5b91ae69123a6..e89247ae4aebcd55f56c62db9f4f1ec0e8b4233b 100644 (file)
@@ -1011,12 +1011,13 @@ static void calc_pframe_target_size(VP8_COMP *cpi) {
       // gf_noboost_onepass_cbr = 1, which forces the gf to use the same
       // rate correction factor as last.
       cpi->gf_noboost_onepass_cbr = (cpi->oxcf.gf_cbr_boost_pct <= 100);
-      cpi->this_frame_target =
-          (cpi->this_frame_target * (100 + cpi->oxcf.gf_cbr_boost_pct)) / 100;
       cpi->baseline_gf_interval = cpi->gf_interval_onepass_cbr;
       // Skip this update if the zero_mvcount is low.
-      if (cpi->zeromv_count > (cpi->common.MBs >> 1))
+      if (cpi->zeromv_count > (cpi->common.MBs >> 1)) {
         cpi->common.refresh_golden_frame = 1;
+        cpi->this_frame_target =
+            (cpi->this_frame_target * (100 + cpi->oxcf.gf_cbr_boost_pct)) / 100;
+      }
       cpi->frames_till_gf_update_due = cpi->baseline_gf_interval;
       cpi->current_gf_interval = cpi->frames_till_gf_update_due;
     }