Chromium Code Reviews

Side by Side Diff: webrtc/modules/video_coding/rtp_frame_reference_finder_unittest.cc

Issue 2734453002: Drop VP8 frames in case of duplicates in RtpFrameReferenceFinder. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 410 matching lines...)
421 InsertVp8(sn + 2, sn + 2, false, pid + 2, 0, 3); 421 InsertVp8(sn + 2, sn + 2, false, pid + 2, 0, 3);
422 InsertVp8(sn + 3, sn + 3, false, pid + 3, 0, 4); 422 InsertVp8(sn + 3, sn + 3, false, pid + 3, 0, 4);
423 423
424 ASSERT_EQ(4UL, frames_from_callback_.size()); 424 ASSERT_EQ(4UL, frames_from_callback_.size());
425 CheckReferencesVp8(pid); 425 CheckReferencesVp8(pid);
426 CheckReferencesVp8(pid + 1, pid); 426 CheckReferencesVp8(pid + 1, pid);
427 CheckReferencesVp8(pid + 2, pid + 1); 427 CheckReferencesVp8(pid + 2, pid + 1);
428 CheckReferencesVp8(pid + 3, pid + 2); 428 CheckReferencesVp8(pid + 3, pid + 2);
429 } 429 }
430 430
431 TEST_F(TestRtpFrameReferenceFinder, Vp8DuplicateTl1Frames) {
432 uint16_t pid = Rand();
433 uint16_t sn = Rand();
434
435 InsertVp8(sn, sn, true, pid, 0, 0);
436 InsertVp8(sn + 1, sn + 1, false, pid + 1, 1, 0, true);
437 InsertVp8(sn + 2, sn + 2, false, pid + 2, 0, 1);
438 InsertVp8(sn + 3, sn + 3, false, pid + 3, 1, 1);
439 InsertVp8(sn + 3, sn + 3, false, pid + 3, 1, 1);
sprang_webrtc 2017/03/06 09:52:52 Should you add something new after this one to mak
philipel 2017/03/07 10:47:11 Done.
440
441 ASSERT_EQ(4UL, frames_from_callback_.size());
442 CheckReferencesVp8(pid);
443 CheckReferencesVp8(pid + 1, pid);
444 CheckReferencesVp8(pid + 2, pid);
445 CheckReferencesVp8(pid + 3, pid + 1, pid + 2);
446 }
447
431 // Test with 1 temporal layer. 448 // Test with 1 temporal layer.
432 TEST_F(TestRtpFrameReferenceFinder, Vp8TemporalLayersReordering_0) { 449 TEST_F(TestRtpFrameReferenceFinder, Vp8TemporalLayersReordering_0) {
433 uint16_t pid = Rand(); 450 uint16_t pid = Rand();
434 uint16_t sn = Rand(); 451 uint16_t sn = Rand();
435 452
436 InsertVp8(sn, sn, true, pid, 0, 1); 453 InsertVp8(sn, sn, true, pid, 0, 1);
437 InsertVp8(sn + 1, sn + 1, false, pid + 1, 0, 2); 454 InsertVp8(sn + 1, sn + 1, false, pid + 1, 0, 2);
438 InsertVp8(sn + 3, sn + 3, false, pid + 3, 0, 4); 455 InsertVp8(sn + 3, sn + 3, false, pid + 3, 0, 4);
439 InsertVp8(sn + 2, sn + 2, false, pid + 2, 0, 3); 456 InsertVp8(sn + 2, sn + 2, false, pid + 2, 0, 3);
440 InsertVp8(sn + 5, sn + 5, false, pid + 5, 0, 6); 457 InsertVp8(sn + 5, sn + 5, false, pid + 5, 0, 6);
(...skipping 1050 matching lines...)
1491 reference_finder_->ManageFrame(std::move(frame)); 1508 reference_finder_->ManageFrame(std::move(frame));
1492 } 1509 }
1493 1510
1494 ASSERT_EQ(2UL, frames_from_callback_.size()); 1511 ASSERT_EQ(2UL, frames_from_callback_.size());
1495 CheckReferencesVp9(1, 0); 1512 CheckReferencesVp9(1, 0);
1496 CheckReferencesVp9(129, 0); 1513 CheckReferencesVp9(129, 0);
1497 } 1514 }
1498 1515
1499 } // namespace video_coding 1516 } // namespace video_coding
1500 } // namespace webrtc 1517 } // namespace webrtc
OLDNEW

Powered by Google App Engine