| Index: webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc
|
| diff --git a/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc b/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc
|
| index f83cddc617862b56ca50131895e97921084178b2..03f0cf9c814e712d8818fc364a10eae621574ec5 100644
|
| --- a/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc
|
| +++ b/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc
|
| @@ -22,9 +22,12 @@
|
|
|
| namespace webrtc {
|
|
|
| -static const int64_t kDefaultRttMs = 200;
|
| -static const double kWithinIncomingBitrateHysteresis = 1.05;
|
| -static const int64_t kMaxFeedbackIntervalMs = 1000;
|
| +namespace {
|
| +constexpr int64_t kDefaultRttMs = 200;
|
| +constexpr double kWithinIncomingBitrateHysteresis = 1.05;
|
| +constexpr int64_t kMaxFeedbackIntervalMs = 1000;
|
| +constexpr double kMinIncreaseBps = 250.0;
|
| +} // namespace
|
|
|
| AimdRateControl::AimdRateControl()
|
| : min_configured_bitrate_bps_(
|
| @@ -229,8 +232,8 @@ uint32_t AimdRateControl::MultiplicativeRateIncrease(
|
| 1000);
|
| alpha = pow(alpha, time_since_last_update_ms / 1000.0);
|
| }
|
| - uint32_t multiplicative_increase_bps = std::max(
|
| - current_bitrate_bps * (alpha - 1.0), 1000.0);
|
| + uint32_t multiplicative_increase_bps =
|
| + std::max(current_bitrate_bps * (alpha - 1.0), kMinIncreaseBps);
|
| return multiplicative_increase_bps;
|
| }
|
|
|
| @@ -247,8 +250,8 @@ uint32_t AimdRateControl::AdditiveRateIncrease(
|
| double bits_per_frame = static_cast<double>(current_bitrate_bps_) / 30.0;
|
| double packets_per_frame = std::ceil(bits_per_frame / (8.0 * 1200.0));
|
| double avg_packet_size_bits = bits_per_frame / packets_per_frame;
|
| - uint32_t additive_increase_bps = std::max(
|
| - 1000.0, beta * avg_packet_size_bits);
|
| + uint32_t additive_increase_bps =
|
| + std::max(kMinIncreaseBps, beta * avg_packet_size_bits);
|
| return additive_increase_bps;
|
| }
|
|
|
|
|