From 5b6203aa59d3aaf2c219dcf95f4412ea258e3f74 Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Mon, 16 Jul 2018 14:31:51 -0700 Subject: [PATCH] Assign estimate qp for overlay frame Assign the estimated qp for the overlay frame too. Cap the minimum quantization parameter to be 1 to avoid lossless coding in the temporal dependency model setup. Change-Id: I8acbc7182045dbf3017b6712a119b18407b76ab0 --- vp9/encoder/vp9_ratectrl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index a66dae5d0..f0dc7630d 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -1443,7 +1443,7 @@ void vp9_estimate_qp_gop(VP9_COMP *cpi) { int idx; const int gf_index = cpi->twopass.gf_group.index; - for (idx = 1; idx <= gop_length; ++idx) { + for (idx = 1; idx <= gop_length + 1 && idx < MAX_LAG_BUFFERS; ++idx) { TplDepFrame *tpl_frame = &cpi->tpl_stats[idx]; int target_rate = cpi->twopass.gf_group.bit_allocation[idx]; cpi->twopass.gf_group.index = idx; @@ -1451,6 +1451,7 @@ void vp9_estimate_qp_gop(VP9_COMP *cpi) { vp9_configure_buffer_updates(cpi, idx); tpl_frame->base_qindex = rc_pick_q_and_bounds_two_pass(cpi, &bottom_index, &top_index, idx); + tpl_frame->base_qindex = VPXMAX(tpl_frame->base_qindex, 1); } // Reset the actual index and frame update cpi->twopass.gf_group.index = gf_index; -- 2.40.0