FFmpeg
Data Structures | Macros | Functions | Variables
eamad.c File Reference
#include "libavutil/mem_internal.h"
#include "avcodec.h"
#include "blockdsp.h"
#include "bytestream.h"
#include "bswapdsp.h"
#include "get_bits.h"
#include "aandcttab.h"
#include "eaidct.h"
#include "idctdsp.h"
#include "internal.h"
#include "mpeg12data.h"
#include "mpeg12vlc.h"

Go to the source code of this file.

Data Structures

struct  MadContext
 

Macros

#define EA_PREAMBLE_SIZE   8
 
#define MADk_TAG   MKTAG('M', 'A', 'D', 'k') /* MAD I-frame */
 
#define MADm_TAG   MKTAG('M', 'A', 'D', 'm') /* MAD P-frame */
 
#define MADe_TAG   MKTAG('M', 'A', 'D', 'e') /* MAD lqp-frame */
 

Functions

static av_cold int decode_init (AVCodecContext *avctx)
 
static void comp (unsigned char *dst, ptrdiff_t dst_stride, unsigned char *src, ptrdiff_t src_stride, int add)
 
static void comp_block (MadContext *t, AVFrame *frame, int mb_x, int mb_y, int j, int mv_x, int mv_y, int add)
 
static void idct_put (MadContext *t, AVFrame *frame, int16_t *block, int mb_x, int mb_y, int j)
 
static int decode_block_intra (MadContext *s, int16_t *block)
 
static int decode_motion (GetBitContext *gb)
 
static int decode_mb (MadContext *s, AVFrame *frame, int inter)
 
static void calc_quant_matrix (MadContext *s, int qscale)
 
static int decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int decode_end (AVCodecContext *avctx)
 

Variables

const AVCodec ff_eamad_decoder
 

Detailed Description

Electronic Arts Madcow Video Decoder

Author
Peter Ross pross.nosp@m.@xvi.nosp@m.d.org
See also
technical details at http://wiki.multimedia.cx/index.php?title=Electronic_Arts_MAD

Definition in file eamad.c.

Macro Definition Documentation

◆ EA_PREAMBLE_SIZE

#define EA_PREAMBLE_SIZE   8

Definition at line 45 of file eamad.c.

◆ MADk_TAG

#define MADk_TAG   MKTAG('M', 'A', 'D', 'k') /* MAD I-frame */

Definition at line 46 of file eamad.c.

◆ MADm_TAG

#define MADm_TAG   MKTAG('M', 'A', 'D', 'm') /* MAD P-frame */

Definition at line 47 of file eamad.c.

◆ MADe_TAG

#define MADe_TAG   MKTAG('M', 'A', 'D', 'e') /* MAD lqp-frame */

Definition at line 48 of file eamad.c.

Function Documentation

◆ decode_init()

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 66 of file eamad.c.

◆ comp()

static void comp ( unsigned char *  dst,
ptrdiff_t  dst_stride,
unsigned char *  src,
ptrdiff_t  src_stride,
int  add 
)
inlinestatic

◆ comp_block()

static void comp_block ( MadContext t,
AVFrame frame,
int  mb_x,
int  mb_y,
int  j,
int  mv_x,
int  mv_y,
int  add 
)
inlinestatic

Definition at line 94 of file eamad.c.

Referenced by decode_mb().

◆ idct_put()

static void idct_put ( MadContext t,
AVFrame frame,
int16_t *  block,
int  mb_x,
int  mb_y,
int  j 
)
inlinestatic

Definition at line 118 of file eamad.c.

Referenced by decode_mb().

◆ decode_block_intra()

static int decode_block_intra ( MadContext s,
int16_t *  block 
)
inlinestatic

Definition at line 133 of file eamad.c.

Referenced by decode_mb().

◆ decode_motion()

static int decode_motion ( GetBitContext gb)
static

Definition at line 199 of file eamad.c.

Referenced by decode_mb().

◆ decode_mb()

static int decode_mb ( MadContext s,
AVFrame frame,
int  inter 
)
static

Definition at line 210 of file eamad.c.

Referenced by decode_frame().

◆ calc_quant_matrix()

static void calc_quant_matrix ( MadContext s,
int  qscale 
)
static

Definition at line 240 of file eamad.c.

Referenced by decode_frame().

◆ decode_frame()

static int decode_frame ( AVCodecContext avctx,
void *  data,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 249 of file eamad.c.

◆ decode_end()

static av_cold int decode_end ( AVCodecContext avctx)
static

Definition at line 336 of file eamad.c.

Variable Documentation

◆ ff_eamad_decoder

const AVCodec ff_eamad_decoder
Initial value:
= {
.name = "eamad",
.long_name = NULL_IF_CONFIG_SMALL("Electronic Arts Madcow Video"),
.priv_data_size = sizeof(MadContext),
.close = decode_end,
.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
}

Definition at line 344 of file eamad.c.

FF_CODEC_CAP_INIT_THREADSAFE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: internal.h:42
init
static int init
Definition: av_tx.c:47
AV_CODEC_ID_MAD
@ AV_CODEC_ID_MAD
Definition: codec_id.h:179
MadContext
Definition: eamad.c:50
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:71
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
decode_end
static av_cold int decode_end(AVCodecContext *avctx)
Definition: eamad.c:336
decode_init
static av_cold int decode_init(AVCodecContext *avctx)
Definition: eamad.c:66
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
decode_frame
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: eamad.c:249