]> granicus.if.org Git - libvpx/commitdiff
For CBR, keep rate-correction damping factor to 2.
authorMarco Paniconi <marpan@google.com>
Thu, 14 Nov 2013 00:02:54 +0000 (16:02 -0800)
committerMarco Paniconi <marpan@google.com>
Thu, 14 Nov 2013 00:14:31 +0000 (16:14 -0800)
The switch to the rate-correction damping factor
in https://gerrit.chromium.org/gerrit/#/c/67536/ was not conditioned on CBR mode.

Change-Id: I2326704e8ac030a4f7b592dd3fedb94c7dd0644d

test/datarate_test.cc
vp9/encoder/vp9_onyx_if.c

index 85f4bb668a3880ed9bfd841be8041998460704ba..5785a0aaca77c0871d4ca6a957ed5c2b0a1172f2 100644 (file)
@@ -248,9 +248,9 @@ TEST_P(DatarateTestVP9, BasicRateTargeting) {
     cfg_.rc_target_bitrate = i;
     ResetModel();
     ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
-    ASSERT_GE(cfg_.rc_target_bitrate, effective_datarate_ * 0.8)
+    ASSERT_GE(cfg_.rc_target_bitrate, effective_datarate_ * 0.9)
         << " The datarate for the file exceeds the target by too much!";
-    ASSERT_LE(cfg_.rc_target_bitrate, effective_datarate_ * 1.3)
+    ASSERT_LE(cfg_.rc_target_bitrate, effective_datarate_ * 1.1)
         << " The datarate for the file missed the target!";
   }
 }
index 8a983431017ba849305eeac0a7f56f71b2a84a82..926e91f71431e68e56c8a93de5a15fd41fb9dc70 100644 (file)
@@ -3443,7 +3443,9 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
 
   // Post encode loop adjustment of Q prediction.
   if (!active_worst_qchanged)
-    vp9_update_rate_correction_factors(cpi, (cpi->sf.recode_loop) ? 2 : 0);
+    vp9_update_rate_correction_factors(cpi, (cpi->sf.recode_loop ||
+        cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) ? 2 : 0);
+
 
   cpi->last_q[cm->frame_type] = cm->base_qindex;