shithub: libvpx

Download patch

ref: 8e112d9586a9a79227859fc0a39150ac955ff134
parent: c7a905ca3d04dceb3dca5e59fefa3e4231acbc8c
parent: f2b978e895afb8102a5f16b760450935914c08b0
author: Yaowu Xu <yaowu@google.com>
date: Wed Nov 12 03:00:26 EST 2014

Merge "Use normal rate_correction_factor for gf in CBR mode"

--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -369,8 +369,8 @@
     return rc->rate_correction_factors[rf_lvl];
   } 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))
+        !rc->is_src_frame_alt_ref && !cpi->use_svc &&
+        cpi->oxcf.rc_mode != VPX_CBR)
       return rc->rate_correction_factors[GF_ARF_STD];
     else
       return rc->rate_correction_factors[INTER_NORMAL];
@@ -388,8 +388,8 @@
     rc->rate_correction_factors[rf_lvl] = 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))
+        !rc->is_src_frame_alt_ref && !cpi->use_svc &&
+        cpi->oxcf.rc_mode != VPX_CBR)
       rc->rate_correction_factors[GF_ARF_STD] = factor;
     else
       rc->rate_correction_factors[INTER_NORMAL] = factor;
@@ -1186,8 +1186,8 @@
 
   // Post encode loop adjustment of Q prediction.
   vp9_rc_update_rate_correction_factors(
-      cpi, (cpi->sf.recode_loop >= ALLOW_RECODE_KFARFGF ||
-            oxcf->rc_mode == VPX_CBR) ? 2 : 0);
+      cpi, (cpi->sf.recode_loop >= ALLOW_RECODE_KFARFGF) ? 2 :
+            ((oxcf->rc_mode == VPX_CBR) ? 1 : 0));
 
   // Keep a record of last Q and ambient average Q.
   if (cm->frame_type == KEY_FRAME) {