shithub: libvpx

Download patch

ref: 54c0f0de444dae1f37a44acd81bb90a84b2c10cc
parent: c4305ba57d050dd5c7c229fa38bf2f9325a772d1
author: Paul Wilkins <paulwilkins@google.com>
date: Thu Jan 31 12:03:55 EST 2019

Change to direction of scan for GF only group boost.

When coding a GF only group it makes more sense to scan forward
from the GF to choose the boost level rather than backwards from
the end of the group towards the GF.

In practice we do not often code GF only groups in normal 2 pass
encodes and when we do the video is usually almost static which means
the direction does not matter much. However,  a forward scan makes
more sense and is how things used to work before we started using
arfs most of the time.

Change-Id: I64a5a731ff579c8af86d8a6718830d426b16a755

--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -2636,7 +2636,8 @@
     rc->gfu_boost = calc_arf_boost(cpi, forward_frames, (i - 1));
     rc->source_alt_ref_pending = 1;
   } else {
-    rc->gfu_boost = VPXMIN(MAX_GF_BOOST, calc_arf_boost(cpi, 0, (i - 1)));
+    reset_fpf_position(twopass, start_pos);
+    rc->gfu_boost = VPXMIN(MAX_GF_BOOST, calc_arf_boost(cpi, (i - 1), 0));
     rc->source_alt_ref_pending = 0;
   }