libavcodec/mpeg12.c File Reference

MPEG1/2 decoder. More...

#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
#include "mpeg12.h"
#include "mpeg12data.h"
#include "mpeg12decdata.h"
#include "bytestream.h"
#include "mdec.c"

Go to the source code of this file.

Data Structures

struct  Mpeg1Context

Defines

#define DC_VLC_BITS   9
#define MV_VLC_BITS   9
#define MBINCR_VLC_BITS   9
#define MB_PAT_VLC_BITS   9
#define MB_PTYPE_VLC_BITS   6
#define MB_BTYPE_VLC_BITS   6
#define TEX_VLC_BITS   9
#define MT_FIELD   1
#define MT_FRAME   2
#define MT_16X8   2
#define MT_DMV   3
#define DECODE_SLICE_ERROR   -1
#define DECODE_SLICE_OK   0

Functions

static int mpeg1_decode_block_inter (MpegEncContext *s, DCTELEM *block, int n)
static int mpeg1_decode_block_intra (MpegEncContext *s, DCTELEM *block, int n)
static int mpeg1_fast_decode_block_inter (MpegEncContext *s, DCTELEM *block, int n)
static int mpeg2_decode_block_non_intra (MpegEncContext *s, DCTELEM *block, int n)
static int mpeg2_decode_block_intra (MpegEncContext *s, DCTELEM *block, int n)
static int mpeg2_fast_decode_block_non_intra (MpegEncContext *s, DCTELEM *block, int n)
static int mpeg2_fast_decode_block_intra (MpegEncContext *s, DCTELEM *block, int n)
static int mpeg_decode_motion (MpegEncContext *s, int fcode, int pred)
static void exchange_uv (MpegEncContext *s)
int XVMC_field_start (MpegEncContext *s, AVCodecContext *avctx)
int XVMC_field_end (MpegEncContext *s)
void XVMC_pack_pblocks (MpegEncContext *s, int cbp)
void XVMC_init_block (MpegEncContext *s)
static void init_2d_vlc_rl (RLTable *rl, int use_static)
void ff_mpeg12_common_init (MpegEncContext *s)
void ff_mpeg1_clean_buffers (MpegEncContext *s)
static void init_vlcs (void)
static int get_dmv (MpegEncContext *s)
static int get_qscale (MpegEncContext *s)
static int mpeg_decode_mb (MpegEncContext *s, DCTELEM block[12][64])
static int decode_dc (GetBitContext *gb, int component)
static int mpeg_decode_init (AVCodecContext *avctx)
static void quant_matrix_rebuild (uint16_t *matrix, const uint8_t *old_perm, const uint8_t *new_perm)
static int mpeg_decode_postinit (AVCodecContext *avctx)
static int mpeg1_decode_picture (AVCodecContext *avctx, const uint8_t *buf, int buf_size)
static void mpeg_decode_sequence_extension (Mpeg1Context *s1)
static void mpeg_decode_sequence_display_extension (Mpeg1Context *s1)
static void mpeg_decode_picture_display_extension (Mpeg1Context *s1)
static void mpeg_decode_quant_matrix_extension (MpegEncContext *s)
static void mpeg_decode_picture_coding_extension (MpegEncContext *s)
static void mpeg_decode_extension (AVCodecContext *avctx, const uint8_t *buf, int buf_size)
static int mpeg_field_start (MpegEncContext *s)
static int mpeg_decode_slice (Mpeg1Context *s1, int mb_y, const uint8_t **buf, int buf_size)
 decodes a slice.
static int slice_decode_thread (AVCodecContext *c, void *arg)
static int slice_end (AVCodecContext *avctx, AVFrame *pict)
 handles slice ends.
static int mpeg1_decode_sequence (AVCodecContext *avctx, const uint8_t *buf, int buf_size)
static int vcr2_init_sequence (AVCodecContext *avctx)
static void mpeg_decode_user_data (AVCodecContext *avctx, const uint8_t *buf, int buf_size)
static void mpeg_decode_gop (AVCodecContext *avctx, const uint8_t *buf, int buf_size)
int ff_mpeg1_find_frame_end (ParseContext *pc, const uint8_t *buf, int buf_size)
 finds the end of the current frame in the bitstream.
static int mpeg_decode_frame (AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
static int mpeg_decode_end (AVCodecContext *avctx)

Variables

static enum PixelFormat pixfmt_yuv_420 [] = {PIX_FMT_YUV420P,-1}
static enum PixelFormat pixfmt_yuv_422 [] = {PIX_FMT_YUV422P,-1}
static enum PixelFormat pixfmt_yuv_444 [] = {PIX_FMT_YUV444P,-1}
static enum PixelFormat pixfmt_xvmc_mpg2_420 []
uint8_t ff_mpeg12_static_rl_table_store [2][2][2 *MAX_RUN+MAX_LEVEL+3]
static VLC dc_lum_vlc
static VLC dc_chroma_vlc
static VLC mv_vlc
static VLC mbincr_vlc
static VLC mb_ptype_vlc
static VLC mb_btype_vlc
static VLC mb_pat_vlc
AVCodec mpeg1video_decoder
AVCodec mpeg2video_decoder
AVCodec mpegvideo_decoder


Detailed Description

MPEG1/2 decoder.

Definition in file mpeg12.c.


Define Documentation

#define DC_VLC_BITS   9

Definition at line 42 of file mpeg12.c.

#define DECODE_SLICE_ERROR   -1

Definition at line 1661 of file mpeg12.c.

#define DECODE_SLICE_OK   0

Definition at line 1662 of file mpeg12.c.

#define MB_BTYPE_VLC_BITS   6

Definition at line 47 of file mpeg12.c.

Referenced by init_vlcs(), and mpeg_decode_mb().

#define MB_PAT_VLC_BITS   9

Definition at line 45 of file mpeg12.c.

Referenced by init_vlcs(), and mpeg_decode_mb().

#define MB_PTYPE_VLC_BITS   6

Definition at line 46 of file mpeg12.c.

Referenced by init_vlcs(), and mpeg_decode_mb().

#define MBINCR_VLC_BITS   9

Definition at line 44 of file mpeg12.c.

Referenced by init_vlcs(), and mpeg_decode_slice().

#define MT_16X8   2

Definition at line 210 of file mpeg12.c.

#define MT_DMV   3

Definition at line 211 of file mpeg12.c.

Referenced by mpeg_decode_mb().

#define MT_FIELD   1

Definition at line 208 of file mpeg12.c.

Referenced by mpeg_decode_mb().

#define MT_FRAME   2

Definition at line 209 of file mpeg12.c.

Referenced by mpeg_decode_mb().

#define MV_VLC_BITS   9

Definition at line 43 of file mpeg12.c.

#define TEX_VLC_BITS   9

Definition at line 48 of file mpeg12.c.


Function Documentation

static int decode_dc ( GetBitContext gb,
int  component 
) [inline, static]

static void exchange_uv ( MpegEncContext s  )  [static]

Definition at line 1605 of file mpeg12.c.

Referenced by mpeg_decode_mb(), and vcr2_init_sequence().

void ff_mpeg12_common_init ( MpegEncContext s  ) 

Definition at line 125 of file mpeg12.c.

Referenced by ff_mpeg1_encode_init(), and mpeg_decode_init().

void ff_mpeg1_clean_buffers ( MpegEncContext s  ) 

Definition at line 133 of file mpeg12.c.

Referenced by encode_thread(), and mpeg_decode_slice().

int ff_mpeg1_find_frame_end ( ParseContext pc,
const uint8_t buf,
int  buf_size 
)

finds the end of the current frame in the bitstream.

Returns:
the position of the first byte of the next frame, or -1

Definition at line 2180 of file mpeg12.c.

Referenced by mpeg_decode_frame(), and mpegvideo_parse().

static int get_dmv ( MpegEncContext s  )  [inline, static]

Definition at line 189 of file mpeg12.c.

Referenced by mpeg_decode_mb().

static int get_qscale ( MpegEncContext s  )  [inline, static]

static void init_2d_vlc_rl ( RLTable rl,
int  use_static 
) [static]

Definition at line 83 of file mpeg12.c.

Referenced by init_vlcs().

static void init_vlcs ( void   )  [static]

Definition at line 152 of file mpeg12.c.

static int mpeg1_decode_block_inter ( MpegEncContext s,
DCTELEM block,
int  n 
) [inline, static]

Definition at line 714 of file mpeg12.c.

Referenced by mpeg_decode_mb().

static int mpeg1_decode_block_intra ( MpegEncContext s,
DCTELEM block,
int  n 
) [inline, static]

Definition at line 641 of file mpeg12.c.

Referenced by mpeg_decode_mb().

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

Definition at line 1350 of file mpeg12.c.

Referenced by mpeg_decode_frame().

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

Definition at line 1957 of file mpeg12.c.

Referenced by mpeg_decode_frame().

static int mpeg1_fast_decode_block_inter ( MpegEncContext s,
DCTELEM block,
int  n 
) [inline, static]

Definition at line 799 of file mpeg12.c.

Referenced by mpeg_decode_mb().

static int mpeg2_decode_block_intra ( MpegEncContext s,
DCTELEM block,
int  n 
) [inline, static]

Definition at line 1039 of file mpeg12.c.

Referenced by mpeg_decode_mb().

static int mpeg2_decode_block_non_intra ( MpegEncContext s,
DCTELEM block,
int  n 
) [inline, static]

Definition at line 879 of file mpeg12.c.

Referenced by mpeg_decode_mb().

static int mpeg2_fast_decode_block_intra ( MpegEncContext s,
DCTELEM block,
int  n 
) [inline, static]

Definition at line 1119 of file mpeg12.c.

Referenced by mpeg_decode_mb().

static int mpeg2_fast_decode_block_non_intra ( MpegEncContext s,
DCTELEM block,
int  n 
) [inline, static]

Definition at line 968 of file mpeg12.c.

Referenced by mpeg_decode_mb().

static int mpeg_decode_end ( AVCodecContext avctx  )  [static]

Definition at line 2395 of file mpeg12.c.

static void mpeg_decode_extension ( AVCodecContext avctx,
const uint8_t buf,
int  buf_size 
) [static]

Definition at line 1576 of file mpeg12.c.

Referenced by mpeg_decode_frame().

static int mpeg_decode_frame ( AVCodecContext avctx,
void *  data,
int *  data_size,
const uint8_t buf,
int  buf_size 
) [static]

Definition at line 2221 of file mpeg12.c.

static void mpeg_decode_gop ( AVCodecContext avctx,
const uint8_t buf,
int  buf_size 
) [static]

Definition at line 2146 of file mpeg12.c.

Referenced by mpeg_decode_frame().

static int mpeg_decode_init ( AVCodecContext avctx  )  [static]

Definition at line 1202 of file mpeg12.c.

static int mpeg_decode_mb ( MpegEncContext s,
DCTELEM  block[12][64] 
) [static]

Definition at line 213 of file mpeg12.c.

Referenced by mpeg_decode_slice().

static int mpeg_decode_motion ( MpegEncContext s,
int  fcode,
int  pred 
) [static]

Definition at line 590 of file mpeg12.c.

Referenced by mpeg_decode_mb().

static void mpeg_decode_picture_coding_extension ( MpegEncContext s  )  [static]

Definition at line 1528 of file mpeg12.c.

Referenced by mpeg_decode_extension().

static void mpeg_decode_picture_display_extension ( Mpeg1Context s1  )  [static]

Definition at line 1456 of file mpeg12.c.

Referenced by mpeg_decode_extension().

static int mpeg_decode_postinit ( AVCodecContext avctx  )  [static]

Definition at line 1243 of file mpeg12.c.

Referenced by mpeg1_decode_picture().

static void mpeg_decode_quant_matrix_extension ( MpegEncContext s  )  [static]

Definition at line 1490 of file mpeg12.c.

Referenced by mpeg_decode_extension().

static void mpeg_decode_sequence_display_extension ( Mpeg1Context s1  )  [static]

Definition at line 1432 of file mpeg12.c.

Referenced by mpeg_decode_extension().

static void mpeg_decode_sequence_extension ( Mpeg1Context s1  )  [static]

Definition at line 1396 of file mpeg12.c.

Referenced by mpeg_decode_extension().

static int mpeg_decode_slice ( Mpeg1Context s1,
int  mb_y,
const uint8_t **  buf,
int  buf_size 
) [static]

decodes a slice.

MpegEncContext.mb_y must be set to the MB row from the startcode

Returns:
DECODE_SLICE_ERROR if the slice is damaged
DECODE_SLICE_OK if this slice is ok

Definition at line 1669 of file mpeg12.c.

Referenced by mpeg_decode_frame(), and slice_decode_thread().

static void mpeg_decode_user_data ( AVCodecContext avctx,
const uint8_t buf,
int  buf_size 
) [static]

Definition at line 2117 of file mpeg12.c.

Referenced by mpeg_decode_frame().

static int mpeg_field_start ( MpegEncContext s  )  [static]

Definition at line 1611 of file mpeg12.c.

Referenced by mpeg_decode_frame().

static void quant_matrix_rebuild ( uint16_t *  matrix,
const uint8_t old_perm,
const uint8_t new_perm 
) [static]

Definition at line 1229 of file mpeg12.c.

static int slice_decode_thread ( AVCodecContext c,
void *  arg 
) [static]

Definition at line 1877 of file mpeg12.c.

Referenced by mpeg_decode_frame().

static int slice_end ( AVCodecContext avctx,
AVFrame pict 
) [static]

handles slice ends.

Returns:
1 if it seems to be the last slice of

Definition at line 1916 of file mpeg12.c.

Referenced by mpeg_decode_frame().

static int vcr2_init_sequence ( AVCodecContext avctx  )  [static]

Definition at line 2063 of file mpeg12.c.

Referenced by mpeg_decode_frame().

int XVMC_field_end ( MpegEncContext s  ) 

Referenced by MPV_frame_end(), and slice_end().

int XVMC_field_start ( MpegEncContext s,
AVCodecContext avctx 
)

Referenced by mpeg_field_start().

void XVMC_init_block ( MpegEncContext s  ) 

Referenced by mpeg_decode_slice().

void XVMC_pack_pblocks ( MpegEncContext s,
int  cbp 
)

Referenced by mpeg_decode_mb().


Variable Documentation

VLC dc_chroma_vlc [static]

Definition at line 145 of file mpeg12.c.

VLC dc_lum_vlc [static]

Definition at line 144 of file mpeg12.c.

uint8_t ff_mpeg12_static_rl_table_store[2][2][2 *MAX_RUN+MAX_LEVEL+3]

Definition at line 81 of file mpeg12.c.

Referenced by ff_mpeg1_encode_init(), and init_vlcs().

VLC mb_btype_vlc [static]

Definition at line 149 of file mpeg12.c.

VLC mb_pat_vlc [static]

Definition at line 150 of file mpeg12.c.

VLC mb_ptype_vlc [static]

Definition at line 148 of file mpeg12.c.

VLC mbincr_vlc [static]

Definition at line 147 of file mpeg12.c.

VLC mv_vlc [static]

Definition at line 146 of file mpeg12.c.

Initial value:

Definition at line 76 of file mpeg12.c.

Referenced by vcr2_init_sequence().

enum PixelFormat pixfmt_yuv_420[] = {PIX_FMT_YUV420P,-1} [static]

Definition at line 73 of file mpeg12.c.

Referenced by vcr2_init_sequence().

enum PixelFormat pixfmt_yuv_422[] = {PIX_FMT_YUV422P,-1} [static]

Definition at line 74 of file mpeg12.c.

enum PixelFormat pixfmt_yuv_444[] = {PIX_FMT_YUV444P,-1} [static]

Definition at line 75 of file mpeg12.c.


Generated on Sat Sep 6 21:24:33 2008 for ffmpeg by  doxygen 1.5.6