]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/h264.h
Remove superfluous () from lclenc.c
[ffmpeg] / libavcodec / h264.h
index 4a77d25d7d54f0df70ffb52483d142071cd6827e..b58d86a67d4f134475ff2d6e7f9560b37117270e 100644 (file)
@@ -115,6 +115,7 @@ enum {
  * SEI message types
  */
 typedef enum {
+    SEI_BUFFERING_PERIOD             =  0, ///< buffering period (H.264, D.1.1)
     SEI_TYPE_PIC_TIMING              =  1, ///< picture timing
     SEI_TYPE_USER_DATA_UNREGISTERED  =  5, ///< unregistered user data
     SEI_TYPE_RECOVERY_POINT          =  6  ///< recovery point (frame # to decoder sync)
@@ -349,7 +350,7 @@ typedef struct H264Context{
     int mb_field_decoding_flag;
     int mb_mbaff;              ///< mb_aff_frame && mb_field_decoding_flag
 
-    uint16_t sub_mb_type[4];
+    DECLARE_ALIGNED_8(uint16_t, sub_mb_type[4]);
 
     //POC stuff
     int poc_lsb;
@@ -502,6 +503,13 @@ typedef struct H264Context{
      */
     SEI_PicStructType sei_pic_struct;
 
+    /**
+     * Bit set of clock types for fields/frames in picture timing SEI message.
+     * For each found ct_type, appropriate bit is set (e.g., bit 1 for
+     * interlaced).
+     */
+    int sei_ct_type;
+
     /**
      * dpb_output_delay in picture timing SEI message, see H.264 C.2.2
      */
@@ -525,6 +533,45 @@ typedef struct H264Context{
 
     int luma_weight_flag[2];   ///< 7.4.3.2 luma_weight_lX_flag
     int chroma_weight_flag[2]; ///< 7.4.3.2 chroma_weight_lX_flag
+
+    // Timestamp stuff
+    int sei_buffering_period_present;  ///< Buffering period SEI flag
+    int initial_cpb_removal_delay[32]; ///< Initial timestamps for CPBs
 }H264Context;
 
+/**
+ * Decode SEI
+ */
+int ff_h264_decode_sei(H264Context *h);
+
+/**
+ * Decode SPS
+ */
+int ff_h264_decode_seq_parameter_set(H264Context *h);
+
+/**
+ * Decode PPS
+ */
+int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length);
+
+/**
+ * Decodes a network abstraction layer unit.
+ * @param consumed is the number of bytes used as input
+ * @param length is the length of the array
+ * @param dst_length is the number of decoded bytes FIXME here or a decode rbsp tailing?
+ * @returns decoded bytes, might be src+1 if no escapes
+ */
+const uint8_t *ff_h264_decode_nal(H264Context *h, const uint8_t *src, int *dst_length, int *consumed, int length);
+
+/**
+ * identifies the exact end of the bitstream
+ * @return the length of the trailing, or 0 if damaged
+ */
+int ff_h264_decode_rbsp_trailing(H264Context *h, const uint8_t *src);
+
+/**
+ * frees any data that may have been allocated in the H264 context like SPS, PPS etc.
+ */
+av_cold void ff_h264_free_context(H264Context *h);
+
 #endif /* AVCODEC_H264_H */