#include "avcodec.h"#include "bitstream.h"#include "mpegaudio.h"#include "dsputil.h"#include "mpegaudiodectab.h"

Go to the source code of this file.
Data Structures | |
| struct | MPADecodeContext |
| struct | MP3On4DecodeContext |
| struct | GranuleDef |
| struct | HuffTable |
Defines | |
| #define | FRAC_BITS 15 |
| #define | WFRAC_BITS 14 |
| #define | OUT_MAX INT16_MAX |
| #define | OUT_MIN INT16_MIN |
| #define | OUT_SHIFT (WFRAC_BITS + FRAC_BITS - 15) |
| #define | FRAC_ONE (1 << FRAC_BITS) |
| #define | MULL(a, b) (((int64_t)(a) * (int64_t)(b)) >> FRAC_BITS) |
| #define | MUL64(a, b) ((int64_t)(a) * (int64_t)(b)) |
| #define | FIX(a) ((int)((a) * FRAC_ONE)) |
| #define | FIXR(a) ((int)((a) * FRAC_ONE + 0.5)) |
| #define | FRAC_RND(a) (((a) + (FRAC_ONE/2)) >> FRAC_BITS) |
| #define | FIXHR(a) ((int)((a) * (1LL<<32) + 0.5)) |
| #define | HEADER_SIZE 4 |
| #define | BACKSTEP_SIZE 512 |
| #define | MODE_EXT_MS_STEREO 2 |
| #define | MODE_EXT_I_STEREO 1 |
| #define | TABLE_4_3_SIZE (8191 + 16)*4 |
| #define | SCALE_GEN(v) { FIXR(1.0 * (v)), FIXR(0.7937005259 * (v)), FIXR(0.6299605249 * (v)) } |
| #define | DEV_ORDER 13 |
| #define | POW_FRAC_BITS 24 |
| #define | POW_FRAC_ONE (1 << POW_FRAC_BITS) |
| #define | POW_FIX(a) ((int)((a) * POW_FRAC_ONE)) |
| #define | POW_MULL(a, b) (((int64_t)(a) * (int64_t)(b)) >> POW_FRAC_BITS) |
| #define | COS0_0 FIXR(0.50060299823519630134) |
| #define | COS0_1 FIXR(0.50547095989754365998) |
| #define | COS0_2 FIXR(0.51544730992262454697) |
| #define | COS0_3 FIXR(0.53104259108978417447) |
| #define | COS0_4 FIXR(0.55310389603444452782) |
| #define | COS0_5 FIXR(0.58293496820613387367) |
| #define | COS0_6 FIXR(0.62250412303566481615) |
| #define | COS0_7 FIXR(0.67480834145500574602) |
| #define | COS0_8 FIXR(0.74453627100229844977) |
| #define | COS0_9 FIXR(0.83934964541552703873) |
| #define | COS0_10 FIXR(0.97256823786196069369) |
| #define | COS0_11 FIXR(1.16943993343288495515) |
| #define | COS0_12 FIXR(1.48416461631416627724) |
| #define | COS0_13 FIXR(2.05778100995341155085) |
| #define | COS0_14 FIXR(3.40760841846871878570) |
| #define | COS0_15 FIXR(10.19000812354805681150) |
| #define | COS1_0 FIXR(0.50241928618815570551) |
| #define | COS1_1 FIXR(0.52249861493968888062) |
| #define | COS1_2 FIXR(0.56694403481635770368) |
| #define | COS1_3 FIXR(0.64682178335999012954) |
| #define | COS1_4 FIXR(0.78815462345125022473) |
| #define | COS1_5 FIXR(1.06067768599034747134) |
| #define | COS1_6 FIXR(1.72244709823833392782) |
| #define | COS1_7 FIXR(5.10114861868916385802) |
| #define | COS2_0 FIXR(0.50979557910415916894) |
| #define | COS2_1 FIXR(0.60134488693504528054) |
| #define | COS2_2 FIXR(0.89997622313641570463) |
| #define | COS2_3 FIXR(2.56291544774150617881) |
| #define | COS3_0 FIXR(0.54119610014619698439) |
| #define | COS3_1 FIXR(1.30656296487637652785) |
| #define | COS4_0 FIXR(0.70710678118654752439) |
| #define | BF(a, b, c) |
| #define | BF1(a, b, c, d) |
| #define | BF2(a, b, c, d) |
| #define | ADD(a, b) tab[a] += tab[b] |
| #define | MACS(rt, ra, rb) rt += (ra) * (rb) |
| #define | MULS(ra, rb) ((ra) * (rb)) |
| #define | SUM8(sum, op, w, p) |
| #define | SUM8P2(sum1, op1, sum2, op2, w1, w2, p) |
| #define | C3 FIXHR(0.86602540378443864676/2) |
| #define | C1 FIXHR(0.98480775301220805936/2) |
| #define | C2 FIXHR(0.93969262078590838405/2) |
| #define | C3 FIXHR(0.86602540378443864676/2) |
| #define | C4 FIXHR(0.76604444311897803520/2) |
| #define | C5 FIXHR(0.64278760968653932632/2) |
| #define | C6 FIXHR(0.5/2) |
| #define | C7 FIXHR(0.34202014332566873304/2) |
| #define | C8 FIXHR(0.17364817766693034885/2) |
| #define | ISQRT2 FIXR(0.70710678118654752440) |
| #define | INT_AA(j) |
| #define | FLOAT_AA(j) |
Typedefs | |
| typedef int16_t | OUT_INT |
| typedef int16_t | MPA_INT |
Functions | |
| static always_inline int | MULH (int a, int b) |
| static void | compute_antialias_integer (MPADecodeContext *s, GranuleDef *g) |
| static void | compute_antialias_float (MPADecodeContext *s, GranuleDef *g) |
| void | ff_mpa_synth_init (MPA_INT *window) |
| static MPA_INT window[512] | __attribute__ ((aligned(16))) |
| 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 | decode_init (AVCodecContext *avctx) |
| static void | dct32 (int32_t *out, int32_t *tab) |
| static int | round_sample (int *sum) |
| 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 | decode_header (MPADecodeContext *s, uint32_t header) |
| int | mpa_decode_header (AVCodecContext *avctx, uint32_t head) |
| static int | mp_decode_layer1 (MPADecodeContext *s) |
| int | l2_select_table (int bitrate, int nb_channels, int freq, int lsf) |
| static int | mp_decode_layer2 (MPADecodeContext *s) |
| static void | seek_to_maindata (MPADecodeContext *s, unsigned int backstep) |
| 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 int | huffman_decode (MPADecodeContext *s, GranuleDef *g, int16_t *exponents, int end_pos) |
| 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) |
| static int | mp_decode_layer3 (MPADecodeContext *s) |
| static int | mp_decode_frame (MPADecodeContext *s, OUT_INT *samples) |
| static int | decode_frame (AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size) |
| 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 uint8_t * | huff_code_table [16] |
| static VLC | huff_quad_vlc [2] |
| static uint16_t | band_index_long [9][23] |
| static int8_t * | table_4_3_exp |
| static uint32_t * | table_4_3_value |
| 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 const int | icos36 [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 |
Definition in file mpegaudiodec.c.
| #define BACKSTEP_SIZE 512 |
Definition at line 87 of file mpegaudiodec.c.
Referenced by decode_init(), decode_init_mp3on4(), and seek_to_maindata().
| #define C1 FIXHR(0.98480775301220805936/2) |
Definition at line 1006 of file mpegaudiodec.c.
| #define C2 FIXHR(0.93969262078590838405/2) |
Definition at line 1007 of file mpegaudiodec.c.
| #define C3 FIXHR(0.86602540378443864676/2) |
Definition at line 1008 of file mpegaudiodec.c.
| #define C3 FIXHR(0.86602540378443864676/2) |
Definition at line 1008 of file mpegaudiodec.c.
| #define C4 FIXHR(0.76604444311897803520/2) |
Definition at line 1009 of file mpegaudiodec.c.
| #define C5 FIXHR(0.64278760968653932632/2) |
Definition at line 1010 of file mpegaudiodec.c.
| #define C6 FIXHR(0.5/2) |
Definition at line 1011 of file mpegaudiodec.c.
| #define C7 FIXHR(0.34202014332566873304/2) |
Definition at line 1012 of file mpegaudiodec.c.
| #define C8 FIXHR(0.17364817766693034885/2) |
| #define COS0_0 FIXR(0.50060299823519630134) |
| #define COS0_1 FIXR(0.50547095989754365998) |
| #define COS0_10 FIXR(0.97256823786196069369) |
| #define COS0_11 FIXR(1.16943993343288495515) |
| #define COS0_12 FIXR(1.48416461631416627724) |
| #define COS0_13 FIXR(2.05778100995341155085) |
| #define COS0_14 FIXR(3.40760841846871878570) |
| #define COS0_15 FIXR(10.19000812354805681150) |
| #define COS0_2 FIXR(0.51544730992262454697) |
| #define COS0_3 FIXR(0.53104259108978417447) |
| #define COS0_4 FIXR(0.55310389603444452782) |
| #define COS0_5 FIXR(0.58293496820613387367) |
| #define COS0_6 FIXR(0.62250412303566481615) |
| #define COS0_7 FIXR(0.67480834145500574602) |
| #define COS0_8 FIXR(0.74453627100229844977) |
| #define COS0_9 FIXR(0.83934964541552703873) |
| #define COS1_0 FIXR(0.50241928618815570551) |
| #define COS1_1 FIXR(0.52249861493968888062) |
| #define COS1_2 FIXR(0.56694403481635770368) |
| #define COS1_3 FIXR(0.64682178335999012954) |
| #define COS1_4 FIXR(0.78815462345125022473) |
| #define COS1_5 FIXR(1.06067768599034747134) |
| #define COS1_6 FIXR(1.72244709823833392782) |
| #define COS1_7 FIXR(5.10114861868916385802) |
| #define COS2_0 FIXR(0.50979557910415916894) |
| #define COS2_1 FIXR(0.60134488693504528054) |
| #define COS2_2 FIXR(0.89997622313641570463) |
| #define COS2_3 FIXR(2.56291544774150617881) |
| #define COS3_0 FIXR(0.54119610014619698439) |
| #define COS3_1 FIXR(1.30656296487637652785) |
| #define COS4_0 FIXR(0.70710678118654752439) |
Definition at line 575 of file mpegaudiodec.c.
| #define DEV_ORDER 13 |
Definition at line 67 of file mpegaudiodec.c.
| #define FLOAT_AA | ( | j | ) |
Value:
tmp0= ptr[-1-j];\
tmp1= ptr[ j];\
ptr[-1-j] = lrintf(tmp0 * csa[0+4*j] - tmp1 * csa[1+4*j]);\
ptr[ j] = lrintf(tmp0 * csa[1+4*j] + tmp1 * csa[0+4*j]);
Referenced by compute_antialias_float().
| #define FRAC_BITS 15 |
Definition at line 47 of file mpegaudiodec.c.
| #define FRAC_ONE (1 << FRAC_BITS) |
Definition at line 70 of file mpegaudiodec.c.
| #define HEADER_SIZE 4 |
Definition at line 86 of file mpegaudiodec.c.
| #define INT_AA | ( | j | ) |
Value:
tmp0 = ptr[-1-j];\
tmp1 = ptr[ j];\
tmp2= MULH(tmp0 + tmp1, csa[0+4*j]);\
ptr[-1-j] = 4*(tmp2 - MULH(tmp1, csa[2+4*j]));\
ptr[ j] = 4*(tmp2 + MULH(tmp0, csa[3+4*j]));
Referenced by compute_antialias_integer().
| #define ISQRT2 FIXR(0.70710678118654752440) |
| #define MACS | ( | rt, | |||
| ra, | |||||
| rb | ) | rt += (ra) * (rb) |
Definition at line 783 of file mpegaudiodec.c.
| #define MODE_EXT_I_STEREO 1 |
Definition at line 153 of file mpegaudiodec.c.
Referenced by compute_stereo(), decode_header(), and mp_decode_layer3().
| #define MODE_EXT_MS_STEREO 2 |
Definition at line 152 of file mpegaudiodec.c.
Referenced by compute_stereo(), decode_header(), and mp_decode_layer3().
Definition at line 65 of file mpegaudiodec.c.
Referenced by compute_stereo(), decode_init(), imdct12(), and imdct36().
| #define MULS | ( | ra, | |||
| rb | ) | ((ra) * (rb)) |
Definition at line 786 of file mpegaudiodec.c.
| #define OUT_MAX INT16_MAX |
| #define OUT_MIN INT16_MIN |
| #define OUT_SHIFT (WFRAC_BITS + FRAC_BITS - 15) |
| #define POW_FRAC_BITS 24 |
Definition at line 253 of file mpegaudiodec.c.
| #define POW_FRAC_ONE (1 << POW_FRAC_BITS) |
Definition at line 254 of file mpegaudiodec.c.
| #define SCALE_GEN | ( | v | ) | { FIXR(1.0 * (v)), FIXR(0.7937005259 * (v)), FIXR(0.6299605249 * (v)) } |
Definition at line 190 of file mpegaudiodec.c.
| #define SUM8 | ( | sum, | |||
| op, | |||||
| w, | |||||
| p | ) |
Value:
{ \
sum op MULS((w)[0 * 64], p[0 * 64]);\
sum op MULS((w)[1 * 64], p[1 * 64]);\
sum op MULS((w)[2 * 64], p[2 * 64]);\
sum op MULS((w)[3 * 64], p[3 * 64]);\
sum op MULS((w)[4 * 64], p[4 * 64]);\
sum op MULS((w)[5 * 64], p[5 * 64]);\
sum op MULS((w)[6 * 64], p[6 * 64]);\
sum op MULS((w)[7 * 64], p[7 * 64]);\
}
Definition at line 808 of file mpegaudiodec.c.
Referenced by ff_mpa_synth_filter().
| #define SUM8P2 | ( | sum1, | |||
| op1, | |||||
| sum2, | |||||
| op2, | |||||
| w1, | |||||
| w2, | |||||
| p | ) |
Value:
{ \
int tmp;\
tmp = p[0 * 64];\
sum1 op1 MULS((w1)[0 * 64], tmp);\
sum2 op2 MULS((w2)[0 * 64], tmp);\
tmp = p[1 * 64];\
sum1 op1 MULS((w1)[1 * 64], tmp);\
sum2 op2 MULS((w2)[1 * 64], tmp);\
tmp = p[2 * 64];\
sum1 op1 MULS((w1)[2 * 64], tmp);\
sum2 op2 MULS((w2)[2 * 64], tmp);\
tmp = p[3 * 64];\
sum1 op1 MULS((w1)[3 * 64], tmp);\
sum2 op2 MULS((w2)[3 * 64], tmp);\
tmp = p[4 * 64];\
sum1 op1 MULS((w1)[4 * 64], tmp);\
sum2 op2 MULS((w2)[4 * 64], tmp);\
tmp = p[5 * 64];\
sum1 op1 MULS((w1)[5 * 64], tmp);\
sum2 op2 MULS((w2)[5 * 64], tmp);\
tmp = p[6 * 64];\
sum1 op1 MULS((w1)[6 * 64], tmp);\
sum2 op2 MULS((w2)[6 * 64], tmp);\
tmp = p[7 * 64];\
sum1 op1 MULS((w1)[7 * 64], tmp);\
sum2 op2 MULS((w2)[7 * 64], tmp);\
}
Definition at line 820 of file mpegaudiodec.c.
Referenced by ff_mpa_synth_filter().
| #define TABLE_4_3_SIZE (8191 + 16)*4 |
| #define WFRAC_BITS 14 |
Definition at line 48 of file mpegaudiodec.c.
| typedef int16_t MPA_INT |
Definition at line 79 of file mpegaudiodec.c.
| typedef int16_t OUT_INT |
Definition at line 57 of file mpegaudiodec.c.
| static void compute_antialias_float | ( | MPADecodeContext * | s, | |
| GranuleDef * | g | |||
| ) | [static] |
Definition at line 1956 of file mpegaudiodec.c.
References GranuleDef::block_type, FLOAT_AA, GranuleDef::sb_hybrid, SBLIMIT, and GranuleDef::switch_point.
Referenced by decode_init().
| static void compute_antialias_integer | ( | MPADecodeContext * | s, | |
| GranuleDef * | g | |||
| ) | [static] |
Definition at line 1916 of file mpegaudiodec.c.
References GranuleDef::block_type, INT_AA, GranuleDef::sb_hybrid, SBLIMIT, and GranuleDef::switch_point.
Referenced by decode_init().
| static void compute_imdct | ( | MPADecodeContext * | s, | |
| GranuleDef * | g, | |||
| int32_t * | sb_samples, | |||
| int32_t * | mdct_buf | |||
| ) | [static] |
Definition at line 1995 of file mpegaudiodec.c.
References GranuleDef::block_type, buf, imdct12(), imdct36(), MULH(), GranuleDef::sb_hybrid, SBLIMIT, and GranuleDef::switch_point.
Referenced by mp_decode_layer3().

| static void compute_stereo | ( | MPADecodeContext * | s, | |
| GranuleDef * | g0, | |||
| GranuleDef * | g1 | |||
| ) | [static] |
Definition at line 1789 of file mpegaudiodec.c.
References band_size_long, band_size_short, ISQRT2, GranuleDef::long_end, MPADecodeContext::lsf, MPADecodeContext::mode_ext, MODE_EXT_I_STEREO, MODE_EXT_MS_STEREO, MULL, MPADecodeContext::sample_rate_index, GranuleDef::sb_hybrid, GranuleDef::scale_factors, GranuleDef::scalefac_compress, and GranuleDef::short_start.
Referenced by mp_decode_layer3().
| static void dct32 | ( | int32_t * | out, | |
| int32_t * | tab | |||
| ) | [static] |
Definition at line 606 of file mpegaudiodec.c.
References ADD, BF, BF1, BF2, COS0_0, COS0_1, COS0_10, COS0_11, COS0_12, COS0_13, COS0_14, COS0_15, COS0_2, COS0_3, COS0_4, COS0_5, COS0_6, COS0_7, COS0_8, COS0_9, COS1_0, COS1_1, COS1_2, COS1_3, COS1_4, COS1_5, COS1_6, COS1_7, COS2_0, COS2_1, COS2_2, COS2_3, COS3_0, and COS3_1.
Referenced by ff_mpa_synth_filter().
| static int decode_close_mp3on4 | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 2761 of file mpegaudiodec.c.
References av_free(), MP3On4DecodeContext::frames, MP3On4DecodeContext::mp3decctx, AVCodecContext::priv_data, and s.

| static int decode_frame | ( | AVCodecContext * | avctx, | |
| void * | data, | |||
| int * | data_size, | |||
| uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
Definition at line 2480 of file mpegaudiodec.c.
References av_log(), AV_LOG_DEBUG, MPADecodeContext::bit_rate, AVCodecContext::bit_rate, AVCodecContext::channels, decode_header(), ff_mpa_check_header(), AVCodecContext::frame_size, MPADecodeContext::frame_size, MPADecodeContext::free_format_frame_size, MPADecodeContext::free_format_next_header, header, HEADER_SIZE, MPADecodeContext::inbuf, MPADecodeContext::inbuf_ptr, MPADecodeContext::layer, MPADecodeContext::lsf, memcpy, mp_decode_frame(), MPA_MAX_CODED_FRAME_SIZE, MPADecodeContext::nb_channels, AVCodecContext::parse_only, AVCodecContext::priv_data, s, SAME_HEADER_MASK, MPADecodeContext::sample_rate, AVCodecContext::sample_rate, and AVCodecContext::sub_id.

| static int decode_frame_adu | ( | AVCodecContext * | avctx, | |
| void * | data, | |||
| int * | data_size, | |||
| uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
Definition at line 2642 of file mpegaudiodec.c.
References MPADecodeContext::bit_rate, AVCodecContext::bit_rate, AVCodecContext::channels, decode_header(), ff_mpa_check_header(), MPADecodeContext::frame_size, AVCodecContext::frame_size, header, HEADER_SIZE, MPADecodeContext::inbuf, MPADecodeContext::inbuf_ptr, MPADecodeContext::layer, memcpy, mp_decode_frame(), MPA_MAX_CODED_FRAME_SIZE, MPADecodeContext::nb_channels, AVCodecContext::parse_only, AVCodecContext::priv_data, s, MPADecodeContext::sample_rate, AVCodecContext::sample_rate, and AVCodecContext::sub_id.

| static int decode_frame_mp3on4 | ( | AVCodecContext * | avctx, | |
| void * | data, | |||
| int * | data_size, | |||
| uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
Definition at line 2774 of file mpegaudiodec.c.
References MPADecodeContext::bit_rate, AVCodecContext::bit_rate, MP3On4DecodeContext::chan_cfg, AVCodecContext::channels, decode_header(), ff_mpa_check_header(), AVCodecContext::frame_size, MP3On4DecodeContext::frames, header, HEADER_SIZE, MPADecodeContext::inbuf, MPADecodeContext::inbuf_ptr, memcpy, MP3On4DecodeContext::mp3decctx, mp_decode_frame(), MPA_FRAME_SIZE, MPA_MAX_CHANNELS, MPA_MAX_CODED_FRAME_SIZE, MPADecodeContext::nb_channels, NULL, AVCodecContext::priv_data, s, MPADecodeContext::sample_rate, and AVCodecContext::sample_rate.

| static int decode_header | ( | MPADecodeContext * | s, | |
| uint32_t | header | |||
| ) | [static] |
Definition at line 1128 of file mpegaudiodec.c.
References MPADecodeContext::bit_rate, MPADecodeContext::error_protection, MPADecodeContext::frame_size, MPADecodeContext::free_format_frame_size, MPADecodeContext::layer, MPADecodeContext::lsf, MPADecodeContext::mode, MPADecodeContext::mode_ext, MODE_EXT_I_STEREO, MODE_EXT_MS_STEREO, mpa_bitrate_tab, mpa_freq_tab, MPA_MONO, MPADecodeContext::nb_channels, MPADecodeContext::sample_rate, and MPADecodeContext::sample_rate_index.
Referenced by decode_frame(), decode_frame_adu(), decode_frame_mp3on4(), mpa_decode_header(), and mpegaudio_parse().
| static int decode_init | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 326 of file mpegaudiodec.c.
References MPADecodeContext::adu_mode, AVCodecContext::antialias_algo, av_mallocz(), av_mallocz_static(), BACKSTEP_SIZE, band_size_long, HuffTable::bits, ci_table, AVCodecContext::codec_id, CODEC_ID_MP3ADU, HuffTable::codes, MPADecodeContext::compute_antialias, compute_antialias_float(), compute_antialias_integer(), FF_AA_FLOAT, ff_mpa_synth_init(), FIXHR, FIXR, FRAC_BITS, FRAC_ONE, MPADecodeContext::inbuf, MPADecodeContext::inbuf1, MPADecodeContext::inbuf_index, MPADecodeContext::inbuf_ptr, init, init_vlc(), int64_t_C, int_pow_init(), LL, M_PI, mod(), mpa_huff_tables, mpa_quad_bits, mpa_quad_codes, MULL, NULL, AVCodecContext::parse_only, AVCodecContext::priv_data, s, AVCodecContext::sample_fmt, SAMPLE_FMT_S16, SAMPLE_FMT_S32, shift(), TABLE_4_3_SIZE, window, and HuffTable::xsize.

| static int decode_init_mp3on4 | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 2714 of file mpegaudiodec.c.
References MPADecodeContext::adu_mode, av_log(), AV_LOG_ERROR, av_mallocz(), BACKSTEP_SIZE, MP3On4DecodeContext::chan_cfg, AVCodecContext::channels, MPADecodeContext::compute_antialias, decode_init(), AVCodecContext::extradata, AVCodecContext::extradata_size, MP3On4DecodeContext::frames, MPADecodeContext::inbuf, MPADecodeContext::inbuf1, MPADecodeContext::inbuf_ptr, MP3On4DecodeContext::mp3decctx, NULL, AVCodecContext::priv_data, and s.

| static void exponents_from_scale_factors | ( | MPADecodeContext * | s, | |
| GranuleDef * | g, | |||
| int16_t * | exponents | |||
| ) | [static] |
Definition at line 1604 of file mpegaudiodec.c.
References band_size_long, band_size_short, GranuleDef::global_gain, GranuleDef::long_end, mpa_pretab, GranuleDef::preflag, pretab, MPADecodeContext::sample_rate_index, GranuleDef::scale_factors, GranuleDef::scalefac_scale, shift(), GranuleDef::short_start, GranuleDef::subblock_gain, and v0.
Referenced by mp_decode_layer3().

| 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 871 of file mpegaudiodec.c.
References dct32(), memcpy, offset, round_sample(), SUM8, and SUM8P2.
Referenced by mp_decode_frame().

| void ff_mpa_synth_init | ( | MPA_INT * | window | ) |
Definition at line 849 of file mpegaudiodec.c.
References mpa_enwindow, and WFRAC_BITS.
Referenced by decode_init().
| static int get_bitsz | ( | GetBitContext * | s, | |
| int | n | |||
| ) | [inline, static] |
Definition at line 1643 of file mpegaudiodec.c.
References get_bits().
Referenced by huffman_decode(), and mp_decode_layer3().

| static int huffman_decode | ( | MPADecodeContext * | s, | |
| GranuleDef * | g, | |||
| int16_t * | exponents, | |||
| int | end_pos | |||
| ) | [static] |
Definition at line 1651 of file mpegaudiodec.c.
References GetBitContext::buffer, GranuleDef::count1table_select, MPADecodeContext::gb, get_bits1(), get_bits_count(), get_bitsz(), get_vlc(), l3_unscale(), mpa_huff_data, NULL, GranuleDef::region_size, GranuleDef::sb_hybrid, and GranuleDef::table_select.
Referenced by mp_decode_layer3().

| static void imdct12 | ( | int * | out, | |
| int * | in | |||
| ) | [static] |
Definition at line 964 of file mpegaudiodec.c.
References C3, MULH(), MULL, t1, and t2.
Referenced by compute_imdct().

| static void imdct36 | ( | int * | out, | |
| int * | buf, | |||
| int * | in, | |||
| int * | win | |||
| ) | [static] |
| static void int_pow_init | ( | void | ) | [static] |
Definition at line 268 of file mpegaudiodec.c.
References a, DEV_ORDER, POW_FIX, and POW_MULL.
Referenced by decode_init().
| static int l1_unscale | ( | int | n, | |
| int | mant, | |||
| int | scale_factor | |||
| ) | [inline, static] |
Definition at line 204 of file mpegaudiodec.c.
References LL, mod(), MUL64, and shift().
Referenced by mp_decode_layer1(), and mp_decode_layer2().

| int l2_select_table | ( | int | bitrate, | |
| int | nb_channels, | |||
| int | freq, | |||
| int | lsf | |||
| ) |
Definition at line 1330 of file mpegaudiodec.c.
Referenced by mp_decode_layer2(), and MPA_encode_init().
| static int l2_unscale_group | ( | int | steps, | |
| int | mant, | |||
| int | scale_factor | |||
| ) | [inline, static] |
Definition at line 218 of file mpegaudiodec.c.
References mod(), and shift().
Referenced by mp_decode_layer2().

| static int l3_unscale | ( | int | value, | |
| int | exponent | |||
| ) | [inline, static] |
| static void lsf_sf_expand | ( | int * | slen, | |
| int | sf, | |||
| int | n1, | |||
| int | n2, | |||
| int | n3 | |||
| ) | [inline, static] |
| static int mp_decode_frame | ( | MPADecodeContext * | s, | |
| OUT_INT * | samples | |||
| ) | [static] |
Definition at line 2426 of file mpegaudiodec.c.
References MPADecodeContext::dither_state, MPADecodeContext::error_protection, ff_mpa_synth_filter(), FRAC_ONE, MPADecodeContext::gb, get_bits(), HEADER_SIZE, MPADecodeContext::inbuf, MPADecodeContext::inbuf_ptr, init_get_bits(), MPADecodeContext::layer, mp_decode_layer1(), mp_decode_layer2(), mp_decode_layer3(), MPADecodeContext::nb_channels, SBLIMIT, MPADecodeContext::synth_buf_offset, and window.
Referenced by decode_frame(), decode_frame_adu(), and decode_frame_mp3on4().

| static int mp_decode_layer1 | ( | MPADecodeContext * | s | ) | [static] |
Definition at line 1263 of file mpegaudiodec.c.
References MPADecodeContext::gb, get_bits(), l1_unscale(), MPADecodeContext::mode, MPADecodeContext::mode_ext, MPA_JSTEREO, MPA_MAX_CHANNELS, MPADecodeContext::nb_channels, and SBLIMIT.
Referenced by mp_decode_frame().

| static int mp_decode_layer2 | ( | MPADecodeContext * | s | ) | [static] |
Definition at line 1351 of file mpegaudiodec.c.
References alloc_table(), alloc_tables, b, bit_alloc(), MPADecodeContext::bit_rate, bits, MPADecodeContext::gb, get_bits(), l1_unscale(), l2_select_table(), l2_unscale_group(), MPADecodeContext::lsf, MPADecodeContext::mode, MPADecodeContext::mode_ext, MPA_JSTEREO, MPA_MAX_CHANNELS, MPADecodeContext::nb_channels, quant_bits, quant_steps, MPADecodeContext::sample_rate, SBLIMIT, sblimit_table, and steps.
Referenced by mp_decode_frame().

| static int mp_decode_layer3 | ( | MPADecodeContext * | s | ) | [static] |
Definition at line 2129 of file mpegaudiodec.c.
References MPADecodeContext::adu_mode, GranuleDef::big_values, GranuleDef::block_type, MPADecodeContext::compute_antialias, compute_imdct(), compute_stereo(), GranuleDef::count1table_select, DEBUG, exponents_from_scale_factors(), MPADecodeContext::gb, get_bits(), get_bits_count(), get_bitsz(), GranuleDef::global_gain, huffman_decode(), GranuleDef::long_end, MPADecodeContext::lsf, lsf_nsf_table, lsf_sf_expand(), MPADecodeContext::mdct_buf, MPADecodeContext::mode_ext, MODE_EXT_I_STEREO, MODE_EXT_MS_STEREO, MPADecodeContext::nb_channels, GranuleDef::part2_3_length, GranuleDef::preflag, GranuleDef::region_size, reorder_block(), MPADecodeContext::sample_rate_index, GranuleDef::sb_hybrid, GranuleDef::scale_factors, GranuleDef::scalefac_compress, GranuleDef::scalefac_scale, GranuleDef::scfsi, seek_to_maindata(), GranuleDef::short_start, skip_bits(), slen_table, GranuleDef::subblock_gain, GranuleDef::switch_point, and GranuleDef::table_select.
Referenced by mp_decode_frame().

| int mpa_decode_header | ( | AVCodecContext * | avctx, | |
| uint32_t | head | |||
| ) |
Definition at line 1227 of file mpegaudiodec.c.
References MPADecodeContext::bit_rate, AVCodecContext::bit_rate, AVCodecContext::channels, decode_header(), ff_mpa_check_header(), MPADecodeContext::frame_size, AVCodecContext::frame_size, MPADecodeContext::layer, MPADecodeContext::lsf, MPADecodeContext::nb_channels, s, s1, MPADecodeContext::sample_rate, AVCodecContext::sample_rate, and AVCodecContext::sub_id.
Referenced by mpegaudio_parse().

| static always_inline int MULH | ( | int | a, | |
| int | b | |||
| ) | [static] |
Definition at line 74 of file mpegaudiodec.c.
Referenced by compute_imdct(), imdct12(), and imdct36().
| static void reorder_block | ( | MPADecodeContext * | s, | |
| GranuleDef * | g | |||
| ) | [static] |
Definition at line 1754 of file mpegaudiodec.c.
References band_size_short, GranuleDef::block_type, memcpy, MPADecodeContext::sample_rate_index, GranuleDef::sb_hybrid, GranuleDef::short_start, and GranuleDef::switch_point.
Referenced by mp_decode_layer3().
| static int round_sample | ( | int * | sum | ) | [inline, static] |
Definition at line 758 of file mpegaudiodec.c.
References OUT_MAX, OUT_MIN, and OUT_SHIFT.
Referenced by ff_mpa_synth_filter().
| static void seek_to_maindata | ( | MPADecodeContext * | s, | |
| unsigned int | backstep | |||
| ) | [static] |
Definition at line 1564 of file mpegaudiodec.c.
References BACKSTEP_SIZE, GetBitContext::buffer, MPADecodeContext::frame_size, MPADecodeContext::gb, get_bits_count(), MPADecodeContext::inbuf, MPADecodeContext::inbuf1, MPADecodeContext::inbuf_index, init_get_bits(), memcpy, and MPADecodeContext::old_frame_size.
Referenced by mp_decode_layer3().

uint16_t band_index_long[9][23] [static] |
Definition at line 172 of file mpegaudiodec.c.
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 2701 of file mpegaudiodec.c.
int32_t csa_table[8][4] [static] |
Definition at line 180 of file mpegaudiodec.c.
float csa_table_float[8][4] [static] |
Definition at line 181 of file mpegaudiodec.c.
int dev_4_3_coefs[DEV_ORDER] [static] |
Definition at line 258 of file mpegaudiodec.c.
uint8_t* huff_code_table[16] [static] |
Definition at line 169 of file mpegaudiodec.c.
VLC huff_quad_vlc[2] [static] |
Definition at line 170 of file mpegaudiodec.c.
Definition at line 168 of file mpegaudiodec.c.
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 950 of file mpegaudiodec.c.
int32_t is_table[2][16] [static] |
Definition at line 178 of file mpegaudiodec.c.
int32_t is_table_lsf[2][2][16] [static] |
Definition at line 179 of file mpegaudiodec.c.
int32_t mdct_win[8][36] [static] |
Definition at line 182 of file mpegaudiodec.c.
Initial value:
{
"mp2",
CODEC_TYPE_AUDIO,
CODEC_ID_MP2,
sizeof(MPADecodeContext),
decode_init,
NULL,
NULL,
decode_frame,
CODEC_CAP_PARSE_ONLY,
}
Definition at line 2861 of file mpegaudiodec.c.
Referenced by avcodec_register_all().
Initial value:
{
"mp3",
CODEC_TYPE_AUDIO,
CODEC_ID_MP3,
sizeof(MPADecodeContext),
decode_init,
NULL,
NULL,
decode_frame,
CODEC_CAP_PARSE_ONLY,
}
Definition at line 2874 of file mpegaudiodec.c.
Referenced by avcodec_register_all().
Initial value:
{
"mp3adu",
CODEC_TYPE_AUDIO,
CODEC_ID_MP3ADU,
sizeof(MPADecodeContext),
decode_init,
NULL,
NULL,
decode_frame_adu,
CODEC_CAP_PARSE_ONLY,
}
Definition at line 2887 of file mpegaudiodec.c.
Referenced by avcodec_register_all().
int mp3Channels[16] = {0,1,2,3,4,5,6,8,4} [static] |
Definition at line 2699 of file mpegaudiodec.c.
int mp3Frames[16] = {0,1,1,2,3,3,4,5,2} [static] |
Definition at line 2698 of file mpegaudiodec.c.
Initial value:
{
"mp3on4",
CODEC_TYPE_AUDIO,
CODEC_ID_MP3ON4,
sizeof(MP3On4DecodeContext),
decode_init_mp3on4,
NULL,
decode_close_mp3on4,
decode_frame_mp3on4,
0
}
Definition at line 2900 of file mpegaudiodec.c.
Referenced by avcodec_register_all().
uint16_t scale_factor_modshift[64] [static] |
Definition at line 185 of file mpegaudiodec.c.
int32_t scale_factor_mult[15][3] [static] |
const int32_t scale_factor_mult2[3][3] [static] |
Initial value:
Definition at line 193 of file mpegaudiodec.c.
int8_t* table_4_3_exp [static] |
Definition at line 175 of file mpegaudiodec.c.
uint32_t* table_4_3_value [static] |
Definition at line 176 of file mpegaudiodec.c.
1.5.5