From dcc7c5aeb1c1c07bad79188e2d7858955246a318 Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Wed, 14 Nov 2018 21:02:03 -0800 Subject: [PATCH] Fix arf boost factor calculation for intermediate ARFs 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index c755d5dfc..e29e86576 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -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); -- 2.40.0