From: Jingning Han Date: Tue, 28 Aug 2018 17:52:32 +0000 (-0700) Subject: Structure the multi-layer ARF locations X-Git-Tag: v1.8.0~363^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=30c22d842cffc737de00388af972110b89b1547c;p=libvpx Structure the multi-layer ARF locations Fine tune the multi-layer ARF location decisions. Support deeper layer structure. Change-Id: I3e44cf52b6813f6267bcd7266f9aa1b7ded57f8e --- diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index 2c36e06ee..c4bb2ef02 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -2335,11 +2335,11 @@ static void define_gf_multi_arf_structure(VP9_COMP *cpi) { static void find_arf_order(GF_GROUP *gf_group, int *layer_depth, int *index_counter, int depth, int start, int end) { - const int mid = (start + end + 1) >> 1; + const int mid = (start + end) >> 1; const int min_frame_interval = 3; // Process regular P frames - if (end - start <= min_frame_interval) { + if (end - start < min_frame_interval) { int idx; for (idx = start; idx < end; ++idx) { gf_group->update_type[*index_counter] = LF_UPDATE; @@ -2350,7 +2350,7 @@ static void find_arf_order(GF_GROUP *gf_group, int *layer_depth, return; } - assert(abs(mid - start) > 1 && abs(mid - end) > 1); + assert(abs(mid - start) >= 1 && abs(mid - end) >= 1); // Process ARF frame layer_depth[*index_counter] = depth;