]> granicus.if.org Git - libvpx/commitdiff
vp9: 1 pass VBR: Fix to rate control at low min-q.
authorMarco <marpan@google.com>
Thu, 13 Apr 2017 00:06:03 +0000 (17:06 -0700)
committerMarco <marpan@google.com>
Thu, 13 Apr 2017 18:44:35 +0000 (11:44 -0700)
Fix to avoid getting stuck at very low Q even
though content is changing, which can happen for --min-q=0.

Fix is to more aggressively increase active_worst_quality
when detecting significant rate_deviation at very low Q.

Change will only affect 1 pass VBR for --min-q < 4, so no
change in ytlive metrics for --min-q >= 4.

Change-Id: I4dd77dd7c08a30a4390da0ff2c8bda6fccfa76d7

vp9/encoder/vp9_ratectrl.c

index f79b7c6fc27e6e354d12acf3de3f60d9f28d31f0..b1866cd8ab6811c2cd751a11ffc2538c228cd080 100644 (file)
@@ -2172,6 +2172,11 @@ void adjust_gf_boost_lag_one_pass_vbr(VP9_COMP *cpi, uint64_t avg_sad_current) {
     if (rate_err < 2.0 && !high_content) {
       rc->fac_active_worst_inter = 120;
       rc->fac_active_worst_gf = 90;
+    } else if (rate_err > 8.0 && rc->avg_frame_qindex[INTER_FRAME] < 16) {
+      // Increase active_worst faster at low Q if rate fluctuation is high.
+      rc->fac_active_worst_inter = 200;
+      if (rc->avg_frame_qindex[INTER_FRAME] < 8)
+        rc->fac_active_worst_inter = 400;
     }
     if (low_content && rc->avg_frame_low_motion > 80) {
       rc->af_ratio_onepass_vbr = 15;