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

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

Issue 2127073002: Bugfix for Vp9 GOF and missing frames. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Better unittest describing the bug fixed. Created 4 years, 5 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 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 CheckReferencesVp9(pid + 12, 0, pid + 11); 1106 CheckReferencesVp9(pid + 12, 0, pid + 11);
1107 CheckReferencesVp9(pid + 13, 0, pid + 12); 1107 CheckReferencesVp9(pid + 13, 0, pid + 12);
1108 CheckReferencesVp9(pid + 14, 0, pid + 13); 1108 CheckReferencesVp9(pid + 14, 0, pid + 13);
1109 CheckReferencesVp9(pid + 15, 0, pid + 14); 1109 CheckReferencesVp9(pid + 15, 0, pid + 14);
1110 CheckReferencesVp9(pid + 16, 0, pid + 15); 1110 CheckReferencesVp9(pid + 16, 0, pid + 15);
1111 CheckReferencesVp9(pid + 17, 0, pid + 16); 1111 CheckReferencesVp9(pid + 17, 0, pid + 16);
1112 CheckReferencesVp9(pid + 18, 0, pid + 17); 1112 CheckReferencesVp9(pid + 18, 0, pid + 17);
1113 CheckReferencesVp9(pid + 19, 0, pid + 18); 1113 CheckReferencesVp9(pid + 19, 0, pid + 18);
1114 } 1114 }
1115 1115
1116 TEST_F(TestPacketBuffer, Vp9GofSkipFramesTemporalLayers_01) {
1117 uint16_t pid = Rand();
1118 uint16_t sn = Rand();
1119 GofInfoVP9 ss;
1120 ss.SetGofInfoVP9(kTemporalStructureMode2); // 0101 pattern
1121
1122 // sn , kf, frst, lst, up, pid , sid, tid, tl0, ss
1123 InsertVp9Gof(sn , kT, kT , kT , kF, pid , 0 , 0 , 0 , &ss);
1124 InsertVp9Gof(sn + 1 , kF, kT , kT , kF, pid + 1 , 0 , 1 , 0);
1125 // Skip GOF with tl0 1
1126 InsertVp9Gof(sn + 4 , kT, kT , kT , kF, pid + 4 , 0 , 0 , 2 , &ss);
1127 InsertVp9Gof(sn + 5 , kF, kT , kT , kF, pid + 5 , 0 , 1 , 2);
1128 // Skip GOF with tl0 3
1129 // Skip GOF with tl0 4
1130 InsertVp9Gof(sn + 10, kF, kT , kT , kF, pid + 10, 0 , 0 , 5 , &ss);
1131 InsertVp9Gof(sn + 11, kF, kT , kT , kF, pid + 11, 0 , 1 , 5);
1132
1133 ASSERT_EQ(6UL, frames_from_callback_.size());
1134 CheckReferencesVp9(pid, 0);
1135 CheckReferencesVp9(pid + 1 , 0, pid);
1136 CheckReferencesVp9(pid + 4 , 0);
1137 CheckReferencesVp9(pid + 5 , 0, pid + 4);
1138 CheckReferencesVp9(pid + 10, 0, pid + 8);
1139 CheckReferencesVp9(pid + 11, 0, pid + 10);
1140 }
1141
1142 TEST_F(TestPacketBuffer, Vp9GofSkipFramesTemporalLayers_0212) {
1143 uint16_t pid = Rand();
1144 uint16_t sn = Rand();
1145 GofInfoVP9 ss;
1146 ss.SetGofInfoVP9(kTemporalStructureMode3); // 02120212 pattern
1147
1148 // sn , kf, frst, lst, up, pid , sid, tid, tl0, ss
1149 InsertVp9Gof(sn , kT, kT , kT , kF, pid , 0 , 0 , 0 , &ss);
1150 InsertVp9Gof(sn + 1 , kF, kT , kT , kF, pid + 1 , 0 , 2 , 0);
1151 InsertVp9Gof(sn + 2 , kF, kT , kT , kF, pid + 2 , 0 , 1 , 0);
1152 InsertVp9Gof(sn + 3 , kF, kT , kT , kF, pid + 3 , 0 , 2 , 0);
1153
1154 ASSERT_EQ(4UL, frames_from_callback_.size());
1155 CheckReferencesVp9(pid, 0);
1156 CheckReferencesVp9(pid + 1 , 0, pid);
1157 CheckReferencesVp9(pid + 2 , 0, pid);
1158 CheckReferencesVp9(pid + 3 , 0, pid + 1, pid + 2);
1159
1160 // Skip frames with tl0 = 1
1161
1162 // sn , kf, frst, lst, up, pid , sid, tid, tl0, ss
1163 InsertVp9Gof(sn + 8 , kT, kT , kT , kF, pid + 8 , 0 , 0 , 2 , &ss);
1164 InsertVp9Gof(sn + 9 , kF, kT , kT , kF, pid + 9 , 0 , 2 , 2);
1165 InsertVp9Gof(sn + 10, kF, kT , kT , kF, pid + 10, 0 , 1 , 2);
1166 InsertVp9Gof(sn + 11, kF, kT , kT , kF, pid + 11, 0 , 2 , 2);
1167
1168 ASSERT_EQ(8UL, frames_from_callback_.size());
1169 CheckReferencesVp9(pid + 8, 0);
1170 CheckReferencesVp9(pid + 9 , 0, pid + 8);
1171 CheckReferencesVp9(pid + 10, 0, pid + 8);
1172 CheckReferencesVp9(pid + 11, 0, pid + 9, pid + 10);
1173
1174 // Now insert frames with tl0 = 1
1175 // sn , kf, frst, lst, up, pid , sid, tid, tl0, ss
1176 InsertVp9Gof(sn + 4 , kT, kT , kT , kF, pid + 4 , 0 , 0 , 1 , &ss);
1177 InsertVp9Gof(sn + 7 , kF, kT , kT , kF, pid + 7 , 0 , 2 , 1);
1178
1179 ASSERT_EQ(9UL, frames_from_callback_.size());
1180 CheckReferencesVp9(pid + 4, 0);
1181
1182 // Rest of frames belonging to tl0 = 1
1183 // sn , kf, frst, lst, up, pid , sid, tid, tl0, ss
1184 InsertVp9Gof(sn + 5 , kF, kT , kT , kF, pid + 5 , 0 , 2 , 1);
1185 InsertVp9Gof(sn + 6 , kF, kT , kT , kT, pid + 6 , 0 , 1 , 1); // up-switch
1186
1187 ASSERT_EQ(12UL, frames_from_callback_.size());
1188 CheckReferencesVp9(pid + 5 , 0, pid + 4);
1189 CheckReferencesVp9(pid + 6 , 0, pid + 4);
1190 CheckReferencesVp9(pid + 7 , 0, pid + 6);
1191 }
1192
1116 TEST_F(TestPacketBuffer, Vp9GofTemporalLayers_01) { 1193 TEST_F(TestPacketBuffer, Vp9GofTemporalLayers_01) {
1117 uint16_t pid = Rand(); 1194 uint16_t pid = Rand();
1118 uint16_t sn = Rand(); 1195 uint16_t sn = Rand();
1119 GofInfoVP9 ss; 1196 GofInfoVP9 ss;
1120 ss.SetGofInfoVP9(kTemporalStructureMode2); // 0101 pattern 1197 ss.SetGofInfoVP9(kTemporalStructureMode2); // 0101 pattern
1121 1198
1122 // sn , kf, frst, lst, up, pid , sid, tid, tl0, ss 1199 // sn , kf, frst, lst, up, pid , sid, tid, tl0, ss
1123 InsertVp9Gof(sn , kT, kT , kT , kF, pid , 0 , 0 , 0 , &ss); 1200 InsertVp9Gof(sn , kT, kT , kT , kF, pid , 0 , 0 , 0 , &ss);
1124 InsertVp9Gof(sn + 1 , kF, kT , kT , kF, pid + 1 , 0 , 1 , 0); 1201 InsertVp9Gof(sn + 1 , kF, kT , kT , kF, pid + 1 , 0 , 1 , 0);
1125 InsertVp9Gof(sn + 2 , kF, kT , kT , kF, pid + 2 , 0 , 0 , 1); 1202 InsertVp9Gof(sn + 2 , kF, kT , kT , kF, pid + 2 , 0 , 0 , 1);
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
1519 CheckReferencesVp9(pid + 5, 1, pid + 4); 1596 CheckReferencesVp9(pid + 5, 1, pid + 4);
1520 CheckReferencesVp9(pid + 6, 0, pid + 4); 1597 CheckReferencesVp9(pid + 6, 0, pid + 4);
1521 CheckReferencesVp9(pid + 6, 1, pid + 5); 1598 CheckReferencesVp9(pid + 6, 1, pid + 5);
1522 CheckReferencesVp9(pid + 7, 1, pid + 6); 1599 CheckReferencesVp9(pid + 7, 1, pid + 6);
1523 CheckReferencesVp9(pid + 8, 0, pid + 6); 1600 CheckReferencesVp9(pid + 8, 0, pid + 6);
1524 CheckReferencesVp9(pid + 8, 1, pid + 7); 1601 CheckReferencesVp9(pid + 8, 1, pid + 7);
1525 } 1602 }
1526 1603
1527 } // namespace video_coding 1604 } // namespace video_coding
1528 } // namespace webrtc 1605 } // 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