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

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

Issue 2760893002: Don't recalculate Tl0PicIdx when the VP9 frame has no Tl0PicIdx. (Closed)
Patch Set: Created 3 years, 9 months 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 unified diff | Download patch
« no previous file with comments | « webrtc/modules/video_coding/rtp_frame_reference_finder.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after
1278 CheckReferencesVp9(pid + 5, 1, pid + 4); 1278 CheckReferencesVp9(pid + 5, 1, pid + 4);
1279 CheckReferencesVp9(pid + 6, 0, pid + 4); 1279 CheckReferencesVp9(pid + 6, 0, pid + 4);
1280 CheckReferencesVp9(pid + 6, 1, pid + 5); 1280 CheckReferencesVp9(pid + 6, 1, pid + 5);
1281 CheckReferencesVp9(pid + 7, 1, pid + 6); 1281 CheckReferencesVp9(pid + 7, 1, pid + 6);
1282 CheckReferencesVp9(pid + 8, 0, pid + 6); 1282 CheckReferencesVp9(pid + 8, 0, pid + 6);
1283 CheckReferencesVp9(pid + 8, 1, pid + 7); 1283 CheckReferencesVp9(pid + 8, 1, pid + 7);
1284 } 1284 }
1285 1285
1286 // TODO(philipel): Remove when VP9 PID/TL0 does not jump mid-stream (should be 1286 // TODO(philipel): Remove when VP9 PID/TL0 does not jump mid-stream (should be
1287 // around M59). 1287 // around M59).
1288 TEST_F(TestRtpFrameReferenceFinder, Vp9PidFix_PidJumpsForwardNoTl0PicIdx) {
1289 GofInfoVP9 ss;
1290 ss.SetGofInfoVP9(kTemporalStructureMode1);
1291
1292 VCMPacket packet;
1293 packet.timestamp = 0;
1294 packet.codec = kVideoCodecVP9;
1295 packet.frameType = kVideoFrameKey;
1296 packet.markerBit = true;
1297 packet.video_header.codecHeader.VP9.flexible_mode = false;
1298 packet.video_header.codecHeader.VP9.picture_id = 0;
1299 packet.video_header.codecHeader.VP9.temporal_idx = kNoTemporalIdx;
1300 packet.video_header.codecHeader.VP9.spatial_idx = kNoSpatialIdx;
1301 packet.video_header.codecHeader.VP9.tl0_pic_idx = kNoTl0PicIdx;
1302 packet.video_header.codecHeader.VP9.temporal_up_switch = true;
1303 packet.video_header.codecHeader.VP9.ss_data_available = true;
1304 packet.video_header.codecHeader.VP9.gof = ss;
1305
1306 {
tommi (sloooow) - chröme 2017/03/20 14:15:27 is there a reason for these scopes? (InsertPacket(
philipel 2017/03/20 14:38:49 Not really necessary but it made it easier to copy
tommi 2017/03/20 16:33:21 I see. Another alternative could of course be: re
1307 ref_packet_buffer_->InsertPacket(&packet);
1308 std::unique_ptr<RtpFrameObject> frame(
1309 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0));
1310 reference_finder_->ManageFrame(std::move(frame));
1311 }
1312
1313 packet.timestamp = 1;
1314 packet.video_header.codecHeader.VP9.picture_id = 5000;
1315
1316 {
1317 ref_packet_buffer_->InsertPacket(&packet);
1318 std::unique_ptr<RtpFrameObject> frame(
1319 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0));
1320 reference_finder_->ManageFrame(std::move(frame));
1321 }
1322
1323 ASSERT_EQ(2UL, frames_from_callback_.size());
1324 CheckReferencesVp9(0, 0);
1325 CheckReferencesVp9(128, 0);
1326 }
1327
1328 // TODO(philipel): Remove when VP9 PID/TL0 does not jump mid-stream (should be
1329 // around M59).
1288 TEST_F(TestRtpFrameReferenceFinder, Vp9PidFix_PidJumpsBackwardThenForward) { 1330 TEST_F(TestRtpFrameReferenceFinder, Vp9PidFix_PidJumpsBackwardThenForward) {
1289 GofInfoVP9 ss; 1331 GofInfoVP9 ss;
1290 ss.SetGofInfoVP9(kTemporalStructureMode1); 1332 ss.SetGofInfoVP9(kTemporalStructureMode1);
1291 1333
1292 VCMPacket packet; 1334 VCMPacket packet;
1293 packet.timestamp = 0; 1335 packet.timestamp = 0;
1294 packet.codec = kVideoCodecVP9; 1336 packet.codec = kVideoCodecVP9;
1295 packet.frameType = kVideoFrameKey; 1337 packet.frameType = kVideoFrameKey;
1296 packet.markerBit = true; 1338 packet.markerBit = true;
1297 packet.video_header.codecHeader.VP9.flexible_mode = false; 1339 packet.video_header.codecHeader.VP9.flexible_mode = false;
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1512 reference_finder_->ManageFrame(std::move(frame)); 1554 reference_finder_->ManageFrame(std::move(frame));
1513 } 1555 }
1514 1556
1515 ASSERT_EQ(2UL, frames_from_callback_.size()); 1557 ASSERT_EQ(2UL, frames_from_callback_.size());
1516 CheckReferencesVp9(1, 0); 1558 CheckReferencesVp9(1, 0);
1517 CheckReferencesVp9(129, 0); 1559 CheckReferencesVp9(129, 0);
1518 } 1560 }
1519 1561
1520 } // namespace video_coding 1562 } // namespace video_coding
1521 } // namespace webrtc 1563 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/rtp_frame_reference_finder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698