fix coding and documentary ambiguity in AimdRateControl::TimeToReduceFurther.

BUG=webrtc:6812

Review-Url: https://codereview.webrtc.org/2549453002
Cr-Commit-Position: refs/heads/master@{#15383}
This commit is contained in:
howtofly
2016-12-02 03:27:08 -08:00
committed by Commit bot
parent a28a1b9db6
commit df28e47a4b
2 changed files with 5 additions and 6 deletions

View File

@ -24,7 +24,6 @@
namespace webrtc { namespace webrtc {
static const int64_t kDefaultRttMs = 200; static const int64_t kDefaultRttMs = 200;
static const double kWithinIncomingBitrateHysteresis = 1.05;
static const int64_t kMaxFeedbackIntervalMs = 1000; static const int64_t kMaxFeedbackIntervalMs = 1000;
AimdRateControl::AimdRateControl() AimdRateControl::AimdRateControl()
@ -72,10 +71,10 @@ bool AimdRateControl::TimeToReduceFurther(int64_t time_now,
return true; return true;
} }
if (ValidEstimate()) { if (ValidEstimate()) {
const int threshold = static_cast<int>(kWithinIncomingBitrateHysteresis * // TODO(terelius/holmer): Investigate consequences of increasing
incoming_bitrate_bps); // the threshold to 0.95 * LatestEstimate().
const int bitrate_difference = LatestEstimate() - incoming_bitrate_bps; const uint32_t threshold = static_cast<uint32_t> (0.5 * LatestEstimate());
return bitrate_difference > threshold; return incoming_bitrate_bps < threshold;
} }
return false; return false;
} }

View File

@ -32,7 +32,7 @@ class AimdRateControl {
void SetMinBitrate(int min_bitrate_bps); void SetMinBitrate(int min_bitrate_bps);
int64_t GetFeedbackInterval() const; int64_t GetFeedbackInterval() const;
// Returns true if the bitrate estimate hasn't been changed for more than // 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 // estimate. Should be used to decide if we should reduce the rate further
// when over-using. // when over-using.
bool TimeToReduceFurther(int64_t time_now, bool TimeToReduceFurther(int64_t time_now,