From a12d3188cbec15e22070e139fa5cc541da07e2c3 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 29 Jan 2015 08:42:14 +0100 Subject: h264: use a smaller struct for the ref lists There is no need to store a whole H264Picture, with a full AVFrame embedded in it. This should allow getting rid of the embedded AVFrame later. --- libavcodec/h264.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'libavcodec/h264.h') diff --git a/libavcodec/h264.h b/libavcodec/h264.h index 8b73b752ad..9fc5c12fee 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -296,6 +296,17 @@ typedef struct H264Picture { int recovered; ///< picture at IDR or recovery point + recovery count } H264Picture; +typedef struct H264Ref { + uint8_t *data[3]; + int linesize[3]; + + int reference; + int poc; + int pic_id; + + H264Picture *parent; +} H264Ref; + typedef struct H264SliceContext { struct H264Context *h264; GetBitContext gb; @@ -393,7 +404,7 @@ typedef struct H264SliceContext { */ unsigned int ref_count[2]; ///< counts frames or fields, depending on current mb mode unsigned int list_count; - H264Picture ref_list[2][48]; /**< 0..15: frame refs, 16..47: mbaff field refs. + H264Ref ref_list[2][48]; /**< 0..15: frame refs, 16..47: mbaff field refs. * Reordered version of default_ref_list * according to picture reordering in slice header */ int ref2frm[MAX_SLICES][2][64]; ///< reference to frame number lists, used in the loop filter, the first 2 are for -2,-1 @@ -585,7 +596,7 @@ typedef struct H264Context { */ int max_pic_num; - H264Picture default_ref_list[2][32]; ///< base reference list for all slices of a coded picture + H264Ref default_ref_list[2][32]; ///< base reference list for all slices of a coded picture H264Picture *short_ref[32]; H264Picture *long_ref[32]; H264Picture *delayed_pic[MAX_DELAYED_PIC_COUNT + 2]; // FIXME size? -- cgit v1.2.3