[FFmpeg-cvslog] hevc: implement pic_output_flag handling

Gildas Cocherel git at videolan.org
Fri Jul 11 12:28:30 CEST 2014


ffmpeg | branch: master | Gildas Cocherel <gildas.cocherel at laposte.net> | Fri Jul  4 11:21:56 2014 -0400| [458e7c94830d1522997e33a0b5e87bd709e8a349] | committer: Anton Khirnov

hevc: implement pic_output_flag handling

Sample-Id: OPFLAG_B_Qualcomm_1.bit, OPFLAG_C_Qualcomm_1.bit
Signed-off-by: Vittorio Giovara <vittorio.giovara at gmail.com>
Signed-off-by: Anton Khirnov <anton at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=458e7c94830d1522997e33a0b5e87bd709e8a349
---

 libavcodec/hevc.c      |    2 ++
 libavcodec/hevc_refs.c |    6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index d801a47..d9c9c71 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -546,6 +546,8 @@ static int hls_slice_header(HEVCContext *s)
             return AVERROR_INVALIDDATA;
         }
 
+        // when flag is not present, picture is inferred to be output
+        sh->pic_output_flag = 1;
         if (s->pps->output_flag_present_flag)
             sh->pic_output_flag = get_bits1(gb);
 
diff --git a/libavcodec/hevc_refs.c b/libavcodec/hevc_refs.c
index 2fbe9e7..c924227 100644
--- a/libavcodec/hevc_refs.c
+++ b/libavcodec/hevc_refs.c
@@ -143,8 +143,12 @@ int ff_hevc_set_new_ref(HEVCContext *s, AVFrame **frame, int poc)
     *frame = ref->frame;
     s->ref = ref;
 
+    if (s->sh.pic_output_flag)
+        ref->flags = HEVC_FRAME_FLAG_OUTPUT | HEVC_FRAME_FLAG_SHORT_REF;
+    else
+        ref->flags = HEVC_FRAME_FLAG_SHORT_REF;
+
     ref->poc      = poc;
-    ref->flags    = HEVC_FRAME_FLAG_OUTPUT | HEVC_FRAME_FLAG_SHORT_REF;
     ref->sequence = s->seq_decode;
     ref->window   = s->sps->output_window;
 



More information about the ffmpeg-cvslog mailing list