From d92681b06ff7b0a51c51cbc012781851afa0701e Mon Sep 17 00:00:00 2001 From: Wan-Teh Chang Date: Thu, 16 Mar 2023 18:36:13 -0700 Subject: Set oxcf->ts_rate_decimator[tl] only once The code that sets oxcf->ts_rate_decimator[tl] does not need to be inside a loop that iterates over sl. Move the code out of the sl loop so that oxcf->ts_rate_decimator[tl] is set only once. Change-Id: I22f6c117d200ec38a757b749a8700660d15436c1 --- vp9/ratectrl_rtc.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vp9/ratectrl_rtc.cc b/vp9/ratectrl_rtc.cc index 8592173fb..cc12ea336 100644 --- a/vp9/ratectrl_rtc.cc +++ b/vp9/ratectrl_rtc.cc @@ -136,6 +136,9 @@ void VP9RateControlRTC::UpdateRateControl( cpi_->svc.number_spatial_layers = rc_cfg.ss_number_layers; cpi_->svc.number_temporal_layers = rc_cfg.ts_number_layers; vp9_set_mb_mi(cm, cm->width, cm->height); + for (int tl = 0; tl < cpi_->svc.number_temporal_layers; ++tl) { + oxcf->ts_rate_decimator[tl] = rc_cfg.ts_rate_decimator[tl]; + } for (int sl = 0; sl < cpi_->svc.number_spatial_layers; ++sl) { for (int tl = 0; tl < cpi_->svc.number_temporal_layers; ++tl) { const int layer = @@ -149,7 +152,6 @@ void VP9RateControlRTC::UpdateRateControl( lrc->best_quality = vp9_quantizer_to_qindex(rc_cfg.min_quantizers[layer]); lc->scaling_factor_num = rc_cfg.scaling_factor_num[sl]; lc->scaling_factor_den = rc_cfg.scaling_factor_den[sl]; - oxcf->ts_rate_decimator[tl] = rc_cfg.ts_rate_decimator[tl]; } } vp9_set_rc_buffer_sizes(cpi_); -- cgit v1.2.3