Fix ubsan warnings in BWE tests.

BUG=webrtc:5490
R=pbos@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#11741}
This commit is contained in:
Stefan Holmer 2016-02-24 14:03:01 +01:00
parent f01633e667
commit 837b39e8f4
2 changed files with 10 additions and 8 deletions

View File

@ -446,13 +446,14 @@ void RemoteBitrateEstimatorTest::CapacityDropTestHelper(
if (i > 0) {
bitrate = (kStartBitrate * i + kBitrateDenom / 2) / kBitrateDenom;
}
stream_generator_->AddStream(new testing::RtpStream(
kFramerate, // Frames per second.
bitrate, // Bitrate.
kDefaultSsrc + i, // SSRC.
90000, // RTP frequency.
0xFFFFF000 ^ (~0 << (32 - i)), // Timestamp offset.
0)); // RTCP receive time.
uint32_t mask = ~0ull << (32 - i);
stream_generator_->AddStream(
new testing::RtpStream(kFramerate, // Frames per second.
bitrate, // Bitrate.
kDefaultSsrc + i, // SSRC.
90000, // RTP frequency.
0xFFFFF000u ^ mask, // Timestamp offset.
0)); // RTCP receive time.
bitrate_sum += bitrate;
}
ASSERT_EQ(bitrate_sum, kStartBitrate);

View File

@ -178,7 +178,8 @@ void NadaBweSender::GiveFeedback(const FeedbackPacket& feedback) {
// Following parameters might be optimized.
const int64_t kQueuingDelayUpperBoundMs = 10;
const float kDerivativeUpperBound = 10.0f / min_feedback_delay_ms_;
const float kDerivativeUpperBound =
10.0f / std::max<int64_t>(1, min_feedback_delay_ms_);
// In the modified version, a higher kMinUpperBound allows a higher d_hat
// upper bound for calling AcceleratedRampUp.
const float kProportionalityDelayBits = 20.0f;