Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(513)

Unified Diff: webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc

Issue 1219303002: Fix issue where the first audio packets significantly impacts initial BWE negatively. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix test. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 bcb71d6db891db222bdfbee7e43fef629598ff85..c1d59811cb09818ae324ae845efde2c289a075b4 100644
--- a/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc
+++ b/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc
@@ -102,11 +102,13 @@ void AimdRateControl::Update(const RateControlInput* input, int64_t now_ms) {
// Set the initial bit rate value to what we're receiving the first half
// second.
if (!bitrate_is_initialized_) {
+ const int64_t kInitializationTimeMs =
+ std::max<int64_t>(kBitrateWindowMs, 5000);
pbos-webrtc 2015/07/09 15:14:55 Just compile assert that kBitrateWindowMs < kIniti
stefan-webrtc 2015/07/09 15:24:27 Done.
if (time_first_incoming_estimate_ < 0) {
if (input->_incomingBitRate > 0) {
time_first_incoming_estimate_ = now_ms;
}
- } else if (now_ms - time_first_incoming_estimate_ > 500 &&
+ } else if (now_ms - time_first_incoming_estimate_ > kInitializationTimeMs &&
input->_incomingBitRate > 0) {
current_bitrate_bps_ = input->_incomingBitRate;
bitrate_is_initialized_ = true;
@@ -136,6 +138,9 @@ uint32_t AimdRateControl::ChangeBitrate(uint32_t current_bitrate_bps,
if (!updated_) {
return current_bitrate_bps_;
}
+ if (!bitrate_is_initialized_ && current_input_._bwState != kBwOverusing) {
pbos-webrtc 2015/07/09 15:14:55 remove {}s comment that we pass this if we're ove
+ return current_bitrate_bps_;
+ }
updated_ = false;
ChangeState(current_input_, now_ms);
// Calculated here because it's used in multiple places.
@@ -172,6 +177,7 @@ uint32_t AimdRateControl::ChangeBitrate(uint32_t current_bitrate_bps,
break;
case kRcDecrease:
+ bitrate_is_initialized_ = true;
if (incoming_bitrate_bps < min_configured_bitrate_bps_) {
current_bitrate_bps = min_configured_bitrate_bps_;
} else {

Powered by Google App Engine
This is Rietveld 408576698