38 for(i=0; i<buf_size; i++){
39 state= (state<<8) | buf[i];
52 for(; i<buf_size; i++){
53 state= (state<<8) | buf[i];
54 if((state&0xFFFFFF00) == 0x100){
69 const uint8_t *buf,
int buf_size)
108 const uint8_t **poutbuf,
int *poutbuf_size,
109 const uint8_t *buf,
int buf_size)
128 *poutbuf_size = buf_size;
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
int coded_width
Bitstream width / height, may be different from width/height if lowres enabled.
struct ParseContext1 ParseContext1
int ff_mpeg4video_split(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
void ff_parse1_close(AVCodecParserContext *s)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
Picture current_picture
copy of the current picture structure.
void avcodec_set_dimensions(AVCodecContext *s, int width, int height)
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.
int width
picture width / height.
Picture * current_picture_ptr
pointer to the current picture
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
static int av_mpeg4_decode_header(AVCodecParserContext *s1, AVCodecContext *avctx, const uint8_t *buf, int buf_size)
#define PARSER_FLAG_COMPLETE_FRAMES
struct MpegEncContext * enc
int ff_mpeg4_decode_picture_header(MpegEncContext *s, GetBitContext *gb)
Decode mpeg4 headers.
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.