From: Jingning Han Date: Mon, 5 Nov 2018 19:12:24 +0000 (-0800) Subject: Refactor find_arf_order() X-Git-Tag: v1.8.0~177^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6596fb201d23cb5633d267c9fdf1534ddc47917a;p=libvpx Refactor find_arf_order() Make the maximum layer depth allowed a control parameter in GF_GROUP. No coding stats would change. Change-Id: I9d17167da322831e7013d761980e1c16375a161b --- diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index 81fbf34b1..488dab2b4 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -2116,7 +2116,7 @@ static void find_arf_order(VP9_COMP *cpi, GF_GROUP *gf_group, // Process regular P frames if ((end - start < min_frame_interval) || - (depth > cpi->oxcf.enable_auto_arf)) { + (depth > gf_group->allowed_max_layer_depth)) { int idx; for (idx = start; idx < end; ++idx) { gf_group->update_type[*index_counter] = LF_UPDATE; @@ -2210,6 +2210,7 @@ static int define_gf_group_structure(VP9_COMP *cpi) { } if (rc->source_alt_ref_pending && cpi->multi_layer_arf) { + gf_group->allowed_max_layer_depth = cpi->oxcf.enable_auto_arf; find_arf_order(cpi, gf_group, &frame_index, 2, 1, rc->baseline_gf_interval); set_gf_overlay_frame_type(gf_group, frame_index, diff --git a/vp9/encoder/vp9_firstpass.h b/vp9/encoder/vp9_firstpass.h index 39715a9c0..0807097ac 100644 --- a/vp9/encoder/vp9_firstpass.h +++ b/vp9/encoder/vp9_firstpass.h @@ -140,6 +140,8 @@ typedef struct { int top_arf_idx; int stack_size; int gf_group_size; + int max_layer_depth; + int allowed_max_layer_depth; } GF_GROUP; typedef struct {