aboutsummaryrefslogtreecommitdiff
path: root/media
diff options
context:
space:
mode:
authorErik Språng <sprang@webrtc.org>2018-07-06 17:17:10 +0200
committerCommit Bot <commit-bot@chromium.org>2018-07-08 12:17:58 +0000
commitd497e6bd6b6520d08ff5e2df3a50a46d8c9f9b6e (patch)
tree8ecc7519e454cf8201f103ef0a836498b21669ff /media
parent0d405d41bdba864f92d6ce10e80fbf1bc2b9fe89 (diff)
downloadwebrtc-d497e6bd6b6520d08ff5e2df3a50a46d8c9f9b6e.tar.gz
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}
Diffstat (limited to 'media')
-rw-r--r--media/engine/simulcast.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/media/engine/simulcast.cc b/media/engine/simulcast.cc
index 722890c6dd..b2bc6e6d75 100644
--- a/media/engine/simulcast.cc
+++ b/media/engine/simulcast.cc
@@ -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 =