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

Unified Diff: media/video/h264_poc.cc

Issue 1967893002: H264POC: Allow gaps in frame_num. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix gap detection. 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/gpu/vt_video_decode_accelerator_mac.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.cc
diff --git a/media/video/h264_poc.cc b/media/video/h264_poc.cc
index 164d704f13dd51eee5759fe65fd7bb0f03abea3e..4ddd7acee7cca3ac24b7e41b2c9149c14a4d9620 100644
--- a/media/video/h264_poc.cc
+++ b/media/video/h264_poc.cc
@@ -62,17 +62,20 @@ bool H264POC::ComputePicOrderCnt(
return false;
}
- // TODO(sandersd): Handle |gaps_in_frame_num_value|.
- if (prev_frame_num_ > 0 && prev_frame_num_ < slice_hdr.frame_num - 1) {
- DLOG(ERROR) << "Gaps in frame_num are not supported";
- return false;
- }
-
bool mmco5 = HasMMCO5(slice_hdr);
int32_t max_frame_num = 1 << (sps->log2_max_frame_num_minus4 + 4);
int32_t max_pic_order_cnt_lsb =
1 << (sps->log2_max_pic_order_cnt_lsb_minus4 + 4);
+ if (!slice_hdr.idr_pic_flag &&
+ slice_hdr.frame_num != (prev_frame_num_ + 1) % max_frame_num) {
Pawel Osciak 2016/05/20 00:21:31 Not sure if this is intentional, but this changes
sandersd (OOO until July 31) 2016/05/20 00:39:09 My understanding of the spec is that this only hap
Pawel Osciak 2016/05/20 07:50:12 I just thought that not changing the condition wou
+ // We don't do any special handling of gaps in |frame_num|, because the
+ // computations below are unaffected by them. In particular, wrapping is
+ // handled the same whether we simulate the missing frames or not.
+ if (!sps->gaps_in_frame_num_value_allowed_flag)
+ DLOG(WARNING) << "Invalid gap in frame_num.";
+ }
+
// Based on T-REC-H.264 8.2.1, "Decoding process for picture order
// count", available from http://www.itu.int/rec/T-REC-H.264.
//
« no previous file with comments | « media/gpu/vt_video_decode_accelerator_mac.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698