]> granicus.if.org Git - libvpx/commitdiff
Fix arf boost factor calculation for intermediate ARFs
authorJingning Han <jingning@google.com>
Thu, 15 Nov 2018 05:02:03 +0000 (21:02 -0800)
committerJingning Han <jingning@google.com>
Thu, 15 Nov 2018 05:03:29 +0000 (21:03 -0800)
Need to offset the forward range by 1 to include the stats for
the current frame itself.

Change-Id: I3b5171b7edef51ec4e97e4e0542ca58af5ce1416

vp9/encoder/vp9_firstpass.c

index c755d5dfcac5832136278cfa20962ac6d8f2cdca..e29e86576d21526cba478f0931278c7f24b0a3c9 100644 (file)
@@ -2144,8 +2144,9 @@ static void find_arf_order(VP9_COMP *cpi, GF_GROUP *gf_group,
   for (idx = 0; idx <= mid; ++idx)
     if (EOF == input_stats(twopass, &fpf_frame)) break;
 
-  gf_group->gfu_boost[*index_counter] = VPXMAX(
-      MIN_ARF_GF_BOOST, calc_arf_boost(cpi, end - mid, mid - start) >> depth);
+  gf_group->gfu_boost[*index_counter] =
+      VPXMAX(MIN_ARF_GF_BOOST,
+             calc_arf_boost(cpi, end - mid + 1, mid - start) >> depth);
 
   reset_fpf_position(twopass, start_pos);