]> granicus.if.org Git - libvpx/commitdiff
Enable dual arf with constant q.
authorPaul Wilkins <paulwilkins@google.com>
Wed, 22 Oct 2014 12:46:40 +0000 (13:46 +0100)
committerPaul Wilkins <paulwilkins@google.com>
Thu, 23 Oct 2014 12:19:31 +0000 (13:19 +0100)
Add second level arf Q adjustment when using dual arfs
in constant Q mode.

Previously in constant Q mode enabling dual arf hurt by ~5%
but with this change the average benefit is ~1-1.5% with some
mid range data points up ~10%.

Note however that it still hurts on some clips including
some very low motion show content.

Change-Id: I5b7789a2f42a6127d9e801cc010c20a7113bdd9b

vp9/encoder/vp9_encoder.c
vp9/encoder/vp9_ratectrl.c

index 90ba344b3ad7185725dbc6e10e0e225487871dbb..8d570db89f61b86cac2a1328fd4b1976a3654a00 100644 (file)
@@ -3417,7 +3417,7 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
   // Note that at the moment multi_arf is only configured for 2 pass VBR and
   // will not work properly with svc.
   if ((oxcf->pass == 2) && !cpi->use_svc &&
-      (cpi->oxcf.enable_auto_arf > 1) && (cpi->oxcf.rc_mode == VPX_VBR))
+      (cpi->oxcf.enable_auto_arf > 1))
     cpi->multi_arf_allowed = 1;
   else
     cpi->multi_arf_allowed = 0;
index 65bca669a89d622bc387b62fdc1540bb59861b28..4d0d02d666c89f2d982bfee0fae0dc3958be29a3 100644 (file)
@@ -971,7 +971,13 @@ static int rc_pick_q_and_bounds_two_pass(const VP9_COMP *cpi,
       if (!cpi->refresh_alt_ref_frame) {
         active_best_quality = cq_level;
       } else {
-        active_best_quality = get_gf_active_quality(rc, q, cm->bit_depth);
+       const GF_GROUP *const gf_group = &cpi->twopass.gf_group;
+       active_best_quality = get_gf_active_quality(rc, 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)
+          active_best_quality = (active_best_quality + cq_level + 1) / 2;
       }
     } else {
       active_best_quality = get_gf_active_quality(rc, q, cm->bit_depth);