Reduce number of DefaultNumberOfTemporalLayers() calls

Bug: none
Change-Id: Ie177734dd885d179ba9c9d44f63d106e8fcb8e29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/329980
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41334}
This commit is contained in:
Sergey Silkin 2023-12-05 09:18:15 +01:00 committed by WebRTC LUCI CQ
parent f8e67ba680
commit 8c30149f46

View File

@ -350,10 +350,9 @@ std::vector<webrtc::VideoStream> GetNormalSimulcastLayers(
bool base_heavy_tl3_rate_alloc, bool base_heavy_tl3_rate_alloc,
const webrtc::FieldTrialsView& trials) { const webrtc::FieldTrialsView& trials) {
std::vector<webrtc::VideoStream> layers(layer_count); std::vector<webrtc::VideoStream> layers(layer_count);
const bool enable_lowres_bitrate_interpolation = const bool enable_lowres_bitrate_interpolation =
EnableLowresBitrateInterpolation(trials); EnableLowresBitrateInterpolation(trials);
const int num_temporal_layers = DefaultNumberOfTemporalLayers(trials);
// Format width and height has to be divisible by |2 ^ num_simulcast_layers - // Format width and height has to be divisible by |2 ^ num_simulcast_layers -
// 1|. // 1|.
width = NormalizeSimulcastSize(width, layer_count); width = NormalizeSimulcastSize(width, layer_count);
@ -366,7 +365,7 @@ std::vector<webrtc::VideoStream> GetNormalSimulcastLayers(
// TODO(pbos): Fill actual temporal-layer bitrate thresholds. // TODO(pbos): Fill actual temporal-layer bitrate thresholds.
layers[s].max_qp = max_qp; layers[s].max_qp = max_qp;
layers[s].num_temporal_layers = layers[s].num_temporal_layers =
temporal_layers_supported ? DefaultNumberOfTemporalLayers(trials) : 1; temporal_layers_supported ? num_temporal_layers : 1;
layers[s].max_bitrate_bps = layers[s].max_bitrate_bps =
FindSimulcastMaxBitrate(width, height, FindSimulcastMaxBitrate(width, height,
enable_lowres_bitrate_interpolation) enable_lowres_bitrate_interpolation)
@ -375,7 +374,6 @@ std::vector<webrtc::VideoStream> GetNormalSimulcastLayers(
FindSimulcastTargetBitrate(width, height, FindSimulcastTargetBitrate(width, height,
enable_lowres_bitrate_interpolation) enable_lowres_bitrate_interpolation)
.bps(); .bps();
int num_temporal_layers = DefaultNumberOfTemporalLayers(trials);
if (s == 0) { if (s == 0) {
// If alternative temporal rate allocation is selected, adjust the // If alternative temporal rate allocation is selected, adjust the
// bitrate of the lowest simulcast stream so that absolute bitrate for // bitrate of the lowest simulcast stream so that absolute bitrate for