shithub: libvpx

Download patch

ref: 9fdae9385875449d061336cf863f7eea8c89f4b7
parent: 995a967f1959180b2c88ec8f57239b7bd5c8e7ea
author: Marco <marpan@google.com>
date: Thu Oct 20 07:28:48 EDT 2016

vp8: Apply gf target-size boost only when refresh_golden_frame = 1.

Change only affects 1 pass cbr, error resilience off.

Change-Id: I68b896b09d722995a71c44331233e97bd862bcfc

--- a/vp8/encoder/ratectrl.c
+++ b/vp8/encoder/ratectrl.c
@@ -1011,12 +1011,13 @@
       // 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;
     }