shithub: libvpx

Download patch

ref: 53747dfe65eaf670a7192f55117f3bf1e0280743
parent: 529c29bb0f6511a9b3e25177cece0d843827458b
author: Marco Paniconi <marpan@google.com>
date: Tue Aug 18 13:56:51 EDT 2020

vp9-svc: Fix to resetting RC for temporal layers

Fix to reset RC for temporal layers: the
first_spatial_layer_to_encode is usually/default 0,
so the logic to reset for temporal layers was not
being executed. Use VPXMAX(1, ) to make sure  all
temporal layers will be reset (when max-q is used
for overshoot).

Change-Id: Iec669870c865420d01d52eab9425cd6c7714eddc

--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -3262,7 +3262,7 @@
       int tl = 0;
       int sl = 0;
       SVC *svc = &cpi->svc;
-      for (sl = 0; sl < svc->first_spatial_layer_to_encode; ++sl) {
+      for (sl = 0; sl < VPXMAX(1, svc->first_spatial_layer_to_encode); ++sl) {
         for (tl = 0; tl < svc->number_temporal_layers; ++tl) {
           const int layer =
               LAYER_IDS_TO_IDX(sl, tl, svc->number_temporal_layers);