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

Unified Diff: webrtc/modules/remote_bitrate_estimator/aimd_rate_control_unittest.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 | « webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc ('k') | no next file » | 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_unittest.cc
diff --git a/webrtc/modules/remote_bitrate_estimator/aimd_rate_control_unittest.cc b/webrtc/modules/remote_bitrate_estimator/aimd_rate_control_unittest.cc
index b36b16ddbf1d137d025e2a8a1886a950399ef753..878a03c4f56cf3eb6495620bd63a278eb7dd621f 100644
--- a/webrtc/modules/remote_bitrate_estimator/aimd_rate_control_unittest.cc
+++ b/webrtc/modules/remote_bitrate_estimator/aimd_rate_control_unittest.cc
@@ -89,4 +89,42 @@ TEST(AimdRateControlTest, GetLastBitrateDecrease) {
states.aimd_rate_control->GetLastBitrateDecreaseBps());
}
+TEST(AimdRateControlTest, BweLimitedByAckedBitrate) {
+ auto states = CreateAimdRateControlStates();
+ constexpr int kAckedBitrate = 10000;
+ InitBitrate(states, kAckedBitrate,
+ states.simulated_clock->TimeInMilliseconds());
+ while (states.simulated_clock->TimeInMilliseconds() - kClockInitialTime <
+ 20000) {
+ UpdateRateControl(states, kBwNormal, kAckedBitrate,
+ states.simulated_clock->TimeInMilliseconds());
+ states.simulated_clock->AdvanceTimeMilliseconds(100);
+ }
+ ASSERT_TRUE(states.aimd_rate_control->ValidEstimate());
+ EXPECT_EQ(static_cast<uint32_t>(1.5 * kAckedBitrate + 10000),
+ states.aimd_rate_control->LatestEstimate());
+}
+
+TEST(AimdRateControlTest, BweNotLimitedByDecreasingAckedBitrate) {
+ auto states = CreateAimdRateControlStates();
+ constexpr int kAckedBitrate = 100000;
+ InitBitrate(states, kAckedBitrate,
+ states.simulated_clock->TimeInMilliseconds());
+ while (states.simulated_clock->TimeInMilliseconds() - kClockInitialTime <
+ 20000) {
+ UpdateRateControl(states, kBwNormal, kAckedBitrate,
+ states.simulated_clock->TimeInMilliseconds());
+ states.simulated_clock->AdvanceTimeMilliseconds(100);
+ }
+ ASSERT_TRUE(states.aimd_rate_control->ValidEstimate());
+ // If the acked bitrate decreases the BWE shouldn't be reduced to 1.5x
+ // what's being acked, but also shouldn't get to increase more.
+ uint32_t prev_estimate = states.aimd_rate_control->LatestEstimate();
+ UpdateRateControl(states, kBwNormal, kAckedBitrate / 2,
+ states.simulated_clock->TimeInMilliseconds());
+ uint32_t new_estimate = states.aimd_rate_control->LatestEstimate();
+ EXPECT_NEAR(new_estimate, static_cast<uint32_t>(1.5 * kAckedBitrate + 10000),
+ 2000);
+ EXPECT_EQ(new_estimate, prev_estimate);
+}
} // namespace webrtc
« no previous file with comments | « webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698