FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
mpeg12.c File Reference

MPEG-1/2 decoder. More...

#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
#include "libavutil/timecode.h"
#include "internal.h"
#include "avcodec.h"
#include "mpegvideo.h"
#include "error_resilience.h"
#include "mpeg12.h"
#include "mpeg12data.h"
#include "mpegvideodata.h"
#include "bytestream.h"
#include "vdpau_internal.h"
#include "thread.h"

Go to the source code of this file.

Macros

#define UNCHECKED_BITSTREAM_READER   1
 
#define INIT_2D_VLC_RL(rl, static_size)
 

Functions

static av_cold void init_2d_vlc_rl (RLTable *rl, unsigned static_size)
 
av_cold void ff_mpeg12_common_init (MpegEncContext *s)
 
void ff_mpeg1_clean_buffers (MpegEncContext *s)
 
av_cold void ff_mpeg12_init_vlcs (void)
 
int ff_mpeg1_find_frame_end (ParseContext *pc, const uint8_t *buf, int buf_size, AVCodecParserContext *s)
 Find the end of the current frame in the bitstream. More...
 

Variables

uint8_t ff_mpeg12_static_rl_table_store [2][2][2 *MAX_RUN+MAX_LEVEL+3]
 
static const uint8_t table_mb_ptype [7][2]
 
static const uint8_t table_mb_btype [11][2]
 
VLC ff_mv_vlc
 
VLC ff_dc_lum_vlc
 
VLC ff_dc_chroma_vlc
 
VLC ff_mbincr_vlc
 
VLC ff_mb_ptype_vlc
 
VLC ff_mb_btype_vlc
 
VLC ff_mb_pat_vlc
 

Detailed Description

MPEG-1/2 decoder.

Definition in file mpeg12.c.

Macro Definition Documentation

#define UNCHECKED_BITSTREAM_READER   1

Definition at line 28 of file mpeg12.c.

#define INIT_2D_VLC_RL (   rl,
  static_size 
)
Value:
{\
static RL_VLC_ELEM rl_vlc_table[static_size];\
rl.rl_vlc[0] = rl_vlc_table;\
init_2d_vlc_rl(&rl, static_size);\
}
static av_cold void init_2d_vlc_rl(RLTable *rl, unsigned static_size)
Definition: mpeg12.c:78

Definition at line 71 of file mpeg12.c.

Referenced by ff_mpeg12_init_vlcs().

Function Documentation

static av_cold void init_2d_vlc_rl ( RLTable rl,
unsigned  static_size 
)
static

Definition at line 78 of file mpeg12.c.

av_cold void ff_mpeg12_common_init ( MpegEncContext s)

Definition at line 115 of file mpeg12.c.

Referenced by ff_mpeg1_encode_init(), and mpeg_decode_init().

void ff_mpeg1_clean_buffers ( MpegEncContext s)

Definition at line 123 of file mpeg12.c.

Referenced by encode_thread(), and mpeg_decode_slice().

av_cold void ff_mpeg12_init_vlcs ( void  )

Definition at line 145 of file mpeg12.c.

Referenced by decode_init(), mpeg_decode_init(), and tqi_decode_init().

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

Find 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 186 of file mpeg12.c.

Referenced by mpeg_decode_frame(), and mpegvideo_parse().

Variable Documentation

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

Definition at line 45 of file mpeg12.c.

Referenced by ff_mpeg12_init_vlcs(), and ff_mpeg1_encode_init().

const uint8_t table_mb_ptype[7][2]
static
Initial value:
= {
{ 3, 5 },
{ 1, 2 },
{ 1, 3 },
{ 1, 1 },
{ 1, 6 },
{ 1, 5 },
{ 2, 5 },
}

Definition at line 47 of file mpeg12.c.

Referenced by ff_mpeg12_init_vlcs().

const uint8_t table_mb_btype[11][2]
static
Initial value:
= {
{ 3, 5 },
{ 2, 3 },
{ 3, 3 },
{ 2, 4 },
{ 3, 4 },
{ 2, 2 },
{ 3, 2 },
{ 1, 6 },
{ 2, 6 },
{ 3, 6 },
{ 2, 5 },
}

Definition at line 57 of file mpeg12.c.

Referenced by ff_mpeg12_init_vlcs().

VLC ff_mv_vlc

Definition at line 135 of file mpeg12.c.

Referenced by mpeg_decode_motion().

VLC ff_dc_lum_vlc

Definition at line 137 of file mpeg12.c.

VLC ff_dc_chroma_vlc

Definition at line 138 of file mpeg12.c.

VLC ff_mbincr_vlc

Definition at line 140 of file mpeg12.c.

Referenced by mpeg_decode_slice().

VLC ff_mb_ptype_vlc

Definition at line 141 of file mpeg12.c.

Referenced by mpeg_decode_mb().

VLC ff_mb_btype_vlc

Definition at line 142 of file mpeg12.c.

Referenced by mpeg_decode_mb().

VLC ff_mb_pat_vlc

Definition at line 143 of file mpeg12.c.

Referenced by mpeg_decode_mb().