FFmpeg
Data Structures | Macros | Functions | Variables
mv30.c File Reference
#include <stddef.h>
#include <string.h>
#include "libavutil/thread.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "copy_block.h"
#include "decode.h"
#include "mathops.h"
#include "blockdsp.h"
#include "get_bits.h"
#include "aandcttab.h"

Go to the source code of this file.

Data Structures

struct  MV30Context
 

Macros

#define CBP_VLC_BITS   9
 

Functions

static void get_qtable (int16_t *table, int quant, const uint8_t *quant_tab)
 
static void idct_1d (unsigned *blk, int step)
 
static void idct_put (uint8_t *dst, int stride, int *block)
 
static void idct_add (uint8_t *dst, int stride, const uint8_t *src, int in_linesize, int *block)
 
static void idct2_1d (int *blk, int step)
 
static void idct2_put (uint8_t *dst, int stride, int *block)
 
static void idct2_add (uint8_t *dst, int stride, const uint8_t *src, int in_linesize, int *block)
 
static void update_inter_block (uint8_t *dst, int stride, const uint8_t *src, int in_linesize, int block)
 
static int decode_intra_block (AVCodecContext *avctx, int mode, GetByteContext *gbyte, int16_t *qtab, int *block, int *pfill, uint8_t *dst, int linesize)
 
static int decode_inter_block (AVCodecContext *avctx, int mode, GetByteContext *gbyte, int16_t *qtab, int *block, int *pfill, uint8_t *dst, int linesize, const uint8_t *src, int in_linesize)
 
static int decode_coeffs (GetBitContext *gb, int16_t *coeffs, int nb_codes)
 
static int decode_intra (AVCodecContext *avctx, GetBitContext *gb, AVFrame *frame)
 
static int decode_inter (AVCodecContext *avctx, GetBitContext *gb, AVFrame *frame, AVFrame *prev)
 
static int decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
 
static av_cold void init_static_data (void)
 
static av_cold int decode_init (AVCodecContext *avctx)
 
static void decode_flush (AVCodecContext *avctx)
 
static av_cold int decode_close (AVCodecContext *avctx)
 

Variables

static VLCElem cbp_tab [1<< CBP_VLC_BITS]
 
static const uint8_t luma_tab []
 
static const uint8_t chroma_tab []
 
static const uint8_t zigzag []
 
static const uint8_t cbp_bits []
 
const FFCodec ff_mv30_decoder
 

Macro Definition Documentation

◆ CBP_VLC_BITS

#define CBP_VLC_BITS   9

Definition at line 38 of file mv30.c.

Function Documentation

◆ get_qtable()

static void get_qtable ( int16_t *  table,
int  quant,
const uint8_t *  quant_tab 
)
static

Definition at line 97 of file mv30.c.

Referenced by decode_frame().

◆ idct_1d()

static void idct_1d ( unsigned *  blk,
int  step 
)
inlinestatic

Definition at line 107 of file mv30.c.

Referenced by idct_add(), and idct_put().

◆ idct_put()

static void idct_put ( uint8_t *  dst,
int  stride,
int block 
)
static

Definition at line 137 of file mv30.c.

Referenced by decode_intra_block().

◆ idct_add()

static void idct_add ( uint8_t *  dst,
int  stride,
const uint8_t *  src,
int  in_linesize,
int block 
)
static

◆ idct2_1d()

static void idct2_1d ( int blk,
int  step 
)
inlinestatic

Definition at line 201 of file mv30.c.

Referenced by idct2_add(), and idct2_put().

◆ idct2_put()

static void idct2_put ( uint8_t *  dst,
int  stride,
int block 
)
static

Definition at line 220 of file mv30.c.

Referenced by decode_intra_block().

◆ idct2_add()

static void idct2_add ( uint8_t *  dst,
int  stride,
const uint8_t *  src,
int  in_linesize,
int block 
)
static

Definition at line 250 of file mv30.c.

Referenced by decode_inter_block().

◆ update_inter_block()

static void update_inter_block ( uint8_t *  dst,
int  stride,
const uint8_t *  src,
int  in_linesize,
int  block 
)
static

Definition at line 283 of file mv30.c.

Referenced by decode_inter_block().

◆ decode_intra_block()

static int decode_intra_block ( AVCodecContext avctx,
int  mode,
GetByteContext gbyte,
int16_t *  qtab,
int block,
int pfill,
uint8_t *  dst,
int  linesize 
)
static

Definition at line 295 of file mv30.c.

Referenced by decode_inter(), and decode_intra().

◆ decode_inter_block()

static int decode_inter_block ( AVCodecContext avctx,
int  mode,
GetByteContext gbyte,
int16_t *  qtab,
int block,
int pfill,
uint8_t *  dst,
int  linesize,
const uint8_t *  src,
int  in_linesize 
)
static

Definition at line 336 of file mv30.c.

Referenced by decode_inter().

◆ decode_coeffs()

static int decode_coeffs ( GetBitContext gb,
int16_t *  coeffs,
int  nb_codes 
)
static

Definition at line 377 of file mv30.c.

Referenced by decode_inter(), and decode_intra().

◆ decode_intra()

static int decode_intra ( AVCodecContext avctx,
GetBitContext gb,
AVFrame frame 
)
static

Definition at line 403 of file mv30.c.

Referenced by decode_frame().

◆ decode_inter()

static int decode_inter ( AVCodecContext avctx,
GetBitContext gb,
AVFrame frame,
AVFrame prev 
)
static

Definition at line 462 of file mv30.c.

Referenced by decode_frame().

◆ decode_frame()

static int decode_frame ( AVCodecContext avctx,
AVFrame frame,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 603 of file mv30.c.

◆ init_static_data()

static av_cold void init_static_data ( void  )
static

Definition at line 658 of file mv30.c.

Referenced by av_codec_init_static(), and decode_init().

◆ decode_init()

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 665 of file mv30.c.

◆ decode_flush()

static void decode_flush ( AVCodecContext avctx)
static

Definition at line 684 of file mv30.c.

◆ decode_close()

static av_cold int decode_close ( AVCodecContext avctx)
static

Definition at line 691 of file mv30.c.

Variable Documentation

◆ cbp_tab

VLCElem cbp_tab[1<< CBP_VLC_BITS]
static

Definition at line 62 of file mv30.c.

Referenced by decode_coeffs(), and init_static_data().

◆ luma_tab

const uint8_t luma_tab[]
static
Initial value:
= {
12, 12, 15, 19, 25, 34, 40, 48,
12, 12, 18, 22, 27, 44, 47, 46,
17, 18, 21, 26, 35, 46, 52, 47,
18, 20, 24, 28, 40, 61, 59, 51,
20, 24, 32, 43, 50, 72, 72, 63,
25, 31, 42, 48, 58, 72, 81, 75,
38, 46, 54, 61, 71, 84, 88, 85,
50, 61, 65, 68, 79, 78, 86, 91,
}

Definition at line 64 of file mv30.c.

Referenced by decode_frame().

◆ chroma_tab

const uint8_t chroma_tab[]
static
Initial value:
= {
12, 16, 24, 47, 99, 99, 99, 99,
16, 21, 26, 66, 99, 99, 99, 99,
24, 26, 56, 99, 99, 99, 99, 99,
47, 66, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
}

Definition at line 75 of file mv30.c.

Referenced by decode_frame().

◆ zigzag

const uint8_t zigzag[]
static
Initial value:
= {
0, 1, 8, 9, 16, 2, 3, 10,
17, 24, 32, 25, 18, 11, 4, 5,
12, 19, 26, 33, 40, 48, 41, 34,
27, 20, 13, 6, 7, 14, 21, 28,
35, 42, 49, 56, 57, 50, 43, 36,
29, 22, 15, 23, 30, 37, 44, 51,
58, 59, 52, 45, 38, 31, 39, 46,
53, 60, 61, 54, 47, 55, 62, 63,
}

Definition at line 86 of file mv30.c.

Referenced by decode_inter_block(), and decode_intra_block().

◆ cbp_bits

const uint8_t cbp_bits[]
static
Initial value:
= {
2, 2, 3, 3, 3, 4, 5, 6, 7, 8, 9, 9,
}

Definition at line 654 of file mv30.c.

Referenced by init_static_data().

◆ ff_mv30_decoder

const FFCodec ff_mv30_decoder
Initial value:
= {
.p.name = "mv30",
CODEC_LONG_NAME("MidiVid 3.0"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(MV30Context),
.close = decode_close,
.flush = decode_flush,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 704 of file mv30.c.

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:42
AV_CODEC_ID_MV30
@ AV_CODEC_ID_MV30
Definition: codec_id.h:301
decode_frame
static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
Definition: mv30.c:603
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:287
decode_flush
static void decode_flush(AVCodecContext *avctx)
Definition: mv30.c:684
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
MV30Context
Definition: mv30.c:40
decode_close
static av_cold int decode_close(AVCodecContext *avctx)
Definition: mv30.c:691
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:365
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
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
decode_init
static av_cold int decode_init(AVCodecContext *avctx)
Definition: mv30.c:665