]> git.sesse.net Git - ffmpeg/commitdiff
hevc: implement pic_output_flag handling
authorGildas Cocherel <gildas.cocherel@laposte.net>
Fri, 4 Jul 2014 15:21:56 +0000 (11:21 -0400)
committerAnton Khirnov <anton@khirnov.net>
Fri, 11 Jul 2014 08:52:54 +0000 (08:52 +0000)
Sample-Id: OPFLAG_B_Qualcomm_1.bit, OPFLAG_C_Qualcomm_1.bit
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavcodec/hevc.c
libavcodec/hevc_refs.c

index d801a472708cc8d570690b489d026a2354441bf4..d9c9c7104ddfe3c03dd4ed3a764bd141dcfcc37e 100644 (file)
@@ -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);
 
index 2fbe9e787cc4be9becc4a91e343769e60fe7e9d1..c924227e5012a8ae9076be150cd09e24eb288290 100644 (file)
@@ -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;