From 4dae31877dd3cceb5a129cb9b42f61d58665ddf3 Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Mon, 15 Oct 2018 15:27:02 -0700 Subject: [PATCH] Refactor GOP reference frame ordering for tpl model Process the frames in the order of GOP structure definition. Decouple the dependency on rc->baseline_gf_interval. Change-Id: I0d42c542aca552975cc8f08b0eb8b22ccf6a9537 --- vp9/encoder/vp9_encoder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index a2550d1d1..dfc92e8e8 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -5415,7 +5415,7 @@ void init_gop_frames(VP9_COMP *cpi, GF_PICTURE *gf_picture, ++*tpl_group_frames; // Initialize P frames - for (frame_idx = 2; frame_idx < MAX_LAG_BUFFERS; ++frame_idx) { + for (frame_idx = 2; frame_idx < MAX_ARF_GOP_SIZE; ++frame_idx) { const int frame_gop_offset = gf_group->frame_gop_index[frame_idx]; struct lookahead_entry *buf = vp9_lookahead_peek(cpi->lookahead, frame_gop_offset - 1); @@ -5433,7 +5433,7 @@ void init_gop_frames(VP9_COMP *cpi, GF_PICTURE *gf_picture, // The length of group of pictures is baseline_gf_interval, plus the // beginning golden frame from last GOP, plus the last overlay frame in // the same GOP. - if (frame_idx == cpi->rc.baseline_gf_interval + 1) break; + if (frame_idx == gf_group->gf_group_size) break; } gld_index = frame_idx; -- 2.40.0