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 <srte@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30693}
This commit is contained in:
Sebastian Jansson 2020-03-05 14:45:51 +01:00 committed by Commit Bot
parent bb701b7b46
commit 822c373986

View File

@ -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_) {