hvirtual/quicktime/ffmpeg/libavcodec/parser.c File Reference

#include "avcodec.h"
#include "mpegvideo.h"
#include "mpegaudio.h"

Include dependency graph for parser.c:

Go to the source code of this file.

Data Structures

struct  ParseContext1
struct  MpegAudioParseContext

Defines

#define PICTURE_START_CODE   0x00000100
#define SEQ_START_CODE   0x000001b3
#define EXT_START_CODE   0x000001b5
#define SLICE_MIN_START_CODE   0x00000101
#define SLICE_MAX_START_CODE   0x000001af
#define MPEG1_FRAME_RATE_BASE   1001
#define MPA_HEADER_SIZE   4
#define SAME_HEADER_MASK   (0xffe00000 | (3 << 17) | (3 << 10) | (3 << 19))

Functions

void av_register_codec_parser (AVCodecParser *parser)
AVCodecParserContextav_parser_init (int codec_id)
int av_parser_parse (AVCodecParserContext *s, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int64_t pts, int64_t dts)
int av_parser_change (AVCodecParserContext *s, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int keyframe)
void av_parser_close (AVCodecParserContext *s)
int ff_combine_frame (ParseContext *pc, int next, uint8_t **buf, int *buf_size)
static int find_start_code (const uint8_t **pbuf_ptr, const uint8_t *buf_end)
static void mpegvideo_extract_headers (AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t *buf, int buf_size)
static int mpegvideo_parse (AVCodecParserContext *s, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
static int mpegvideo_split (AVCodecContext *avctx, const uint8_t *buf, int buf_size)
void ff_parse_close (AVCodecParserContext *s)
static void parse1_close (AVCodecParserContext *s)
static int av_mpeg4_decode_header (AVCodecParserContext *s1, AVCodecContext *avctx, const uint8_t *buf, int buf_size)
static int mpeg4video_parse_init (AVCodecParserContext *s)
static int mpeg4video_parse (AVCodecParserContext *s, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
static int mpeg4video_split (AVCodecContext *avctx, const uint8_t *buf, int buf_size)
static int mpegaudio_parse_init (AVCodecParserContext *s1)
static int mpegaudio_parse (AVCodecParserContext *s1, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)

Variables

AVCodecParserav_first_parser = NULL
static const int frame_rate_tab [16]
AVCodecParser mpegvideo_parser
AVCodecParser mpeg4video_parser
AVCodecParser mpegaudio_parser


Define Documentation

#define EXT_START_CODE   0x000001b5

Definition at line 195 of file parser.c.

#define MPA_HEADER_SIZE   4

Definition at line 572 of file parser.c.

Referenced by mpegaudio_parse().

#define MPEG1_FRAME_RATE_BASE   1001

Definition at line 297 of file parser.c.

Referenced by mpegvideo_extract_headers().

#define PICTURE_START_CODE   0x00000100

Definition at line 193 of file parser.c.

#define SAME_HEADER_MASK   (0xffe00000 | (3 << 17) | (3 << 10) | (3 << 19))

Definition at line 576 of file parser.c.

#define SEQ_START_CODE   0x000001b3

Definition at line 194 of file parser.c.

#define SLICE_MAX_START_CODE   0x000001af

Definition at line 197 of file parser.c.

#define SLICE_MIN_START_CODE   0x00000101

Definition at line 196 of file parser.c.


Function Documentation

static int av_mpeg4_decode_header ( AVCodecParserContext s1,
AVCodecContext avctx,
const uint8_t *  buf,
int  buf_size 
) [static]

int av_parser_change ( AVCodecParserContext s,
AVCodecContext avctx,
uint8_t **  poutbuf,
int *  poutbuf_size,
const uint8_t *  buf,
int  buf_size,
int  keyframe 
)

Returns:
0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed

Definition at line 149 of file parser.c.

References av_malloc(), CODEC_FLAG2_LOCAL_HEADER, CODEC_FLAG_GLOBAL_HEADER, AVCodecContext::extradata, AVCodecContext::extradata_size, FF_INPUT_BUFFER_PADDING_SIZE, AVCodecContext::flags, AVCodecContext::flags2, memcpy, AVCodecParserContext::parser, and AVCodecParser::split.

Referenced by output_packet().

Here is the call graph for this function:

void av_parser_close ( AVCodecParserContext s  ) 

Definition at line 181 of file parser.c.

References av_free(), AVCodecParserContext::parser, AVCodecParser::parser_close, and AVCodecParserContext::priv_data.

Here is the call graph for this function:

AVCodecParserContext* av_parser_init ( int  codec_id  ) 

int av_parser_parse ( AVCodecParserContext s,
AVCodecContext avctx,
uint8_t **  poutbuf,
int *  poutbuf_size,
const uint8_t *  buf,
int  buf_size,
int64_t  pts,
int64_t  dts 
)

void av_register_codec_parser ( AVCodecParser parser  ) 

Definition at line 26 of file parser.c.

References AVCodecParser::next.

Referenced by avcodec_register_all().

int ff_combine_frame ( ParseContext pc,
int  next,
uint8_t **  buf,
int *  buf_size 
)

void ff_parse_close ( AVCodecParserContext s  ) 

Definition at line 468 of file parser.c.

References av_free(), ParseContext::buffer, and AVCodecParserContext::priv_data.

Here is the call graph for this function:

static int find_start_code ( const uint8_t **  pbuf_ptr,
const uint8_t *  buf_end 
) [static]

Definition at line 274 of file parser.c.

static int mpeg4video_parse ( AVCodecParserContext s,
AVCodecContext avctx,
uint8_t **  poutbuf,
int *  poutbuf_size,
const uint8_t *  buf,
int  buf_size 
) [static]

Definition at line 524 of file parser.c.

References av_mpeg4_decode_header(), ff_combine_frame(), ff_mpeg4_find_frame_end(), NULL, and AVCodecParserContext::priv_data.

Here is the call graph for this function:

static int mpeg4video_parse_init ( AVCodecParserContext s  )  [static]

Definition at line 513 of file parser.c.

References av_mallocz(), ParseContext1::enc, ParseContext1::first_picture, and AVCodecParserContext::priv_data.

Here is the call graph for this function:

static int mpeg4video_split ( AVCodecContext avctx,
const uint8_t *  buf,
int  buf_size 
) [static]

Definition at line 546 of file parser.c.

static int mpegaudio_parse ( AVCodecParserContext s1,
AVCodecContext avctx,
uint8_t **  poutbuf,
int *  poutbuf_size,
const uint8_t *  buf,
int  buf_size 
) [static]

static int mpegaudio_parse_init ( AVCodecParserContext s1  )  [static]

static void mpegvideo_extract_headers ( AVCodecParserContext s,
AVCodecContext avctx,
const uint8_t *  buf,
int  buf_size 
) [static]

static int mpegvideo_parse ( AVCodecParserContext s,
AVCodecContext avctx,
uint8_t **  poutbuf,
int *  poutbuf_size,
const uint8_t *  buf,
int  buf_size 
) [static]

static int mpegvideo_split ( AVCodecContext avctx,
const uint8_t *  buf,
int  buf_size 
) [static]

Definition at line 454 of file parser.c.

static void parse1_close ( AVCodecParserContext s  )  [static]

Definition at line 475 of file parser.c.

References av_free(), ParseContext::buffer, ParseContext1::enc, ParseContext1::pc, and AVCodecParserContext::priv_data.

Here is the call graph for this function:


Variable Documentation

Definition at line 24 of file parser.c.

const int frame_rate_tab[16] [static]

Initial value:

 {
        0,        
    24000,
    24024,
    25025,
    30000,
    30030,
    50050,
    60000,
    60060,
  
    15015,
  
     5005,
    10010,
    12012,
    15015,
  
    25025,
    25025,
}

Definition at line 299 of file parser.c.

Initial value:

Definition at line 838 of file parser.c.

Referenced by avcodec_register_all().

Initial value:

Definition at line 847 of file parser.c.

Referenced by avcodec_register_all().

Initial value:

Definition at line 829 of file parser.c.

Referenced by avcodec_register_all().


Generated on Mon Apr 28 14:05:40 2008 for Cinelerra by  doxygen 1.5.5