Cleanup in rate controller.
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 <terelius@webrtc.org> Commit-Queue: Sebastian Jansson <srte@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24730}
This commit is contained in:

committed by
Commit Bot

parent
271812a893
commit
12e7bc396d
@ -268,7 +268,8 @@ uint32_t AimdRateControl::ChangeBitrate(uint32_t new_bitrate_bps,
|
|||||||
if (avg_max_bitrate_kbps_ >= 0 &&
|
if (avg_max_bitrate_kbps_ >= 0 &&
|
||||||
estimated_throughput_kbps >
|
estimated_throughput_kbps >
|
||||||
avg_max_bitrate_kbps_ + 3 * std_max_bit_rate) {
|
avg_max_bitrate_kbps_ + 3 * std_max_bit_rate) {
|
||||||
ChangeRegion(kRcMaxUnknown);
|
rate_control_region_ = kRcMaxUnknown;
|
||||||
|
|
||||||
avg_max_bitrate_kbps_ = -1.0;
|
avg_max_bitrate_kbps_ = -1.0;
|
||||||
}
|
}
|
||||||
if (rate_control_region_ == kRcNearMax) {
|
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_);
|
new_bitrate_bps = std::min(new_bitrate_bps, current_bitrate_bps_);
|
||||||
}
|
}
|
||||||
ChangeRegion(kRcNearMax);
|
rate_control_region_ = kRcNearMax;
|
||||||
|
|
||||||
if (bitrate_is_initialized_ &&
|
if (bitrate_is_initialized_ &&
|
||||||
estimated_throughput_bps < current_bitrate_bps_) {
|
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
|
} // namespace webrtc
|
||||||
|
@ -77,7 +77,6 @@ class AimdRateControl {
|
|||||||
void UpdateChangePeriod(int64_t now_ms);
|
void UpdateChangePeriod(int64_t now_ms);
|
||||||
void UpdateMaxThroughputEstimate(float estimated_throughput_kbps);
|
void UpdateMaxThroughputEstimate(float estimated_throughput_kbps);
|
||||||
void ChangeState(const RateControlInput& input, int64_t now_ms);
|
void ChangeState(const RateControlInput& input, int64_t now_ms);
|
||||||
void ChangeRegion(RateControlRegion region);
|
|
||||||
|
|
||||||
uint32_t min_configured_bitrate_bps_;
|
uint32_t min_configured_bitrate_bps_;
|
||||||
uint32_t max_configured_bitrate_bps_;
|
uint32_t max_configured_bitrate_bps_;
|
||||||
|
Reference in New Issue
Block a user