]> granicus.if.org Git - libvpx/commitdiff
Refine active best quality of layered ARF frames
authorRavi Chaudhary <ravi.chaudhary@ittiam.com>
Mon, 11 Mar 2019 09:39:08 +0000 (15:09 +0530)
committerRavi Chaudhary <ravi.chaudhary@ittiam.com>
Thu, 18 Apr 2019 06:02:33 +0000 (06:02 +0000)
Change-Id: If630af68fc3793d579a947d5955c2001c0cf0a8d

vp9/encoder/vp9_ratectrl.c

index 7931715472f512288d80917558d4aa42c52ce73c..b51f6797b1af16d90f805e3f2e619c6a1a86ee6a 100644 (file)
@@ -1446,20 +1446,19 @@ static int rc_pick_q_and_bounds_two_pass(const VP9_COMP *cpi, int *bottom_index,
 
       // Constrained quality use slightly lower active best.
       active_best_quality = active_best_quality * 15 / 16;
-
-      // Modify best quality for second level arfs. For mode VPX_Q this
-      // becomes the baseline frame q.
-      if (gf_group->rf_level[gf_group_index] == GF_ARF_LOW) {
-        const int layer_depth = gf_group->layer_depth[gf_group_index];
-        // linearly fit the frame q depending on the layer depth index from
-        // the base layer ARF.
-        active_best_quality =
-            ((layer_depth - 1) * q + active_best_quality + layer_depth / 2) /
-            layer_depth;
-      }
     } else {
       active_best_quality = get_gf_active_quality(cpi, q, cm->bit_depth);
     }
+    // Modify best quality for second level arfs. For mode VPX_Q this
+    // becomes the baseline frame q.
+    if (gf_group->rf_level[gf_group_index] == GF_ARF_LOW) {
+      const int layer_depth = gf_group->layer_depth[gf_group_index];
+      // linearly fit the frame q depending on the layer depth index from
+      // the base layer ARF.
+      active_best_quality =
+          ((layer_depth - 1) * q + active_best_quality + layer_depth / 2) /
+          layer_depth;
+    }
   } else {
     active_best_quality = inter_minq[active_worst_quality];