]> granicus.if.org Git - libvpx/commitdiff
Change to direction of scan for GF only group boost.
authorPaul Wilkins <paulwilkins@google.com>
Thu, 31 Jan 2019 17:03:55 +0000 (17:03 +0000)
committerPaul Wilkins <paulwilkins@google.com>
Thu, 31 Jan 2019 17:03:55 +0000 (17:03 +0000)
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

vp9/encoder/vp9_firstpass.c

index 5cfffe6b5eafcf71eb58801108b3418bf158a176..e671b84e99a171bb0271d2e794fa0c8830d94ef6 100644 (file)
@@ -2636,7 +2636,8 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
     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;
   }