From 12e7bc396da993d99b003ad2a29bd7240d64902b Mon Sep 17 00:00:00 2001 From: Sebastian Jansson Date: Thu, 13 Sep 2018 16:30:46 +0200 Subject: [PATCH] Cleanup in rate controller. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL removes some indirection This is done to simplify understanding and debugging of the code. Bug: webrtc:9718 Change-Id: I48974d161213b9ef8fc5912bd3dc3f9d85ddfa66 Reviewed-on: https://webrtc-review.googlesource.com/100302 Reviewed-by: Björn Terelius Commit-Queue: Sebastian Jansson Cr-Commit-Position: refs/heads/master@{#24730} --- modules/remote_bitrate_estimator/aimd_rate_control.cc | 9 +++------ modules/remote_bitrate_estimator/aimd_rate_control.h | 1 - 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/modules/remote_bitrate_estimator/aimd_rate_control.cc b/modules/remote_bitrate_estimator/aimd_rate_control.cc index 8db2a6102a..a6e6436897 100644 --- a/modules/remote_bitrate_estimator/aimd_rate_control.cc +++ b/modules/remote_bitrate_estimator/aimd_rate_control.cc @@ -268,7 +268,8 @@ uint32_t AimdRateControl::ChangeBitrate(uint32_t new_bitrate_bps, if (avg_max_bitrate_kbps_ >= 0 && estimated_throughput_kbps > avg_max_bitrate_kbps_ + 3 * std_max_bit_rate) { - ChangeRegion(kRcMaxUnknown); + rate_control_region_ = kRcMaxUnknown; + avg_max_bitrate_kbps_ = -1.0; } if (rate_control_region_ == kRcNearMax) { @@ -297,7 +298,7 @@ uint32_t AimdRateControl::ChangeBitrate(uint32_t new_bitrate_bps, } new_bitrate_bps = std::min(new_bitrate_bps, current_bitrate_bps_); } - ChangeRegion(kRcNearMax); + rate_control_region_ = kRcNearMax; if (bitrate_is_initialized_ && estimated_throughput_bps < current_bitrate_bps_) { @@ -417,8 +418,4 @@ void AimdRateControl::ChangeState(const RateControlInput& input, } } -void AimdRateControl::ChangeRegion(RateControlRegion region) { - rate_control_region_ = region; -} - } // namespace webrtc diff --git a/modules/remote_bitrate_estimator/aimd_rate_control.h b/modules/remote_bitrate_estimator/aimd_rate_control.h index 47581a8531..2a3f71d98a 100644 --- a/modules/remote_bitrate_estimator/aimd_rate_control.h +++ b/modules/remote_bitrate_estimator/aimd_rate_control.h @@ -77,7 +77,6 @@ class AimdRateControl { void UpdateChangePeriod(int64_t now_ms); void UpdateMaxThroughputEstimate(float estimated_throughput_kbps); void ChangeState(const RateControlInput& input, int64_t now_ms); - void ChangeRegion(RateControlRegion region); uint32_t min_configured_bitrate_bps_; uint32_t max_configured_bitrate_bps_;