diff options
author | Xu Guangxin <guangxin.xu@intel.com> | 2022-07-15 13:06:42 +0800 |
---|---|---|
committer | Haihao Xiang <haihao.xiang@intel.com> | 2022-07-27 10:54:38 +0800 |
commit | 99501b50157702af191a6cc8d0ddb89663d69d61 (patch) | |
tree | fab8c12f1c41e62c048e3173dc9927fd10e2e47a /libavcodec/hevcdec.c | |
parent | 6c12fe0ddaf5bf9914027f1f4acfc196008c9aba (diff) | |
download | ffmpeg-99501b50157702af191a6cc8d0ddb89663d69d61.tar.gz |
lavc/hevcdec: do not let missing ref frames invovled in dpb process
We will generate a new frame for a missed reference. The frame can only
be used for reference. We assign an invalid decode sequence to it, so
it will not be involved in any dpb process.
Tested-by: Fei Wang <fei.w.wang@intel.com>
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
Signed-off-by: Xu Guangxin <guangxin.xu@intel.com>
Diffstat (limited to 'libavcodec/hevcdec.c')
-rw-r--r-- | libavcodec/hevcdec.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 0421db201e..1dc8c7b4c7 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -570,7 +570,7 @@ static int hls_slice_header(HEVCContext *s) } if ((IS_IDR(s) || IS_BLA(s)) && sh->first_slice_in_pic_flag) { - s->seq_decode = (s->seq_decode + 1) & 0xff; + s->seq_decode = (s->seq_decode + 1) & HEVC_SEQUENCE_COUNTER_MASK; s->max_ra = INT_MAX; if (IS_IDR(s)) ff_hevc_clear_refs(s); @@ -615,7 +615,7 @@ static int hls_slice_header(HEVCContext *s) return pix_fmt; s->avctx->pix_fmt = pix_fmt; - s->seq_decode = (s->seq_decode + 1) & 0xff; + s->seq_decode = (s->seq_decode + 1) & HEVC_SEQUENCE_COUNTER_MASK; s->max_ra = INT_MAX; } @@ -3254,7 +3254,7 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) break; case HEVC_NAL_EOS_NUT: case HEVC_NAL_EOB_NUT: - s->seq_decode = (s->seq_decode + 1) & 0xff; + s->seq_decode = (s->seq_decode + 1) & HEVC_SEQUENCE_COUNTER_MASK; s->max_ra = INT_MAX; break; case HEVC_NAL_AUD: @@ -3718,7 +3718,7 @@ static int hevc_update_thread_context(AVCodecContext *dst, s->threads_type = s0->threads_type; if (s0->eos) { - s->seq_decode = (s->seq_decode + 1) & 0xff; + s->seq_decode = (s->seq_decode + 1) & HEVC_SEQUENCE_COUNTER_MASK; s->max_ra = INT_MAX; } |