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

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

Issue 2542083003: Use different restrictions of acked bitrate lag depending on operating point. (Closed)
Patch Set: Comments addressed. 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 | « no previous file | 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 530453d74cc1612c105de25bb7cc0280d261c53a..8a6eb06f2df18080ea53772faaad34d4fec70220 100644
--- a/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc
+++ b/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc
@@ -229,11 +229,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 | « no previous file | 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