rtc-svc: Fix to max-q on scene change for svc
Reset only up to current temporal layer, because of the
hierarchical prediction structure only the lower temporal
layers need the RC to be reset.
Reset for spatial layers will be considered in another CL.
This improves quality on content with scene cuts/changes.
Change-Id: Ibf65f59e9cd51be1985182dd933c60d6c9c121d4
diff --git a/av1/encoder/ratectrl.c b/av1/encoder/ratectrl.c
index df86380..ae2f36d 100644
--- a/av1/encoder/ratectrl.c
+++ b/av1/encoder/ratectrl.c
@@ -3565,11 +3565,13 @@
cpi->ppi->p_rc.rate_correction_factors[INTER_NORMAL] =
rate_correction_factor;
}
- // For temporal layers: reset the rate control parameters across all
- // temporal layers.
+ // For temporal layers: reset the rate control parameters across
+ // lower temporal layers.
+ // TODO(marpan): Look into whether we should reset for all spatial
+ // layers if no inter-layer prediction is used.
if (cpi->svc.number_temporal_layers > 1) {
SVC *svc = &cpi->svc;
- for (int tl = 0; tl < svc->number_temporal_layers; ++tl) {
+ for (int tl = 0; tl < svc->temporal_layer_id; ++tl) {
int sl = svc->spatial_layer_id;
const int layer = LAYER_IDS_TO_IDX(sl, tl, svc->number_temporal_layers);
LAYER_CONTEXT *lc = &svc->layer_context[layer];