]> granicus.if.org Git - libvpx/commitdiff
vp9: Fix to use last_q for resize check
authorMarco Paniconi <marpan@google.com>
Mon, 6 Jul 2020 18:28:56 +0000 (11:28 -0700)
committerMarco Paniconi <marpan@google.com>
Mon, 6 Jul 2020 18:35:43 +0000 (11:35 -0700)
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

vp9/encoder/vp9_ratectrl.c

index 3beb9f41f9b1c50445bb471aa59f629c82021717..7301e80b846d0f4d171e9f5134fb61e05d1610e1 100644 (file)
@@ -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;