45 for (i = 0; i < buf_size; i++) {
46 state = (state << 8) | buf[i];
59 for (; i < buf_size; i++) {
60 state = (state << 8) | buf[i];
61 if ((state & 0xFFFFFF00) == 0x100) {
75 const uint8_t *buf,
int buf_size)
115 const uint8_t **poutbuf,
int *poutbuf_size,
116 const uint8_t *buf,
int buf_size)
135 *poutbuf_size = buf_size;
int coded_width
Bitstream width / height, may be different from width/height e.g.
int ff_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
int ff_mpeg4video_split(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
Picture current_picture
copy of the current picture structure.
static int mpeg4video_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
int slice_context_count
number of used thread_contexts
AVCodecParser ff_mpeg4video_parser
int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size)
Combine the (truncated) bitstream to a complete frame.
#define PARSER_FLAG_COMPLETE_FRAMES
void ff_parse_close(AVCodecParserContext *s)
static int mpeg4_decode_header(AVCodecParserContext *s1, AVCodecContext *avctx, const uint8_t *buf, int buf_size)
int width
picture width / height.
Picture * current_picture_ptr
pointer to the current picture
int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb)
Decode mpeg4 headers.
static av_cold int mpeg4video_parse_init(AVCodecParserContext *s)
main external API structure.
int height
picture size. must be a multiple of 16
uint32_t state
contains the last few bytes in MSB order
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
struct AVCodecContext * avctx
common internal api header.
int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size)
Find the end of the current frame in the bitstream.