Improve the behavior when the BWE times out and when we have too little data to determine the incoming bitrate.

This is done by changing the RateStatistics so that it resets its window when the accumulator is empty. It also keeps a dynamic window, so that the rates computed before a full window worth of data has been received will be computed over a smaller window. This means that the rate will be closer to the true rate, but with a higher variance.

BUG=webrtc:5773
R=perkj@webrtc.org, sprang@webrtc.org

Review URL: https://codereview.webrtc.org/1908893003 .

Cr-Commit-Position: refs/heads/master@{#12470}
This commit is contained in:
Stefan Holmer
2016-04-22 15:48:23 +02:00
parent 4fb3d2bcca
commit fb8fc5391e
7 changed files with 71 additions and 30 deletions

View File

@ -86,7 +86,7 @@ TEST_F(BitrateAdjusterTest, VaryingBitrates) {
SimulateBitrateBps(actual_bitrate_bps);
VerifyAdjustment();
adjusted_bitrate_bps = adjuster_.GetAdjustedBitrateBps();
EXPECT_LT(adjusted_bitrate_bps, last_adjusted_bitrate_bps);
EXPECT_LE(adjusted_bitrate_bps, last_adjusted_bitrate_bps);
last_adjusted_bitrate_bps = adjusted_bitrate_bps;
// After two cycles we should've stabilized and hit the lower bound.
EXPECT_EQ(GetTargetBitrateBpsPct(kMinAdjustedBitratePct),