mpegaudiodec.c File Reference


Detailed Description

MPEG Audio decoder.

Definition in file mpegaudiodec.c.

Go to the source code of this file.

Classes

struct  MP3On4DecodeContext
 Context for MP3On4 decoder. More...
struct  GranuleDef

Functions

static void compute_antialias_integer (MPADecodeContext *s, GranuleDef *g)
static void compute_antialias_float (MPADecodeContext *s, GranuleDef *g)
static DECLARE_ALIGNED_16 (MPA_INT, window[512])
static int l1_unscale (int n, int mant, int scale_factor)
static int l2_unscale_group (int steps, int mant, int scale_factor)
static int l3_unscale (int value, int exponent)
static void int_pow_init (void)
static int int_pow (int i, int *exp_ptr)
static int decode_init (AVCodecContext *avctx)
static void dct32 (int32_t *out, int32_t *tab)
static int round_sample (int *sum)
static int round_sample (int64_t *sum)
void ff_mpa_synth_init (MPA_INT *window)
void ff_mpa_synth_filter (MPA_INT *synth_buf_ptr, int *synth_buf_offset, MPA_INT *window, int *dither_state, OUT_INT *samples, int incr, int32_t sb_samples[SBLIMIT])
static void imdct12 (int *out, int *in)
static void imdct36 (int *out, int *buf, int *in, int *win)
static int mp_decode_layer1 (MPADecodeContext *s)
static int mp_decode_layer2 (MPADecodeContext *s)
static void lsf_sf_expand (int *slen, int sf, int n1, int n2, int n3)
static void exponents_from_scale_factors (MPADecodeContext *s, GranuleDef *g, int16_t *exponents)
static int get_bitsz (GetBitContext *s, int n)
static void switch_buffer (MPADecodeContext *s, int *pos, int *end_pos, int *end_pos2)
static int huffman_decode (MPADecodeContext *s, GranuleDef *g, int16_t *exponents, int end_pos2)
static void reorder_block (MPADecodeContext *s, GranuleDef *g)
static void compute_stereo (MPADecodeContext *s, GranuleDef *g0, GranuleDef *g1)
static void compute_imdct (MPADecodeContext *s, GranuleDef *g, int32_t *sb_samples, int32_t *mdct_buf)
void sample_dump (int fnum, int32_t *tab, int n)
static int mp_decode_layer3 (MPADecodeContext *s)
static int mp_decode_frame (MPADecodeContext *s, OUT_INT *samples, const uint8_t *buf, int buf_size)
static int decode_frame (AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
static void flush (AVCodecContext *avctx)
static int decode_frame_adu (AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
static int decode_init_mp3on4 (AVCodecContext *avctx)
static int decode_close_mp3on4 (AVCodecContext *avctx)
static int decode_frame_mp3on4 (AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)

Variables

static VLC huff_vlc [16]
static VLC huff_quad_vlc [2]
static uint16_t band_index_long [9][23]
static int8_t table_4_3_exp [TABLE_4_3_SIZE]
static uint32_t table_4_3_value [TABLE_4_3_SIZE]
static uint32_t exp_table [512]
static uint32_t expval_table [512][16]
static int32_t is_table [2][16]
static int32_t is_table_lsf [2][2][16]
static int32_t csa_table [8][4]
static float csa_table_float [8][4]
static int32_t mdct_win [8][36]
static uint16_t scale_factor_modshift [64]
static int32_t scale_factor_mult [15][3]
static const int32_t scale_factor_mult2 [3][3]
static int dev_4_3_coefs [DEV_ORDER]
static int pow_mult3 [3]
static const int icos36 [9]
static const int icos36h [9]
static int mp3Frames [16] = {0,1,1,2,3,3,4,5,2}
static int mp3Channels [16] = {0,1,2,3,4,5,6,8,4}
static int chan_offset [9][5]
AVCodec mp2_decoder
AVCodec mp3_decoder
AVCodec mp3adu_decoder
AVCodec mp3on4_decoder


Function Documentation

static void compute_antialias_integer ( MPADecodeContext s,
GranuleDef g 
) [static]

Definition at line 1740 of file mpegaudiodec.c.

Referenced by decode_init().

static void compute_antialias_float ( MPADecodeContext s,
GranuleDef g 
) [static]

Definition at line 1780 of file mpegaudiodec.c.

Referenced by decode_init().

static DECLARE_ALIGNED_16 ( MPA_INT  ,
window  [512] 
) [static]

static int l1_unscale ( int  n,
int  mant,
int  scale_factor 
) [inline, static]

Definition at line 131 of file mpegaudiodec.c.

Referenced by mp_decode_layer1(), and mp_decode_layer2().

static int l2_unscale_group ( int  steps,
int  mant,
int  scale_factor 
) [inline, static]

Definition at line 145 of file mpegaudiodec.c.

Referenced by mp_decode_layer2().

static int l3_unscale ( int  value,
int  exponent 
) [inline, static]

Definition at line 161 of file mpegaudiodec.c.

Referenced by huffman_decode().

static void int_pow_init ( void   )  [static]

Definition at line 195 of file mpegaudiodec.c.

Referenced by decode_init().

static int int_pow ( int  i,
int *  exp_ptr 
) [static]

Definition at line 208 of file mpegaudiodec.c.

static int decode_init ( AVCodecContext avctx  )  [static]

Definition at line 253 of file mpegaudiodec.c.

static void dct32 ( int32_t out,
int32_t tab 
) [static]

Definition at line 538 of file mpegaudiodec.c.

Referenced by ff_mpa_synth_filter().

static int round_sample ( int *  sum  )  [inline, static]

Definition at line 698 of file mpegaudiodec.c.

Referenced by ff_mpa_synth_filter().

static int round_sample ( int64_t sum  )  [inline, static]

Definition at line 718 of file mpegaudiodec.c.

void ff_mpa_synth_init ( MPA_INT window  ) 

Definition at line 774 of file mpegaudiodec.c.

Referenced by decode_init(), ff_mpc_init(), and qdm2_init().

void ff_mpa_synth_filter ( MPA_INT synth_buf_ptr,
int *  synth_buf_offset,
MPA_INT window,
int *  dither_state,
OUT_INT samples,
int  incr,
int32_t  sb_samples[SBLIMIT] 
)

Definition at line 796 of file mpegaudiodec.c.

Referenced by mp_decode_frame(), mpc_synth(), and qdm2_synthesis_filter().

static void imdct12 ( int *  out,
int *  in 
) [static]

Definition at line 899 of file mpegaudiodec.c.

Referenced by compute_imdct().

static void imdct36 ( int *  out,
int *  buf,
int *  in,
int *  win 
) [static]

Definition at line 952 of file mpegaudiodec.c.

Referenced by compute_imdct().

static int mp_decode_layer1 ( MPADecodeContext s  )  [static]

Definition at line 1061 of file mpegaudiodec.c.

Referenced by mp_decode_frame().

static int mp_decode_layer2 ( MPADecodeContext s  )  [static]

Definition at line 1127 of file mpegaudiodec.c.

Referenced by mp_decode_frame().

static void lsf_sf_expand ( int *  slen,
int  sf,
int  n1,
int  n2,
int  n3 
) [inline, static]

Definition at line 1337 of file mpegaudiodec.c.

Referenced by mp_decode_layer3().

static void exponents_from_scale_factors ( MPADecodeContext s,
GranuleDef g,
int16_t exponents 
) [static]

Definition at line 1357 of file mpegaudiodec.c.

Referenced by mp_decode_layer3().

static int get_bitsz ( GetBitContext s,
int  n 
) [inline, static]

Definition at line 1396 of file mpegaudiodec.c.

Referenced by huffman_decode().

static void switch_buffer ( MPADecodeContext s,
int *  pos,
int *  end_pos,
int *  end_pos2 
) [static]

Definition at line 1405 of file mpegaudiodec.c.

Referenced by huffman_decode().

static int huffman_decode ( MPADecodeContext s,
GranuleDef g,
int16_t exponents,
int  end_pos2 
) [static]

Definition at line 1417 of file mpegaudiodec.c.

Referenced by mp_decode_layer3().

static void reorder_block ( MPADecodeContext s,
GranuleDef g 
) [static]

Definition at line 1577 of file mpegaudiodec.c.

Referenced by mp_decode_layer3().

static void compute_stereo ( MPADecodeContext s,
GranuleDef g0,
GranuleDef g1 
) [static]

Definition at line 1613 of file mpegaudiodec.c.

Referenced by mp_decode_layer3().

static void compute_imdct ( MPADecodeContext s,
GranuleDef g,
int32_t sb_samples,
int32_t mdct_buf 
) [static]

Definition at line 1819 of file mpegaudiodec.c.

Referenced by mp_decode_layer3().

void sample_dump ( int  fnum,
int32_t tab,
int  n 
)

Definition at line 1910 of file mpegaudiodec.c.

Referenced by mp_decode_layer3().

static int mp_decode_layer3 ( MPADecodeContext s  )  [static]

Definition at line 1953 of file mpegaudiodec.c.

Referenced by mp_decode_frame().

static int mp_decode_frame ( MPADecodeContext s,
OUT_INT samples,
const uint8_t *  buf,
int  buf_size 
) [static]

Definition at line 2275 of file mpegaudiodec.c.

Referenced by decode_frame(), decode_frame_adu(), and decode_frame_mp3on4().

static int decode_frame ( AVCodecContext avctx,
void *  data,
int *  data_size,
uint8_t *  buf,
int  buf_size 
) [static]

Definition at line 2354 of file mpegaudiodec.c.

static void flush ( AVCodecContext avctx  )  [static]

static int decode_frame_adu ( AVCodecContext avctx,
void *  data,
int *  data_size,
uint8_t *  buf,
int  buf_size 
) [static]

Definition at line 2428 of file mpegaudiodec.c.

static int decode_init_mp3on4 ( AVCodecContext avctx  )  [static]

Definition at line 2495 of file mpegaudiodec.c.

static int decode_close_mp3on4 ( AVCodecContext avctx  )  [static]

Definition at line 2541 of file mpegaudiodec.c.

static int decode_frame_mp3on4 ( AVCodecContext avctx,
void *  data,
int *  data_size,
uint8_t *  buf,
int  buf_size 
) [static]

Definition at line 2554 of file mpegaudiodec.c.


Variable Documentation

VLC huff_vlc[16] [static]

Definition at line 95 of file mpegaudiodec.c.

VLC huff_quad_vlc[2] [static]

Definition at line 96 of file mpegaudiodec.c.

uint16_t band_index_long[9][23] [static]

Definition at line 98 of file mpegaudiodec.c.

Referenced by decode_init(), and mp_decode_layer3().

int8_t table_4_3_exp[TABLE_4_3_SIZE] [static]

Definition at line 101 of file mpegaudiodec.c.

Referenced by decode_init(), and l3_unscale().

uint32_t table_4_3_value[TABLE_4_3_SIZE] [static]

Definition at line 102 of file mpegaudiodec.c.

Referenced by decode_init(), and l3_unscale().

uint32_t exp_table[512] [static]

Definition at line 103 of file mpegaudiodec.c.

Referenced by decode_init(), and huffman_decode().

uint32_t expval_table[512][16] [static]

Definition at line 104 of file mpegaudiodec.c.

Referenced by decode_init(), and huffman_decode().

int32_t is_table[2][16] [static]

Definition at line 106 of file mpegaudiodec.c.

Referenced by compute_stereo(), and decode_init().

int32_t is_table_lsf[2][2][16] [static]

Definition at line 107 of file mpegaudiodec.c.

Referenced by compute_stereo(), and decode_init().

int32_t csa_table[8][4] [static]

Definition at line 108 of file mpegaudiodec.c.

Referenced by compute_antialias_integer(), and decode_init().

float csa_table_float[8][4] [static]

Definition at line 109 of file mpegaudiodec.c.

Referenced by compute_antialias_float(), and decode_init().

int32_t mdct_win[8][36] [static]

Definition at line 110 of file mpegaudiodec.c.

Referenced by compute_imdct(), and decode_init().

uint16_t scale_factor_modshift[64] [static]

Definition at line 113 of file mpegaudiodec.c.

Referenced by decode_init(), l1_unscale(), and l2_unscale_group().

int32_t scale_factor_mult[15][3] [static]

Definition at line 115 of file mpegaudiodec.c.

Referenced by decode_init(), encode_frame(), l1_unscale(), and MPA_encode_init().

const int32_t scale_factor_mult2[3][3] [static]

Initial value:

 {
    SCALE_GEN(4.0 / 3.0), 
    SCALE_GEN(4.0 / 5.0), 
    SCALE_GEN(4.0 / 9.0), 
}

Definition at line 121 of file mpegaudiodec.c.

Referenced by l2_unscale_group().

int dev_4_3_coefs[DEV_ORDER] [static]

Definition at line 185 of file mpegaudiodec.c.

Referenced by int_pow(), and int_pow_init().

int pow_mult3[3] [static]

Initial value:

 {
    POW_FIX(1.0),
    POW_FIX(1.25992104989487316476),
    POW_FIX(1.58740105196819947474),
}

Definition at line 188 of file mpegaudiodec.c.

Referenced by int_pow().

const int icos36[9] [static]

Initial value:

 {
    FIXR(0.50190991877167369479),
    FIXR(0.51763809020504152469), 
    FIXR(0.55168895948124587824),
    FIXR(0.61038729438072803416),
    FIXR(0.70710678118654752439), 
    FIXR(0.87172339781054900991),
    FIXR(1.18310079157624925896),
    FIXR(1.93185165257813657349), 
    FIXR(5.73685662283492756461),
}

Definition at line 872 of file mpegaudiodec.c.

Referenced by imdct36().

const int icos36h[9] [static]

Initial value:

 {
    FIXHR(0.50190991877167369479/2),
    FIXHR(0.51763809020504152469/2), 
    FIXHR(0.55168895948124587824/2),
    FIXHR(0.61038729438072803416/2),
    FIXHR(0.70710678118654752439/2), 
    FIXHR(0.87172339781054900991/2),
    FIXHR(1.18310079157624925896/4),
    FIXHR(1.93185165257813657349/4), 

}

Definition at line 885 of file mpegaudiodec.c.

Referenced by imdct12(), and imdct36().

int mp3Frames[16] = {0,1,1,2,3,3,4,5,2} [static]

Definition at line 2479 of file mpegaudiodec.c.

Referenced by decode_init_mp3on4().

int mp3Channels[16] = {0,1,2,3,4,5,6,8,4} [static]

Definition at line 2480 of file mpegaudiodec.c.

Referenced by decode_init_mp3on4().

int chan_offset[9][5] [static]

Initial value:

 {
    {0},
    {0},            
    {0},            
    {2,0},          
    {2,0,3},        
    {4,0,2},        
    {4,0,2,5},      
    {4,0,2,6,5},    
    {0,2}           
}

Definition at line 2482 of file mpegaudiodec.c.

Referenced by decode_frame_mp3on4(), dv_decode_mt(), and dv_encode_mt().

Initial value:

{
    "mp2",
    CODEC_TYPE_AUDIO,
    CODEC_ID_MP2,
    sizeof(MPADecodeContext),
    decode_init,
    NULL,
    NULL,
    decode_frame,
    CODEC_CAP_PARSE_ONLY,
}

Definition at line 2638 of file mpegaudiodec.c.

Initial value:

{
    "mp3",
    CODEC_TYPE_AUDIO,
    CODEC_ID_MP3,
    sizeof(MPADecodeContext),
    decode_init,
    NULL,
    NULL,
    decode_frame,
    CODEC_CAP_PARSE_ONLY,
    .flush= flush,
}

Definition at line 2652 of file mpegaudiodec.c.

Initial value:

{
    "mp3adu",
    CODEC_TYPE_AUDIO,
    CODEC_ID_MP3ADU,
    sizeof(MPADecodeContext),
    decode_init,
    NULL,
    NULL,
    decode_frame_adu,
    CODEC_CAP_PARSE_ONLY,
    .flush= flush,
}

Definition at line 2667 of file mpegaudiodec.c.

Initial value:

Definition at line 2682 of file mpegaudiodec.c.


Generated on Sat Dec 18 05:15:54 2010 for MythTV by  doxygen 1.5.5