]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/h264.h
lavc doxy: document that avcodec_flush_buffers() invalidates decoded frames
[ffmpeg] / libavcodec / h264.h
index 077202dd9d4b0870aa00d8547d56afe36379bb82..3ef8420ef6d76579c814b42acf2340e8eecb97eb 100644 (file)
@@ -62,7 +62,7 @@
 #define MB_MBAFF(h)    h->mb_mbaff
 #define MB_FIELD(h)    h->mb_field_decoding_flag
 #define FRAME_MBAFF(h) h->mb_aff_frame
-#define FIELD_PICTURE (h->picture_structure != PICT_FRAME)
+#define FIELD_PICTURE(h) (h->picture_structure != PICT_FRAME)
 #define LEFT_MBS 2
 #define LTOP     0
 #define LBOT     1
@@ -71,7 +71,7 @@
 #define MB_MBAFF(h)      0
 #define MB_FIELD(h)      0
 #define FRAME_MBAFF(h)   0
-#define FIELD_PICTURE 0
+#define FIELD_PICTURE(h) 0
 #undef  IS_INTERLACED
 #define IS_INTERLACED(mb_type) 0
 #define LEFT_MBS 1
 #define LBOT     0
 #define LEFT(i)  0
 #endif
-#define FIELD_OR_MBAFF_PICTURE (FRAME_MBAFF(h) || FIELD_PICTURE)
+#define FIELD_OR_MBAFF_PICTURE(h) (FRAME_MBAFF(h) || FIELD_PICTURE(h))
 
 #ifndef CABAC
-#define CABAC h->pps.cabac
+#define CABAC(h) h->pps.cabac
 #endif
 
-#define CHROMA422 (h->sps.chroma_format_idc == 2)
-#define CHROMA444 (h->sps.chroma_format_idc == 3)
+#define CHROMA422(h) (h->sps.chroma_format_idc == 2)
+#define CHROMA444(h) (h->sps.chroma_format_idc == 3)
 
 #define EXTENDED_SAR       255
 
@@ -164,6 +164,8 @@ typedef struct SPS {
     int mb_aff;                        ///< mb_adaptive_frame_field_flag
     int direct_8x8_inference_flag;
     int crop;                          ///< frame_cropping_flag
+
+    /* those 4 are already in luma samples */
     unsigned int crop_left;            ///< frame_cropping_rect_left_offset
     unsigned int crop_right;           ///< frame_cropping_rect_right_offset
     unsigned int crop_top;             ///< frame_cropping_rect_top_offset
@@ -272,6 +274,7 @@ typedef struct H264Context {
 
     int qp_thresh;      ///< QP threshold to skip loopfilter
 
+    /* coded dimensions -- 16 * mb w/h */
     int width, height;
     int linesize, uvlinesize;
     int chroma_x_shift, chroma_y_shift;
@@ -884,7 +887,7 @@ static av_always_inline void write_back_motion_list(H264Context *h,
     AV_COPY128(mv_dst + 1 * b_stride, mv_src + 8 * 1);
     AV_COPY128(mv_dst + 2 * b_stride, mv_src + 8 * 2);
     AV_COPY128(mv_dst + 3 * b_stride, mv_src + 8 * 3);
-    if (CABAC) {
+    if (CABAC(h)) {
         uint8_t (*mvd_dst)[2] = &h->mvd_table[list][FMO ? 8 * h->mb_xy
                                                         : h->mb2br_xy[h->mb_xy]];
         uint8_t(*mvd_src)[2]  = &h->mvd_cache[list][scan8[0]];
@@ -923,7 +926,7 @@ static av_always_inline void write_back_motion(H264Context *h, int mb_type)
     if (USES_LIST(mb_type, 1))
         write_back_motion_list(h, b_stride, b_xy, b8_xy, mb_type, 1);
 
-    if (h->slice_type_nos == AV_PICTURE_TYPE_B && CABAC) {
+    if (h->slice_type_nos == AV_PICTURE_TYPE_B && CABAC(h)) {
         if (IS_8X8(mb_type)) {
             uint8_t *direct_table = &h->direct_table[4 * h->mb_xy];
             direct_table[1] = h->sub_mb_type[1] >> 1;
@@ -946,5 +949,6 @@ static av_always_inline int get_dct8x8_allowed(H264Context *h)
 }
 
 void ff_h264_draw_horiz_band(H264Context *h, int y, int height);
+int ff_init_poc(H264Context *h, int pic_field_poc[2], int *pic_poc);
 
 #endif /* AVCODEC_H264_H */