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

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

Issue 2553613002: Revert "Revert of Use different restrictions of acked bitrate lag depending on operating point. (pa… (Closed)
Patch Set: Fix flaky tests. Created 4 years 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
« no previous file with comments | « webrtc/call/rampup_tests.cc ('k') | webrtc/modules/remote_bitrate_estimator/aimd_rate_control_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 685be422bfc768896754fbb248bd6f2b59fc0dbc..e0c9ccd3ba4ac1f44d77c4b5d01b363e7bac05fe 100644
--- a/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc
+++ b/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc
@@ -228,11 +228,14 @@ uint32_t AimdRateControl::ChangeBitrate(uint32_t current_bitrate_bps,
default:
assert(false);
}
- if ((incoming_bitrate_bps > 100000 || current_bitrate_bps > 150000) &&
- current_bitrate_bps > 1.5 * incoming_bitrate_bps) {
- // Allow changing the bit rate if we are operating at very low rates
- // Don't change the bit rate if the send side is too far off
- current_bitrate_bps = current_bitrate_bps_;
+ // 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 uint32_t max_bitrate_bps =
+ static_cast<uint32_t>(1.5f * incoming_bitrate_bps) + 10000;
+ if (current_bitrate_bps > current_bitrate_bps_ &&
+ current_bitrate_bps > max_bitrate_bps) {
+ current_bitrate_bps = std::max(current_bitrate_bps_, max_bitrate_bps);
time_last_bitrate_change_ = now_ms;
}
return current_bitrate_bps;
« no previous file with comments | « webrtc/call/rampup_tests.cc ('k') | webrtc/modules/remote_bitrate_estimator/aimd_rate_control_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698