FFmpeg
Macros | Functions
intrax8.c File Reference

IntraX8 (J-Frame) subdecoder, used by WMV2 and VC-1. More...

#include "libavutil/avassert.h"
#include "avcodec.h"
#include "get_bits.h"
#include "idctdsp.h"
#include "msmpeg4data.h"
#include "intrax8huf.h"
#include "intrax8.h"
#include "intrax8dsp.h"
#include "mpegutils.h"

Macros

#define MAX_TABLE_DEPTH(table_bits, max_bits)   ((max_bits + table_bits - 1) / table_bits)
 
#define DC_VLC_BITS   9
 
#define AC_VLC_BITS   9
 
#define OR_VLC_BITS   7
 
#define DC_VLC_MTD   MAX_TABLE_DEPTH(DC_VLC_BITS, MAX_DC_VLC_BITS)
 
#define AC_VLC_MTD   MAX_TABLE_DEPTH(AC_VLC_BITS, MAX_AC_VLC_BITS)
 
#define OR_VLC_MTD   MAX_TABLE_DEPTH(OR_VLC_BITS, MAX_OR_VLC_BITS)
 
#define init_ac_vlc(dst, src)
 
#define init_dc_vlc(dst, src)
 
#define init_or_vlc(dst, src)
 
#define extra_bits(eb)   (eb)
 
#define extra_run   (0xFF << 8)
 
#define extra_level   (0x00 << 8)
 
#define run_offset(r)   ((r) << 16)
 
#define level_offset(l)   ((l) << 24)
 
#define B(x, y)   w->block[0][w->idct_permutation[(x) + (y) * 8]]
 
#define T(x)   ((x) * dc_level + 0x8000) >> 16;
 

Functions

av_cold int ff_intrax8_common_init (AVCodecContext *avctx, IntraX8Context *w, IDCTDSPContext *idsp, int16_t(*block)[64], int block_last_index[12], int mb_width, int mb_height)
 Initialize IntraX8 frame decoder. More...
 
av_cold void ff_intrax8_common_end (IntraX8Context *w)
 Destroy IntraX8 frame structure. More...
 
int ff_intrax8_decode_picture (IntraX8Context *w, Picture *pict, GetBitContext *gb, int *mb_x, int *mb_y, int dquant, int quant_offset, int loopfilter, int lowdelay)
 Decode single IntraX8 frame. More...
 

Detailed Description

IntraX8 (J-Frame) subdecoder, used by WMV2 and VC-1.

Macro Definition Documentation

§ init_ac_vlc

#define init_ac_vlc (   dst,
  src 
)
Value:
do { \
dst.table = &table[offset]; \
dst.table_allocated = sizes[sizeidx]; \
offset += sizes[sizeidx++]; \
init_vlc(&dst, AC_VLC_BITS, 77, &src[1], 4, 2, &src[0], 4, 2, \
INIT_VLC_USE_NEW_STATIC); \
} while(0)

§ init_dc_vlc

#define init_dc_vlc (   dst,
  src 
)
Value:
do { \
dst.table = &table[offset]; \
dst.table_allocated = sizes[sizeidx]; \
offset += sizes[sizeidx++]; \
init_vlc(&dst, DC_VLC_BITS, 34, &src[1], 4, 2, &src[0], 4, 2, \
INIT_VLC_USE_NEW_STATIC); \
} while(0)

§ init_or_vlc

#define init_or_vlc (   dst,
  src 
)
Value:
do { \
dst.table = &table[offset]; \
dst.table_allocated = sizes[sizeidx]; \
offset += sizes[sizeidx++]; \
init_vlc(&dst, OR_VLC_BITS, 12, &src[1], 4, 2, &src[0], 4, 2, \
INIT_VLC_USE_NEW_STATIC); \
} while(0)

Function Documentation

§ ff_intrax8_common_end()

av_cold void ff_intrax8_common_end ( IntraX8Context w)

Destroy IntraX8 frame structure.

Parameters
wpointer to IntraX8Context

§ ff_intrax8_common_init()

av_cold int ff_intrax8_common_init ( AVCodecContext avctx,
IntraX8Context w,
IDCTDSPContext idsp,
int16_t(*)  block[64],
int  block_last_index[12],
int  mb_width,
int  mb_height 
)

Initialize IntraX8 frame decoder.

Parameters
avctxpointer to AVCodecContext
wpointer to IntraX8Context
idsppointer to IDCTDSPContext
blockpointer to block array
block_last_indexpointer to index array
mb_widthmacroblock width
mb_heightmacroblock height
Returns
0 on success, a negative AVERROR value on error

§ ff_intrax8_decode_picture()

int ff_intrax8_decode_picture ( IntraX8Context w,
Picture pict,
GetBitContext gb,
int *  mb_x,
int *  mb_y,
int  quant,
int  halfpq,
int  loopfilter,
int  lowdelay 
)

Decode single IntraX8 frame.

lowres decoding is theoretically impossible.

Parameters
wpointer to IntraX8Context
pictthe output Picture containing an AVFrame
gbopen bitstream reader
mb_xpointer to the x coordinate of the current macroblock
mb_ypointer to the y coordinate of the current macroblock
dquantdoubled quantizer, it would be odd in case of VC-1 halfpq==1.
quant_offsetoffset away from zero
loopfilterenable filter after decoding a block