shithub: libvpx

Download patch

ref: 2eddfb46a999badf6fa9561606f62b73bf4eccb3
parent: f5817fa612d39b3b46b3164c17ab9d5f3d7bc8c8
parent: d6e29868ac4fc58eadc3c30f4baf45fea0b67f6c
author: Paul Wilkins <paulwilkins@google.com>
date: Mon Nov 13 11:36:43 EST 2017

Merge "Fix to frames considered in arf boost calculation."

--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -2601,9 +2601,13 @@
   // Should we use the alternate reference frame.
   if (allow_alt_ref && (i < cpi->oxcf.lag_in_frames) &&
       (i >= rc->min_gf_interval)) {
+    const int forward_frames = (rc->frames_to_key - i >= i - 1)
+                                   ? i - 1
+                                   : VPXMAX(0, rc->frames_to_key - i);
+
     // Calculate the boost for alt ref.
     rc->gfu_boost =
-        calc_arf_boost(cpi, 0, (i - 1), (i - 1), &f_boost, &b_boost);
+        calc_arf_boost(cpi, 0, forward_frames, i - 1, &f_boost, &b_boost);
     rc->source_alt_ref_pending = 1;
 
     // Test to see if multi arf is appropriate.