From 822c3739863d964a832b665fe2e0cdc0ebc08525 Mon Sep 17 00:00:00 2001 From: Sebastian Jansson Date: Thu, 5 Mar 2020 14:45:51 +0100 Subject: [PATCH] Always limit delay based bitrate by the acknowledged rate. This fixes an issue where the delay based target bitrate would increase unlimited when the WebRTC-DontIncreaseDelayBasedBweInAlr is set. Bug: webrtc:10542 Change-Id: I1aaf0835a91efc27e95198812b6833dbc24a1485 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/169843 Commit-Queue: Sebastian Jansson Commit-Queue: Per Kjellander Reviewed-by: Per Kjellander Cr-Commit-Position: refs/heads/master@{#30693} --- .../aimd_rate_control.cc | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/modules/remote_bitrate_estimator/aimd_rate_control.cc b/modules/remote_bitrate_estimator/aimd_rate_control.cc index da0acd1ee9..4d7c324127 100644 --- a/modules/remote_bitrate_estimator/aimd_rate_control.cc +++ b/modules/remote_bitrate_estimator/aimd_rate_control.cc @@ -371,19 +371,13 @@ DataRate AimdRateControl::ChangeBitrate(DataRate new_bitrate, DataRate AimdRateControl::ClampBitrate(DataRate new_bitrate, DataRate estimated_throughput) const { - // Allow the estimate to increase as long as alr is not detected to ensure - // that there is no BWE values that can make the estimate stuck at a too - // low bitrate. If an encoder can not produce the bitrate necessary to - // fully use the capacity, alr will sooner or later trigger. - if (!(send_side_ && no_bitrate_increase_in_alr_)) { - // Don't change the bit rate if the send side is too far off. - // We allow a bit more lag at very low rates to not too easily get stuck if - // the encoder produces uneven outputs. - const DataRate max_bitrate = - 1.5 * estimated_throughput + DataRate::KilobitsPerSec(10); - if (new_bitrate > current_bitrate_ && new_bitrate > max_bitrate) { - new_bitrate = std::max(current_bitrate_, max_bitrate); - } + // Don't change the bit rate if the send side is too far off. + // We allow a bit more lag at very low rates to not too easily get stuck if + // the encoder produces uneven outputs. + const DataRate max_bitrate = + 1.5 * estimated_throughput + DataRate::KilobitsPerSec(10); + if (new_bitrate > current_bitrate_ && new_bitrate > max_bitrate) { + new_bitrate = std::max(current_bitrate_, max_bitrate); } if (estimate_bounded_increase_ && network_estimate_) {