From 53747dfe65eaf670a7192f55117f3bf1e0280743 Mon Sep 17 00:00:00 2001 From: Marco Paniconi Date: Tue, 18 Aug 2020 17:56:51 -0700 Subject: [PATCH] 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 --- vp9/encoder/vp9_ratectrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index 9bb8d45..27a5299 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -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); -- 2.7.4