Lower TL0 bitrate to 40% for lowest stream when using short 3tl

Bug: webrtc:9477
Change-Id: Ie19c0cbfba80cb8043c37b04038cd10cbc90f169
Reviewed-on: https://webrtc-review.googlesource.com/87425
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23880}
This commit is contained in:
Erik Språng 2018-07-06 17:17:10 +02:00 committed by Commit Bot
parent 0d405d41bd
commit d497e6bd6b

View File

@ -243,16 +243,25 @@ std::vector<webrtc::VideoStream> GetNormalSimulcastLayers(
layers[s].max_bitrate_bps = FindSimulcastMaxBitrateBps(width, height);
layers[s].target_bitrate_bps = FindSimulcastTargetBitrateBps(width, height);
int num_temporal_layers = DefaultNumberOfTemporalLayers(s);
if (s == 0 && num_temporal_layers != 3) {
if (s == 0) {
// If alternative number temporal layers is selected, adjust the
// bitrate of the lowest simulcast stream so that absolute bitrate for
// the base temporal layer matches the bitrate for the base temporal
// layer with the default 3 simulcast streams. Otherwise we risk a
// higher threshold for receiving a feed at all.
const float rate_factor =
webrtc::SimulcastRateAllocator::GetTemporalRateAllocation(3, 0) /
webrtc::SimulcastRateAllocator::GetTemporalRateAllocation(
num_temporal_layers, 0);
float rate_factor = 1.0;
if (num_temporal_layers == 3) {
if (webrtc::field_trial::IsEnabled("WebRTC-UseShortVP8TL3Pattern")) {
// Shortened pattern increases TL0 bitrate from 40% to 60%.
rate_factor = 0.4 / 0.6;
}
} else {
rate_factor =
webrtc::SimulcastRateAllocator::GetTemporalRateAllocation(3, 0) /
webrtc::SimulcastRateAllocator::GetTemporalRateAllocation(
num_temporal_layers, 0);
}
layers[s].max_bitrate_bps =
static_cast<int>(layers[s].max_bitrate_bps * rate_factor);
layers[s].target_bitrate_bps =