From: Marco Paniconi Date: Mon, 6 Jul 2020 18:28:56 +0000 (-0700) Subject: vp9: Fix to use last_q for resize check X-Git-Tag: v1.10.0-rc1~104 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9e15c3058543d71867af9e02e314a7303f6049b3;p=libvpx vp9: Fix to use last_q for resize check For temporal layers resize is only checked on the base/TL0 frames. So rc->last_q should be used, which because rc is in the layer context, rc->last_q will correspond to the qindex on last TL0 frame. In the previous code cm->base_qindex was used, which would correspond to qindex on last encoded frame, which is not TL0 when temporal_layers > 1. Change-Id: Iaf86f7156d2d48ae99a1b34ad576d453d490e746 --- diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index 3beb9f41f..7301e80b8 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -2716,7 +2716,7 @@ int vp9_resize_one_pass_cbr(VP9_COMP *cpi) { // Ignore samples close to key frame, since QP is usually high after key. if (!force_downsize_rate && cpi->rc.frames_since_key > cpi->framerate) { const int window = VPXMIN(30, (int)(2 * cpi->framerate)); - cpi->resize_avg_qp += cm->base_qindex; + cpi->resize_avg_qp += rc->last_q[INTER_FRAME]; if (cpi->rc.buffer_level < (int)(30 * rc->optimal_buffer_level / 100)) ++cpi->resize_buffer_underflow; ++cpi->resize_count;