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

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

Issue 1151603008: Make the BWE threshold adaptive. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Improve self-fairness. Created 5 years, 6 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 a1a9baf352038d29de47caba122cc98c2d73935f..a8805bde4db26f922744f08e5206ab91e02dbffd 100644
--- a/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc
+++ b/webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc
@@ -37,9 +37,10 @@ AimdRateControl::AimdRateControl(uint32_t min_bitrate_bps)
updated_(false),
time_first_incoming_estimate_(-1),
bitrate_is_initialized_(false),
- beta_(0.9f),
+ beta_(0.85f),
rtt_(kDefaultRttMs),
- time_of_last_log_(-1) {}
+ time_of_last_log_(-1) {
+}
RateControlType AimdRateControl::GetControlType() const {
return kAimdControl;
@@ -98,8 +99,7 @@ void AimdRateControl::SetRtt(int64_t rtt) {
rtt_ = rtt;
}
-RateControlRegion AimdRateControl::Update(const RateControlInput* input,
- int64_t now_ms) {
+void AimdRateControl::Update(const RateControlInput* input, int64_t now_ms) {
assert(input);
// Set the initial bit rate value to what we're receiving the first half
@@ -125,7 +125,6 @@ RateControlRegion AimdRateControl::Update(const RateControlInput* input,
updated_ = true;
current_input_ = *input;
}
- return rate_control_region_;
}
void AimdRateControl::SetEstimate(int bitrate_bps, int64_t now_ms) {
@@ -178,14 +177,6 @@ uint32_t AimdRateControl::ChangeBitrate(uint32_t current_bitrate_bps,
current_bitrate_bps += multiplicative_increase_bps;
}
- if (max_hold_rate_bps_ > 0 &&
- beta_ * max_hold_rate_bps_ > current_bitrate_bps) {
- current_bitrate_bps = static_cast<uint32_t>(beta_ * max_hold_rate_bps_);
- avg_max_bitrate_kbps_ = beta_ * max_hold_rate_bps_ / 1000.0f;
- ChangeRegion(kRcNearMax);
- fast_recovery_after_hold = true;
- }
- max_hold_rate_bps_ = 0;
time_last_bitrate_change_ = now_ms;
break;
}
@@ -252,8 +243,9 @@ uint32_t AimdRateControl::AdditiveRateIncrease(
assert(response_time_ms > 0);
double beta = 0.0;
if (last_ms > 0) {
- beta = std::min((now_ms - last_ms) /
- static_cast<double>(response_time_ms), 1.0);
+ beta = 0.5 *
+ std::min((now_ms - last_ms) / static_cast<double>(response_time_ms),
+ 1.0);
}
double bits_per_frame = static_cast<double>(current_bitrate_bps_) / 30.0;
double packets_per_frame = std::ceil(bits_per_frame / (8.0 * 1200.0));
@@ -311,17 +303,6 @@ void AimdRateControl::ChangeState(const RateControlInput& input,
void AimdRateControl::ChangeRegion(RateControlRegion region) {
rate_control_region_ = region;
- switch (rate_control_region_) {
- case kRcAboveMax:
- case kRcMaxUnknown:
- beta_ = 0.9f;
- break;
- case kRcNearMax:
- beta_ = 0.95f;
- break;
- default:
- assert(false);
- }
}
void AimdRateControl::ChangeState(RateControlState new_state) {

Powered by Google App Engine
This is Rietveld 408576698