diff options
author | gcocherel <gildas.cocherel@laposte.net> | 2014-04-29 11:29:16 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-04-29 22:43:25 +0200 |
commit | 2eddf3a6efd80aa6e9d7f42ad9a892a82c5ece70 (patch) | |
tree | 9c686e413206da2dd2bb45cccdcd78d50acf0caf /libavcodec/hevc_refs.c | |
parent | 978c193d47c08edad5aa1931a89622c3a0a5c601 (diff) | |
download | ffmpeg-2eddf3a6efd80aa6e9d7f42ad9a892a82c5ece70.tar.gz |
avcodec/hevc: fix no output of prior pics and pic output flags(cherry picked from commit e99b96dff1d76d74cb5633aa9702828d863050e2)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/hevc_refs.c')
-rw-r--r-- | libavcodec/hevc_refs.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/hevc_refs.c b/libavcodec/hevc_refs.c index 3a8e4a3f2d..24d55d15be 100644 --- a/libavcodec/hevc_refs.c +++ b/libavcodec/hevc_refs.c @@ -146,6 +146,8 @@ int ff_hevc_set_new_ref(HEVCContext *s, AVFrame **frame, int poc) ref->poc = poc; ref->flags = HEVC_FRAME_FLAG_OUTPUT | HEVC_FRAME_FLAG_SHORT_REF; + if (s->sh.pic_output_flag == 0) + ref->flags &= ~(HEVC_FRAME_FLAG_OUTPUT); ref->sequence = s->seq_decode; ref->window = s->sps->output_window; @@ -159,6 +161,16 @@ int ff_hevc_output_frame(HEVCContext *s, AVFrame *out, int flush) int min_poc = INT_MAX; int i, min_idx, ret; + if (s->sh.no_output_of_prior_pics_flag == 1) { + for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) { + HEVCFrame *frame = &s->DPB[i]; + if ((frame->flags & HEVC_FRAME_FLAG_OUTPUT) && frame->poc != s->poc && + frame->sequence == s->seq_output) { + frame->flags &= ~(HEVC_FRAME_FLAG_OUTPUT); + } + } + } + for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) { HEVCFrame *frame = &s->DPB[i]; if ((frame->flags & HEVC_FRAME_FLAG_OUTPUT) && |