libavcodec/mpeg12enc.c File Reference

MPEG1/2 encoder. More...

#include "avcodec.h"
#include "dsputil.h"
#include "mathops.h"
#include "mpegvideo.h"
#include "mpeg12.h"
#include "mpeg12data.h"
#include "bytestream.h"

Go to the source code of this file.

Functions

static void mpeg1_encode_block (MpegEncContext *s, DCTELEM *block, int component)
static void mpeg1_encode_motion (MpegEncContext *s, int val, int f_or_b_code)
static void init_uni_ac_vlc (RLTable *rl, uint8_t *uni_ac_vlc_len)
static int find_frame_rate_index (MpegEncContext *s)
static av_cold int encode_init (AVCodecContext *avctx)
static void put_header (MpegEncContext *s, int header)
static void mpeg1_encode_sequence_header (MpegEncContext *s)
static void encode_mb_skip_run (MpegEncContext *s, int run)
static av_always_inline void put_qscale (MpegEncContext *s)
void ff_mpeg1_encode_slice_header (MpegEncContext *s)
void mpeg1_encode_picture_header (MpegEncContext *s, int picture_number)
static void put_mb_modes (MpegEncContext *s, int n, int bits, int has_mv, int field_motion)
static av_always_inline void mpeg1_encode_mb_internal (MpegEncContext *s, DCTELEM block[6][64], int motion_x, int motion_y, int mb_block_count)
void mpeg1_encode_mb (MpegEncContext *s, DCTELEM block[6][64], int motion_x, int motion_y)
void ff_mpeg1_encode_init (MpegEncContext *s)
static void encode_dc (MpegEncContext *s, int diff, int component)

Variables

static const uint8_t inv_non_linear_qscale [13]
static const uint8_t svcd_scan_offset_placeholder [14]
static uint8_t mv_penalty [MAX_FCODE+1][MAX_MV *2+1]
static uint8_t fcode_tab [MAX_MV *2+1]
static uint8_t uni_mpeg1_ac_vlc_len [64 *64 *2]
static uint8_t uni_mpeg2_ac_vlc_len [64 *64 *2]
static uint32_t mpeg1_lum_dc_uni [512]
static uint32_t mpeg1_chr_dc_uni [512]
static uint8_t mpeg1_index_run [2][64]
static int8_t mpeg1_max_level [2][64]
AVCodec ff_mpeg1video_encoder
AVCodec ff_mpeg2video_encoder


Detailed Description

MPEG1/2 encoder.

Definition in file mpeg12enc.c.


Function Documentation

static void encode_dc ( MpegEncContext s,
int  diff,
int  component 
) [inline, static]

Definition at line 811 of file mpeg12enc.c.

Referenced by mpeg1_encode_block().

static av_cold int encode_init ( AVCodecContext avctx  )  [static]

Definition at line 137 of file mpeg12enc.c.

static void encode_mb_skip_run ( MpegEncContext s,
int  run 
) [inline, static]

Definition at line 311 of file mpeg12enc.c.

Referenced by mpeg1_encode_mb_internal().

void ff_mpeg1_encode_init ( MpegEncContext s  ) 

Definition at line 713 of file mpeg12enc.c.

Referenced by MPV_encode_init().

void ff_mpeg1_encode_slice_header ( MpegEncContext s  ) 

Definition at line 330 of file mpeg12enc.c.

Referenced by encode_thread(), and mpeg1_encode_picture_header().

static int find_frame_rate_index ( MpegEncContext s  )  [static]

Definition at line 115 of file mpeg12enc.c.

Referenced by encode_init().

static void init_uni_ac_vlc ( RLTable rl,
uint8_t *  uni_ac_vlc_len 
) [static]

Definition at line 69 of file mpeg12enc.c.

Referenced by ff_mpeg1_encode_init().

static void mpeg1_encode_block ( MpegEncContext s,
DCTELEM block,
int  component 
) [static]

Definition at line 848 of file mpeg12enc.c.

Referenced by mpeg1_encode_mb_internal().

void mpeg1_encode_mb ( MpegEncContext s,
DCTELEM  block[6][64],
int  motion_x,
int  motion_y 
)

Definition at line 666 of file mpeg12enc.c.

Referenced by encode_mb_internal().

static av_always_inline void mpeg1_encode_mb_internal ( MpegEncContext s,
DCTELEM  block[6][64],
int  motion_x,
int  motion_y,
int  mb_block_count 
) [static]

Definition at line 441 of file mpeg12enc.c.

Referenced by mpeg1_encode_mb().

static void mpeg1_encode_motion ( MpegEncContext s,
int  val,
int  f_or_b_code 
) [static]

Definition at line 673 of file mpeg12enc.c.

Referenced by mpeg1_encode_mb_internal().

void mpeg1_encode_picture_header ( MpegEncContext s,
int  picture_number 
)

Definition at line 341 of file mpeg12enc.c.

Referenced by encode_picture().

static void mpeg1_encode_sequence_header ( MpegEncContext s  )  [static]

Definition at line 192 of file mpeg12enc.c.

Referenced by mpeg1_encode_picture_header().

static void put_header ( MpegEncContext s,
int  header 
) [static]

static void put_mb_modes ( MpegEncContext s,
int  n,
int  bits,
int  has_mv,
int  field_motion 
) [inline, static]

Definition at line 430 of file mpeg12enc.c.

Referenced by mpeg1_encode_mb_internal().

static av_always_inline void put_qscale ( MpegEncContext s  )  [static]

Definition at line 320 of file mpeg12enc.c.

Referenced by ff_mpeg1_encode_slice_header(), and mpeg1_encode_mb_internal().


Variable Documentation

uint8_t fcode_tab[MAX_MV *2+1] [static]

Definition at line 57 of file mpeg12enc.c.

Initial value:

 {
    "mpeg1video",
    AVMEDIA_TYPE_VIDEO,
    CODEC_ID_MPEG1VIDEO,
    sizeof(MpegEncContext),
    encode_init,
    MPV_encode_picture,
    MPV_encode_end,
    .supported_framerates= ff_frame_rate_tab+1,
    .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
    .capabilities= CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
    .long_name= NULL_IF_CONFIG_SMALL("MPEG-1 video"),
}

Definition at line 928 of file mpeg12enc.c.

Initial value:

 {
    "mpeg2video",
    AVMEDIA_TYPE_VIDEO,
    CODEC_ID_MPEG2VIDEO,
    sizeof(MpegEncContext),
    encode_init,
    MPV_encode_picture,
    MPV_encode_end,
    .supported_framerates= ff_frame_rate_tab+1,
    .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_NONE},
    .capabilities= CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
    .long_name= NULL_IF_CONFIG_SMALL("MPEG-2 video"),
}

Definition at line 942 of file mpeg12enc.c.

const uint8_t inv_non_linear_qscale[13] [static]

Initial value:

 {
    0, 2, 4, 6, 8,
    9,10,11,12,13,14,15,16,
}

Definition at line 38 of file mpeg12enc.c.

Referenced by put_qscale().

uint32_t mpeg1_chr_dc_uni[512] [static]

Definition at line 64 of file mpeg12enc.c.

Referenced by encode_dc(), and ff_mpeg1_encode_init().

uint8_t mpeg1_index_run[2][64] [static]

Definition at line 66 of file mpeg12enc.c.

Referenced by ff_mpeg1_encode_init(), and mpeg1_encode_block().

uint32_t mpeg1_lum_dc_uni[512] [static]

Definition at line 63 of file mpeg12enc.c.

Referenced by encode_dc(), and ff_mpeg1_encode_init().

int8_t mpeg1_max_level[2][64] [static]

Definition at line 67 of file mpeg12enc.c.

Referenced by ff_mpeg1_encode_init(), and mpeg1_encode_block().

uint8_t mv_penalty[MAX_FCODE+1][MAX_MV *2+1] [static]

Definition at line 56 of file mpeg12enc.c.

const uint8_t svcd_scan_offset_placeholder[14] [static]

Initial value:

 {
    0x10, 0x0E,
    0x00, 0x80, 0x81,
    0x00, 0x80, 0x81,
    0xff, 0xff, 0xff,
    0xff, 0xff, 0xff,
}

Definition at line 43 of file mpeg12enc.c.

Referenced by mpeg1_encode_picture_header().

uint8_t uni_mpeg1_ac_vlc_len[64 *64 *2] [static]

Definition at line 59 of file mpeg12enc.c.

Referenced by ff_mpeg1_encode_init().

uint8_t uni_mpeg2_ac_vlc_len[64 *64 *2] [static]

Definition at line 60 of file mpeg12enc.c.

Referenced by ff_mpeg1_encode_init().


Generated on Fri Oct 26 02:39:45 2012 for FFmpeg by  doxygen 1.5.8