Chromium Code Reviews| 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. |
| // |