FFmpeg
Functions | Variables
msmpeg4enc.c File Reference
#include <stdint.h>
#include <string.h>
#include "libavutil/attributes.h"
#include "libavutil/avutil.h"
#include "libavutil/thread.h"
#include "codec_internal.h"
#include "mpegvideo.h"
#include "mpegvideoenc.h"
#include "h263.h"
#include "h263data.h"
#include "mpeg4video.h"
#include "msmpeg4.h"
#include "msmpeg4data.h"
#include "msmpeg4_vc1_data.h"
#include "msmpeg4enc.h"
#include "put_bits.h"
#include "rl.h"

Go to the source code of this file.

Functions

static av_cold void init_mv_table (MVTable *tab, uint16_t table_mv_index[4096])
 
void ff_msmpeg4_code012 (PutBitContext *pb, int n)
 
static int get_size_of_code (const RLTable *rl, int last, int run, int level, int intra)
 
static av_cold void msmpeg4_encode_init_static (void)
 
av_cold void ff_msmpeg4_encode_init (MpegEncContext *s)
 
static void find_best_tables (MSMPEG4EncContext *ms)
 
void ff_msmpeg4_encode_picture_header (MpegEncContext *s)
 
void ff_msmpeg4_encode_ext_header (MpegEncContext *s)
 
void ff_msmpeg4_encode_motion (MpegEncContext *s, int mx, int my)
 
void ff_msmpeg4_handle_slices (MpegEncContext *s)
 
static void msmpeg4v2_encode_motion (MpegEncContext *s, int val)
 
void ff_msmpeg4_encode_mb (MpegEncContext *s, int16_t block[6][64], int motion_x, int motion_y)
 
static void msmpeg4_encode_dc (MpegEncContext *s, int level, int n, int *dir_ptr)
 
void ff_msmpeg4_encode_block (MpegEncContext *s, int16_t *block, int n)
 

Variables

static uint8_t rl_length [NB_RL_TABLES][MAX_LEVEL+1][MAX_RUN+1][2]
 
const FFCodec ff_msmpeg4v2_encoder
 
const FFCodec ff_msmpeg4v3_encoder
 
const FFCodec ff_wmv1_encoder
 

Detailed Description

MSMPEG4 encoder backend

Definition in file msmpeg4enc.c.

Function Documentation

◆ init_mv_table()

static av_cold void init_mv_table ( MVTable tab,
uint16_t  table_mv_index[4096] 
)
static

Definition at line 52 of file msmpeg4enc.c.

Referenced by msmpeg4_encode_init_static().

◆ ff_msmpeg4_code012()

void ff_msmpeg4_code012 ( PutBitContext pb,
int  n 
)

Definition at line 69 of file msmpeg4enc.c.

Referenced by ff_msmpeg4_encode_picture_header(), and ff_wmv2_encode_picture_header().

◆ get_size_of_code()

static int get_size_of_code ( const RLTable rl,
int  last,
int  run,
int  level,
int  intra 
)
static

Definition at line 78 of file msmpeg4enc.c.

Referenced by msmpeg4_encode_init_static().

◆ msmpeg4_encode_init_static()

static av_cold void msmpeg4_encode_init_static ( void  )
static

Definition at line 121 of file msmpeg4enc.c.

Referenced by ff_msmpeg4_encode_init().

◆ ff_msmpeg4_encode_init()

av_cold void ff_msmpeg4_encode_init ( MpegEncContext s)

Definition at line 138 of file msmpeg4enc.c.

Referenced by ff_mpv_encode_init().

◆ find_best_tables()

static void find_best_tables ( MSMPEG4EncContext ms)
static

Definition at line 152 of file msmpeg4enc.c.

Referenced by ff_msmpeg4_encode_picture_header().

◆ ff_msmpeg4_encode_picture_header()

void ff_msmpeg4_encode_picture_header ( MpegEncContext s)

Definition at line 218 of file msmpeg4enc.c.

Referenced by encode_picture().

◆ ff_msmpeg4_encode_ext_header()

void ff_msmpeg4_encode_ext_header ( MpegEncContext s)

Definition at line 280 of file msmpeg4enc.c.

Referenced by encode_thread(), and ff_msmpeg4_encode_picture_header().

◆ ff_msmpeg4_encode_motion()

void ff_msmpeg4_encode_motion ( MpegEncContext s,
int  mx,
int  my 
)

Definition at line 306 of file msmpeg4enc.c.

Referenced by ff_msmpeg4_encode_mb(), and ff_wmv2_encode_mb().

◆ ff_msmpeg4_handle_slices()

void ff_msmpeg4_handle_slices ( MpegEncContext s)

Definition at line 339 of file msmpeg4enc.c.

Referenced by ff_msmpeg4_encode_mb(), and ff_wmv2_encode_mb().

◆ msmpeg4v2_encode_motion()

static void msmpeg4v2_encode_motion ( MpegEncContext s,
int  val 
)
static

Definition at line 352 of file msmpeg4enc.c.

Referenced by ff_msmpeg4_encode_mb().

◆ ff_msmpeg4_encode_mb()

void ff_msmpeg4_encode_mb ( MpegEncContext s,
int16_t  block[6][64],
int  motion_x,
int  motion_y 
)

Definition at line 385 of file msmpeg4enc.c.

Referenced by encode_mb_internal().

◆ msmpeg4_encode_dc()

static void msmpeg4_encode_dc ( MpegEncContext s,
int  level,
int  n,
int *  dir_ptr 
)
static

Definition at line 508 of file msmpeg4enc.c.

Referenced by ff_msmpeg4_encode_block().

◆ ff_msmpeg4_encode_block()

void ff_msmpeg4_encode_block ( MpegEncContext s,
int16_t *  block,
int  n 
)

Definition at line 560 of file msmpeg4enc.c.

Referenced by ff_msmpeg4_encode_mb(), and ff_wmv2_encode_mb().

Variable Documentation

◆ rl_length

uint8_t rl_length[NB_RL_TABLES][MAX_LEVEL+1][MAX_RUN+1][2]
static

Definition at line 49 of file msmpeg4enc.c.

Referenced by find_best_tables(), and msmpeg4_encode_init_static().

◆ ff_msmpeg4v2_encoder

const FFCodec ff_msmpeg4v2_encoder
Initial value:
= {
.p.name = "msmpeg4v2",
CODEC_LONG_NAME("MPEG-4 part 2 Microsoft variant version 2"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
.color_ranges = AVCOL_RANGE_MPEG,
.p.priv_class = &ff_mpv_enc_class,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.priv_data_size = sizeof(MSMPEG4EncContext),
}

Definition at line 678 of file msmpeg4enc.c.

◆ ff_msmpeg4v3_encoder

const FFCodec ff_msmpeg4v3_encoder
Initial value:
= {
.p.name = "msmpeg4",
CODEC_LONG_NAME("MPEG-4 part 2 Microsoft variant version 3"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
.color_ranges = AVCOL_RANGE_MPEG,
.p.priv_class = &ff_mpv_enc_class,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.priv_data_size = sizeof(MSMPEG4EncContext),
}

Definition at line 694 of file msmpeg4enc.c.

◆ ff_wmv1_encoder

const FFCodec ff_wmv1_encoder
Initial value:
= {
.p.name = "wmv1",
CODEC_LONG_NAME("Windows Media Video 7"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
.color_ranges = AVCOL_RANGE_MPEG,
.p.priv_class = &ff_mpv_enc_class,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.priv_data_size = sizeof(MSMPEG4EncContext),
}

Definition at line 710 of file msmpeg4enc.c.

AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
ff_mpv_enc_class
const AVClass ff_mpv_enc_class
Definition: mpegvideo_enc.c:105
FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: codec_internal.h:43
ff_mpv_encode_picture
int ff_mpv_encode_picture(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pic_arg, int *got_packet)
Definition: mpegvideo_enc.c:1793
AV_CODEC_ID_MSMPEG4V2
@ AV_CODEC_ID_MSMPEG4V2
Definition: codec_id.h:67
FF_CODEC_ENCODE_CB
#define FF_CODEC_ENCODE_CB(func)
Definition: codec_internal.h:320
AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
Definition: codec.h:159
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:73
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
ff_mpv_encode_end
av_cold int ff_mpv_encode_end(AVCodecContext *avctx)
Definition: mpegvideo_enc.c:1028
AV_CODEC_ID_WMV1
@ AV_CODEC_ID_WMV1
Definition: codec_id.h:69
MSMPEG4EncContext
Definition: msmpeg4enc.h:29
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
AVCOL_RANGE_MPEG
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition: pixfmt.h:679
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
ff_mpv_encode_init
av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
Definition: mpegvideo_enc.c:351
AV_CODEC_ID_MSMPEG4V3
@ AV_CODEC_ID_MSMPEG4V3
Definition: codec_id.h:68