]> granicus.if.org Git - libvpx/commitdiff
vp9-svc: Fix to resetting RC for temporal layers
authorMarco Paniconi <marpan@google.com>
Wed, 19 Aug 2020 00:56:51 +0000 (17:56 -0700)
committerMarco Paniconi <marpan@google.com>
Wed, 19 Aug 2020 01:01:53 +0000 (18:01 -0700)
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

vp9/encoder/vp9_ratectrl.c

index 9bb8d45d2da2c7a85a47fdd84ca75712ac89557c..27a529914d6da5099a05a20238b7d72324284c56 100644 (file)
@@ -3262,7 +3262,7 @@ int vp9_encodedframe_overshoot(VP9_COMP *cpi, int frame_size, int *q) {
       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);