Message ID | 20220216085146.26078-1-lq@chinaffmpeg.org |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel,1/2] avcodec/h264_slice: compute prev_frame_num_offset to correct value | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
andriy/make_ppc | success | Make finished |
andriy/make_fate_ppc | success | Make fate finished |
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index 110a41772a..6f21c48b2d 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -1667,6 +1667,8 @@ static int h264_field_start(H264Context *h, const H264SliceContext *sl, } h->poc.prev_frame_num++; + if (h->poc.prev_frame_num >= (1 << sps->log2_max_frame_num)) + h->poc.prev_frame_num_offset += 1 << sps->log2_max_frame_num; h->poc.prev_frame_num %= 1 << sps->log2_max_frame_num; h->cur_pic_ptr->frame_num = h->poc.prev_frame_num; h->cur_pic_ptr->invalid_gap = !sps->gaps_in_frame_num_allowed_flag;