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

Unified Diff: media/video/h264_poc_unittest.cc

Issue 2011353003: H264POC: Re-compute PicOrderCnt for duplicate frame_nums. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/video/h264_poc.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/h264_poc_unittest.cc
diff --git a/media/video/h264_poc_unittest.cc b/media/video/h264_poc_unittest.cc
index 9df67429fd9338213a9c8f084af2393c3a07fd65..d2022d5966fcdf5229b7b5add1f05c7309baedb5 100644
--- a/media/video/h264_poc_unittest.cc
+++ b/media/video/h264_poc_unittest.cc
@@ -192,6 +192,35 @@ TEST_F(H264POCTest, PicOrderCntType1_WithMMCO5) {
ASSERT_EQ(1, poc_);
}
+// Despite being invalid, videos with duplicate non-keyframe |frame_num| values
+// are common. http://crbug.com/615289, http://crbug.com/616349.
+TEST_F(H264POCTest, PicOrderCntType1_DupFrameNum) {
+ sps_.pic_order_cnt_type = 1;
+ sps_.log2_max_frame_num_minus4 = 0; // 16
+ sps_.num_ref_frames_in_pic_order_cnt_cycle = 2;
+ sps_.expected_delta_per_pic_order_cnt_cycle = 3;
+ sps_.offset_for_ref_frame[0] = 1;
+ sps_.offset_for_ref_frame[1] = 2;
+
+ // Initial IDR with POC 0.
+ slice_hdr_.idr_pic_flag = true;
+ slice_hdr_.frame_num = 0;
+ ASSERT_TRUE(ComputePOC());
+ ASSERT_EQ(0, poc_);
+
+ // Ref frame.
+ slice_hdr_.idr_pic_flag = false;
+ slice_hdr_.frame_num = 1;
+ ASSERT_TRUE(ComputePOC());
+ ASSERT_EQ(1, poc_);
+
+ // Duplicate |frame_num| frame.
+ slice_hdr_.frame_num = 1;
+ slice_hdr_.delta_pic_order_cnt0 = 1;
+ ASSERT_TRUE(ComputePOC());
+ ASSERT_EQ(2, poc_);
+}
+
TEST_F(H264POCTest, PicOrderCntType2) {
sps_.pic_order_cnt_type = 2;
« no previous file with comments | « media/video/h264_poc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698