From b77291abc9dc2884103c1846f3fc1a0395dd9e67 Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Mon, 22 Oct 2018 10:37:09 -0700 Subject: [PATCH] Refactor gop_length use case in tpl model Make it support both single- and multi-layer ARF GOP structure. Change-Id: I760a95804d1b583b057120f6d6be65195a0e6c19 --- vp9/encoder/vp9_ratectrl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index 8d1d265f6..81cf8858a 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -1481,12 +1481,12 @@ void vp9_configure_buffer_updates(VP9_COMP *cpi, int gf_group_index) { } void vp9_estimate_qp_gop(VP9_COMP *cpi) { - int gop_length = cpi->rc.baseline_gf_interval; + int gop_length = cpi->twopass.gf_group.gf_group_size; int bottom_index, top_index; int idx; const int gf_index = cpi->twopass.gf_group.index; - for (idx = 1; idx <= gop_length + 1 && idx < MAX_LAG_BUFFERS; ++idx) { + for (idx = 1; idx < gop_length; ++idx) { TplDepFrame *tpl_frame = &cpi->tpl_stats[idx]; int target_rate = cpi->twopass.gf_group.bit_allocation[idx]; cpi->twopass.gf_group.index = idx; -- 2.40.0