shithub: libvpx

Download patch

ref: 60d192db04b23b386fe30059b807101867725896
parent: 3758650c98f75a0b719d79fb97b80262732fb1c3
parent: 8fc3ab774f120eeabd6c77ab7a980a0e81e22517
author: Paul Wilkins <paulwilkins@google.com>
date: Fri Oct 24 01:51:25 EDT 2014

Merge "Enable dual arf with constant q."

--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -3505,7 +3505,7 @@
   // 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;
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -971,7 +971,13 @@
       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);