diff --git a/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc b/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc index 530453d74c..685be422bf 100644 --- a/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc +++ b/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc @@ -24,7 +24,6 @@ namespace webrtc { static const int64_t kDefaultRttMs = 200; -static const double kWithinIncomingBitrateHysteresis = 1.05; static const int64_t kMaxFeedbackIntervalMs = 1000; AimdRateControl::AimdRateControl() @@ -72,10 +71,10 @@ bool AimdRateControl::TimeToReduceFurther(int64_t time_now, return true; } if (ValidEstimate()) { - const int threshold = static_cast(kWithinIncomingBitrateHysteresis * - incoming_bitrate_bps); - const int bitrate_difference = LatestEstimate() - incoming_bitrate_bps; - return bitrate_difference > threshold; + // TODO(terelius/holmer): Investigate consequences of increasing + // the threshold to 0.95 * LatestEstimate(). + const uint32_t threshold = static_cast (0.5 * LatestEstimate()); + return incoming_bitrate_bps < threshold; } return false; } diff --git a/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.h b/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.h index 6e5410dd00..ddfa667a87 100644 --- a/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.h +++ b/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.h @@ -32,7 +32,7 @@ class AimdRateControl { void SetMinBitrate(int min_bitrate_bps); int64_t GetFeedbackInterval() const; // Returns true if the bitrate estimate hasn't been changed for more than - // an RTT, or if the incoming_bitrate is more than 5% above the current + // an RTT, or if the incoming_bitrate is less than half of the current // estimate. Should be used to decide if we should reduce the rate further // when over-using. bool TimeToReduceFurther(int64_t time_now,