RtpFrameReferenceFinder VP8 reference calculation fix.

BUG=webrtc:7768

Review-Url: https://codereview.webrtc.org/2980943003
Cr-Commit-Position: refs/heads/master@{#19018}
This commit is contained in:
philipel
2017-07-14 04:52:01 -07:00
committed by Commit Bot
parent ae7232588d
commit 9bd1d66995
2 changed files with 28 additions and 4 deletions

View File

@ -264,11 +264,10 @@ RtpFrameReferenceFinder::FrameDecision RtpFrameReferenceFinder::ManageFrameVp8(
// Find if there has been a gap in fully received frames and save the picture
// id of those frames in |not_yet_received_frames_|.
if (AheadOf<uint16_t, kPicIdLength>(frame->picture_id, last_picture_id_)) {
do {
last_picture_id_ = Add<kPicIdLength>(last_picture_id_, 1);
while (last_picture_id_ != frame->picture_id) {
not_yet_received_frames_.insert(last_picture_id_);
last_picture_id_ = Add<kPicIdLength>(last_picture_id_, 1);
}
} while (last_picture_id_ != frame->picture_id);
}
// Clean up info for base layers that are too old.

View File

@ -671,6 +671,31 @@ TEST_F(TestRtpFrameReferenceFinder, Vp8Tl1SyncFrameAfterTl1Frame) {
CheckReferencesVp8(5, 3);
}
TEST_F(TestRtpFrameReferenceFinder, Vp8DetectMissingFrame_0212) {
InsertVp8(1, 1, true, 1, 0, 1, false);
InsertVp8(2, 2, false, 2, 2, 1, true);
InsertVp8(3, 3, false, 3, 1, 1, true);
InsertVp8(4, 4, false, 4, 2, 1, false);
InsertVp8(6, 6, false, 6, 2, 2, false);
InsertVp8(7, 7, false, 7, 1, 2, false);
InsertVp8(8, 8, false, 8, 2, 2, false);
ASSERT_EQ(4UL, frames_from_callback_.size());
InsertVp8(5, 5, false, 5, 0, 2, false);
ASSERT_EQ(8UL, frames_from_callback_.size());
CheckReferencesVp8(1);
CheckReferencesVp8(2, 1);
CheckReferencesVp8(3, 1);
CheckReferencesVp8(4, 3, 2, 1);
CheckReferencesVp8(5, 1);
CheckReferencesVp8(6, 5, 4, 3);
CheckReferencesVp8(7, 5, 3);
CheckReferencesVp8(8, 7, 6, 5);
}
TEST_F(TestRtpFrameReferenceFinder, Vp9GofInsertOneFrame) {
uint16_t pid = Rand();
uint16_t sn = Rand();