* MPEG Audio decoder.
*/
+#include "libavutil/audioconvert.h"
#include "avcodec.h"
#include "get_bits.h"
#include "dsputil.h"
#include "mathops.h"
#if CONFIG_FLOAT
-# define SHR(a,b) ((a)*(1.0/(1<<(b))))
+# define SHR(a,b) ((a)*(1.0f/(1<<(b))))
# define compute_antialias compute_antialias_float
# define FIXR_OLD(a) ((int)((a) * FRAC_ONE + 0.5))
-# define FIXR(x) (x)
-# define FIXHR(x) (x)
+# define FIXR(x) ((float)(x))
+# define FIXHR(x) ((float)(x))
# define MULH3(x, y, s) ((s)*(y)*(x))
# define MULLx(x, y, s) ((y)*(x))
# define RENAME(a) a ## _float
#include "mpegaudiodata.h"
#include "mpegaudiodectab.h"
-static void compute_antialias_integer(MPADecodeContext *s, GranuleDef *g);
-static void compute_antialias_float(MPADecodeContext *s, GranuleDef *g);
+#if CONFIG_FLOAT
+# include "fft.h"
+#else
+# include "dct32.c"
+#endif
+
+static void compute_antialias(MPADecodeContext *s, GranuleDef *g);
+static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window,
+ int *dither_state, OUT_INT *samples, int incr);
/* vlc structure for decoding layer 3 huffman tables */
static VLC huff_vlc[16];
static float csa_table_float[8][4];
static INTFLOAT mdct_win[8][36];
+static int16_t division_tab3[1<<6 ];
+static int16_t division_tab5[1<<8 ];
+static int16_t division_tab9[1<<11];
+
+static int16_t * const division_tabs[4] = {
+ division_tab3, division_tab5, NULL, division_tab9
+};
+
/* lower 2 bits: modulo 3, higher bits: shift */
static uint16_t scale_factor_modshift[64];
/* [i][j]: 2^(-j/3) * FRAC_ONE * 2^(i+2) / (2^(i+2) - 1) */
SCALE_GEN(4.0 / 9.0), /* 9 steps */
};
-DECLARE_ALIGNED(16, MPA_INT, RENAME(ff_mpa_synth_window))[512];
+DECLARE_ALIGNED(16, MPA_INT, RENAME(ff_mpa_synth_window))[512+256];
/**
* Convert region offsets to region sizes and truncate
int i, j, k;
s->avctx = avctx;
+ s->apply_window_mp3 = apply_window_mp3_c;
+#if HAVE_MMX && CONFIG_FLOAT
+ ff_mpegaudiodec_init_mmx(s);
+#endif
+#if CONFIG_FLOAT
+ ff_dct_init(&s->dct, 5, DCT_II);
+#endif
+ if (HAVE_ALTIVEC && CONFIG_FLOAT) ff_mpegaudiodec_init_altivec(s);
avctx->sample_fmt= OUT_FMT;
s->error_recognition= avctx->error_recognition;
scale_factor_mult[i][0] = MULLx(norm, FIXR(1.0 * 2.0), FRAC_BITS);
scale_factor_mult[i][1] = MULLx(norm, FIXR(0.7937005259 * 2.0), FRAC_BITS);
scale_factor_mult[i][2] = MULLx(norm, FIXR(0.6299605249 * 2.0), FRAC_BITS);
- dprintf(avctx, "%d: norm=%x s=%x %x %x\n",
+ av_dlog(avctx, "%d: norm=%x s=%x %x %x\n",
i, norm,
scale_factor_mult[i][0],
scale_factor_mult[i][1],
int_pow_init();
mpegaudio_tableinit();
+ for (i = 0; i < 4; i++)
+ if (ff_mpa_quant_bits[i] < 0)
+ for (j = 0; j < (1<<(-ff_mpa_quant_bits[i]+1)); j++) {
+ int val1, val2, val3, steps;
+ int val = j;
+ steps = ff_mpa_quant_steps[i];
+ val1 = val % steps;
+ val /= steps;
+ val2 = val % steps;
+ val3 = val / steps;
+ division_tabs[i][j] = val1 + (val2 << 4) + (val3 << 8);
+ }
+
+
for(i=0;i<7;i++) {
float f;
INTFLOAT v;
k = i & 1;
is_table_lsf[j][k ^ 1][i] = FIXR(f);
is_table_lsf[j][k][i] = FIXR(1.0);
- dprintf(avctx, "is_table_lsf %d %d: %x %x\n",
+ av_dlog(avctx, "is_table_lsf %d %d: %x %x\n",
i, j, is_table_lsf[j][0][i], is_table_lsf[j][1][i]);
}
}
return 0;
}
-/* tab[i][j] = 1.0 / (2.0 * cos(pi*(2*k+1) / 2^(6 - j))) */
-
-/* cos(i*pi/64) */
-
-#define COS0_0 FIXHR(0.50060299823519630134/2)
-#define COS0_1 FIXHR(0.50547095989754365998/2)
-#define COS0_2 FIXHR(0.51544730992262454697/2)
-#define COS0_3 FIXHR(0.53104259108978417447/2)
-#define COS0_4 FIXHR(0.55310389603444452782/2)
-#define COS0_5 FIXHR(0.58293496820613387367/2)
-#define COS0_6 FIXHR(0.62250412303566481615/2)
-#define COS0_7 FIXHR(0.67480834145500574602/2)
-#define COS0_8 FIXHR(0.74453627100229844977/2)
-#define COS0_9 FIXHR(0.83934964541552703873/2)
-#define COS0_10 FIXHR(0.97256823786196069369/2)
-#define COS0_11 FIXHR(1.16943993343288495515/4)
-#define COS0_12 FIXHR(1.48416461631416627724/4)
-#define COS0_13 FIXHR(2.05778100995341155085/8)
-#define COS0_14 FIXHR(3.40760841846871878570/8)
-#define COS0_15 FIXHR(10.19000812354805681150/32)
-
-#define COS1_0 FIXHR(0.50241928618815570551/2)
-#define COS1_1 FIXHR(0.52249861493968888062/2)
-#define COS1_2 FIXHR(0.56694403481635770368/2)
-#define COS1_3 FIXHR(0.64682178335999012954/2)
-#define COS1_4 FIXHR(0.78815462345125022473/2)
-#define COS1_5 FIXHR(1.06067768599034747134/4)
-#define COS1_6 FIXHR(1.72244709823833392782/4)
-#define COS1_7 FIXHR(5.10114861868916385802/16)
-
-#define COS2_0 FIXHR(0.50979557910415916894/2)
-#define COS2_1 FIXHR(0.60134488693504528054/2)
-#define COS2_2 FIXHR(0.89997622313641570463/2)
-#define COS2_3 FIXHR(2.56291544774150617881/8)
-
-#define COS3_0 FIXHR(0.54119610014619698439/2)
-#define COS3_1 FIXHR(1.30656296487637652785/4)
-
-#define COS4_0 FIXHR(0.70710678118654752439/2)
-
-/* butterfly operator */
-#define BF(a, b, c, s)\
-{\
- tmp0 = tab[a] + tab[b];\
- tmp1 = tab[a] - tab[b];\
- tab[a] = tmp0;\
- tab[b] = MULH3(tmp1, c, 1<<(s));\
-}
-
-#define BF1(a, b, c, d)\
-{\
- BF(a, b, COS4_0, 1);\
- BF(c, d,-COS4_0, 1);\
- tab[c] += tab[d];\
-}
-
-#define BF2(a, b, c, d)\
-{\
- BF(a, b, COS4_0, 1);\
- BF(c, d,-COS4_0, 1);\
- tab[c] += tab[d];\
- tab[a] += tab[c];\
- tab[c] += tab[b];\
- tab[b] += tab[d];\
-}
-
-#define ADD(a, b) tab[a] += tab[b]
-
-/* DCT32 without 1/sqrt(2) coef zero scaling. */
-static void dct32(INTFLOAT *out, INTFLOAT *tab)
-{
- INTFLOAT tmp0, tmp1;
-
- /* pass 1 */
- BF( 0, 31, COS0_0 , 1);
- BF(15, 16, COS0_15, 5);
- /* pass 2 */
- BF( 0, 15, COS1_0 , 1);
- BF(16, 31,-COS1_0 , 1);
- /* pass 1 */
- BF( 7, 24, COS0_7 , 1);
- BF( 8, 23, COS0_8 , 1);
- /* pass 2 */
- BF( 7, 8, COS1_7 , 4);
- BF(23, 24,-COS1_7 , 4);
- /* pass 3 */
- BF( 0, 7, COS2_0 , 1);
- BF( 8, 15,-COS2_0 , 1);
- BF(16, 23, COS2_0 , 1);
- BF(24, 31,-COS2_0 , 1);
- /* pass 1 */
- BF( 3, 28, COS0_3 , 1);
- BF(12, 19, COS0_12, 2);
- /* pass 2 */
- BF( 3, 12, COS1_3 , 1);
- BF(19, 28,-COS1_3 , 1);
- /* pass 1 */
- BF( 4, 27, COS0_4 , 1);
- BF(11, 20, COS0_11, 2);
- /* pass 2 */
- BF( 4, 11, COS1_4 , 1);
- BF(20, 27,-COS1_4 , 1);
- /* pass 3 */
- BF( 3, 4, COS2_3 , 3);
- BF(11, 12,-COS2_3 , 3);
- BF(19, 20, COS2_3 , 3);
- BF(27, 28,-COS2_3 , 3);
- /* pass 4 */
- BF( 0, 3, COS3_0 , 1);
- BF( 4, 7,-COS3_0 , 1);
- BF( 8, 11, COS3_0 , 1);
- BF(12, 15,-COS3_0 , 1);
- BF(16, 19, COS3_0 , 1);
- BF(20, 23,-COS3_0 , 1);
- BF(24, 27, COS3_0 , 1);
- BF(28, 31,-COS3_0 , 1);
-
-
-
- /* pass 1 */
- BF( 1, 30, COS0_1 , 1);
- BF(14, 17, COS0_14, 3);
- /* pass 2 */
- BF( 1, 14, COS1_1 , 1);
- BF(17, 30,-COS1_1 , 1);
- /* pass 1 */
- BF( 6, 25, COS0_6 , 1);
- BF( 9, 22, COS0_9 , 1);
- /* pass 2 */
- BF( 6, 9, COS1_6 , 2);
- BF(22, 25,-COS1_6 , 2);
- /* pass 3 */
- BF( 1, 6, COS2_1 , 1);
- BF( 9, 14,-COS2_1 , 1);
- BF(17, 22, COS2_1 , 1);
- BF(25, 30,-COS2_1 , 1);
-
- /* pass 1 */
- BF( 2, 29, COS0_2 , 1);
- BF(13, 18, COS0_13, 3);
- /* pass 2 */
- BF( 2, 13, COS1_2 , 1);
- BF(18, 29,-COS1_2 , 1);
- /* pass 1 */
- BF( 5, 26, COS0_5 , 1);
- BF(10, 21, COS0_10, 1);
- /* pass 2 */
- BF( 5, 10, COS1_5 , 2);
- BF(21, 26,-COS1_5 , 2);
- /* pass 3 */
- BF( 2, 5, COS2_2 , 1);
- BF(10, 13,-COS2_2 , 1);
- BF(18, 21, COS2_2 , 1);
- BF(26, 29,-COS2_2 , 1);
- /* pass 4 */
- BF( 1, 2, COS3_1 , 2);
- BF( 5, 6,-COS3_1 , 2);
- BF( 9, 10, COS3_1 , 2);
- BF(13, 14,-COS3_1 , 2);
- BF(17, 18, COS3_1 , 2);
- BF(21, 22,-COS3_1 , 2);
- BF(25, 26, COS3_1 , 2);
- BF(29, 30,-COS3_1 , 2);
-
- /* pass 5 */
- BF1( 0, 1, 2, 3);
- BF2( 4, 5, 6, 7);
- BF1( 8, 9, 10, 11);
- BF2(12, 13, 14, 15);
- BF1(16, 17, 18, 19);
- BF2(20, 21, 22, 23);
- BF1(24, 25, 26, 27);
- BF2(28, 29, 30, 31);
-
- /* pass 6 */
-
- ADD( 8, 12);
- ADD(12, 10);
- ADD(10, 14);
- ADD(14, 9);
- ADD( 9, 13);
- ADD(13, 11);
- ADD(11, 15);
-
- out[ 0] = tab[0];
- out[16] = tab[1];
- out[ 8] = tab[2];
- out[24] = tab[3];
- out[ 4] = tab[4];
- out[20] = tab[5];
- out[12] = tab[6];
- out[28] = tab[7];
- out[ 2] = tab[8];
- out[18] = tab[9];
- out[10] = tab[10];
- out[26] = tab[11];
- out[ 6] = tab[12];
- out[22] = tab[13];
- out[14] = tab[14];
- out[30] = tab[15];
-
- ADD(24, 28);
- ADD(28, 26);
- ADD(26, 30);
- ADD(30, 25);
- ADD(25, 29);
- ADD(29, 27);
- ADD(27, 31);
-
- out[ 1] = tab[16] + tab[24];
- out[17] = tab[17] + tab[25];
- out[ 9] = tab[18] + tab[26];
- out[25] = tab[19] + tab[27];
- out[ 5] = tab[20] + tab[28];
- out[21] = tab[21] + tab[29];
- out[13] = tab[22] + tab[30];
- out[29] = tab[23] + tab[31];
- out[ 3] = tab[24] + tab[20];
- out[19] = tab[25] + tab[21];
- out[11] = tab[26] + tab[22];
- out[27] = tab[27] + tab[23];
- out[ 7] = tab[28] + tab[18];
- out[23] = tab[29] + tab[19];
- out[15] = tab[30] + tab[17];
- out[31] = tab[31];
-}
#if CONFIG_FLOAT
static inline float round_sample(float *sum)
void av_cold RENAME(ff_mpa_synth_init)(MPA_INT *window)
{
- int i;
+ int i, j;
/* max = 18760, max sum over all 16 coefs : 44736 */
for(i=0;i<257;i++) {
if (i != 0)
window[512 - i] = v;
}
+
+ // Needed for avoiding shuffles in ASM implementations
+ for(i=0; i < 8; i++)
+ for(j=0; j < 16; j++)
+ window[512+16*i+j] = window[64*i+32-j];
+
+ for(i=0; i < 8; i++)
+ for(j=0; j < 16; j++)
+ window[512+128+16*i+j] = window[64*i+48-j];
}
-/* 32 sub band synthesis filter. Input: 32 sub band samples, Output:
- 32 samples. */
-/* XXX: optimize by avoiding ring buffer usage */
-void RENAME(ff_mpa_synth_filter)(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
- MPA_INT *window, int *dither_state,
- OUT_INT *samples, int incr,
- INTFLOAT sb_samples[SBLIMIT])
+static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window,
+ int *dither_state, OUT_INT *samples, int incr)
{
- register MPA_INT *synth_buf;
register const MPA_INT *w, *w2, *p;
- int j, offset;
+ int j;
OUT_INT *samples2;
#if CONFIG_FLOAT
float sum, sum2;
#elif FRAC_BITS <= 15
- int32_t tmp[32];
int sum, sum2;
#else
int64_t sum, sum2;
#endif
- offset = *synth_buf_offset;
- synth_buf = synth_buf_ptr + offset;
-
-#if FRAC_BITS <= 15
- assert(!CONFIG_FLOAT);
- dct32(tmp, sb_samples);
- for(j=0;j<32;j++) {
- /* NOTE: can cause a loss in precision if very high amplitude
- sound */
- synth_buf[j] = av_clip_int16(tmp[j]);
- }
-#else
- dct32(synth_buf, sb_samples);
-#endif
-
/* copy to avoid wrap */
memcpy(synth_buf + 512, synth_buf, 32 * sizeof(*synth_buf));
SUM8(MLSS, sum, w + 32, p);
*samples = round_sample(&sum);
*dither_state= sum;
+}
+
+
+/* 32 sub band synthesis filter. Input: 32 sub band samples, Output:
+ 32 samples. */
+/* XXX: optimize by avoiding ring buffer usage */
+#if !CONFIG_FLOAT
+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,
+ INTFLOAT sb_samples[SBLIMIT])
+{
+ register MPA_INT *synth_buf;
+ int offset;
+#if FRAC_BITS <= 15
+ int32_t tmp[32];
+ int j;
+#endif
+
+ offset = *synth_buf_offset;
+ synth_buf = synth_buf_ptr + offset;
+
+#if FRAC_BITS <= 15
+ dct32(tmp, sb_samples);
+ for(j=0;j<32;j++) {
+ /* NOTE: can cause a loss in precision if very high amplitude
+ sound */
+ synth_buf[j] = av_clip_int16(tmp[j]);
+ }
+#else
+ dct32(synth_buf, sb_samples);
+#endif
+
+ apply_window_mp3_c(synth_buf, window, dither_state, samples, incr);
offset = (offset - 32) & 511;
*synth_buf_offset = offset;
}
+#endif
#define C3 FIXHR(0.86602540378443864676/2)
else
bound = sblimit;
- dprintf(s->avctx, "bound=%d sblimit=%d\n", bound, sblimit);
+ av_dlog(s->avctx, "bound=%d sblimit=%d\n", bound, sblimit);
/* sanity check */
if( bound > sblimit ) bound = sblimit;
qindex = alloc_table[j+b];
bits = ff_mpa_quant_bits[qindex];
if (bits < 0) {
+ int v2;
/* 3 values at the same time */
v = get_bits(&s->gb, -bits);
- steps = ff_mpa_quant_steps[qindex];
+ v2 = division_tabs[qindex][v];
+ steps = ff_mpa_quant_steps[qindex];
+
s->sb_samples[ch][k * 12 + l + 0][i] =
- l2_unscale_group(steps, v % steps, scale);
- v = v / steps;
+ l2_unscale_group(steps, v2 & 15, scale);
s->sb_samples[ch][k * 12 + l + 1][i] =
- l2_unscale_group(steps, v % steps, scale);
- v = v / steps;
+ l2_unscale_group(steps, (v2 >> 4) & 15, scale);
s->sb_samples[ch][k * 12 + l + 2][i] =
- l2_unscale_group(steps, v, scale);
+ l2_unscale_group(steps, v2 >> 8 , scale);
} else {
for(m=0;m<3;m++) {
v = get_bits(&s->gb, bits);
exponent= exponents[s_index];
- dprintf(s->avctx, "region=%d n=%d x=%d y=%d exp=%d\n",
+ av_dlog(s->avctx, "region=%d n=%d x=%d y=%d exp=%d\n",
i, g->region_size[i] - j, x, y, exponent);
if(y&16){
x = y >> 5;
last_pos= pos;
code = get_vlc2(&s->gb, vlc->table, vlc->bits, 1);
- dprintf(s->avctx, "t=%d code=%d\n", g->count1table_select, code);
+ av_dlog(s->avctx, "t=%d code=%d\n", g->count1table_select, code);
g->sb_hybrid[s_index+0]=
g->sb_hybrid[s_index+1]=
g->sb_hybrid[s_index+2]=
}
}
+#if !CONFIG_FLOAT
static void compute_antialias_integer(MPADecodeContext *s,
GranuleDef *g)
{
ptr += 18;
}
}
-
-static void compute_antialias_float(MPADecodeContext *s,
- GranuleDef *g)
-{
- float *ptr;
- int n, i;
-
- /* we antialias only "long" bands */
- if (g->block_type == 2) {
- if (!g->switch_point)
- return;
- /* XXX: check this for 8000Hz case */
- n = 1;
- } else {
- n = SBLIMIT - 1;
- }
-
- ptr = g->sb_hybrid + 18;
- for(i = n;i > 0;i--) {
- float tmp0, tmp1;
- float *csa = &csa_table_float[0][0];
-#define FLOAT_AA(j)\
- tmp0= ptr[-1-j];\
- tmp1= ptr[ j];\
- ptr[-1-j] = tmp0 * csa[0+4*j] - tmp1 * csa[1+4*j];\
- ptr[ j] = tmp0 * csa[1+4*j] + tmp1 * csa[0+4*j];
-
- FLOAT_AA(0)
- FLOAT_AA(1)
- FLOAT_AA(2)
- FLOAT_AA(3)
- FLOAT_AA(4)
- FLOAT_AA(5)
- FLOAT_AA(6)
- FLOAT_AA(7)
-
- ptr += 18;
- }
-}
+#endif
static void compute_imdct(MPADecodeContext *s,
GranuleDef *g,
for(gr=0;gr<nb_granules;gr++) {
for(ch=0;ch<s->nb_channels;ch++) {
- dprintf(s->avctx, "gr=%d ch=%d: side_info\n", gr, ch);
+ av_dlog(s->avctx, "gr=%d ch=%d: side_info\n", gr, ch);
g = &s->granules[ch][gr];
g->part2_3_length = get_bits(&s->gb, 12);
g->big_values = get_bits(&s->gb, 9);
/* compute huffman coded region sizes */
region_address1 = get_bits(&s->gb, 4);
region_address2 = get_bits(&s->gb, 3);
- dprintf(s->avctx, "region1=%d region2=%d\n",
+ av_dlog(s->avctx, "region1=%d region2=%d\n",
region_address1, region_address2);
ff_init_long_region(s, g, region_address1, region_address2);
}
g->preflag = get_bits1(&s->gb);
g->scalefac_scale = get_bits1(&s->gb);
g->count1table_select = get_bits1(&s->gb);
- dprintf(s->avctx, "block_type=%d switch_point=%d\n",
+ av_dlog(s->avctx, "block_type=%d switch_point=%d\n",
g->block_type, g->switch_point);
}
}
const uint8_t *ptr = s->gb.buffer + (get_bits_count(&s->gb)>>3);
assert((get_bits_count(&s->gb) & 7) == 0);
/* now we get bits from the main_data_begin offset */
- dprintf(s->avctx, "seekback: %d\n", main_data_begin);
+ av_dlog(s->avctx, "seekback: %d\n", main_data_begin);
//av_log(NULL, AV_LOG_ERROR, "backstep:%d, lastbuf:%d\n", main_data_begin, s->last_buf_size);
memcpy(s->last_buf + s->last_buf_size, ptr, EXTRABYTES);
/* MPEG1 scale factors */
slen1 = slen_table[0][g->scalefac_compress];
slen2 = slen_table[1][g->scalefac_compress];
- dprintf(s->avctx, "slen1=%d slen2=%d\n", slen1, slen2);
+ av_dlog(s->avctx, "slen1=%d slen2=%d\n", slen1, slen2);
if (g->block_type == 2) {
n = g->switch_point ? 17 : 18;
j = 0;
if (s->error_protection)
skip_bits(&s->gb, 16);
- dprintf(s->avctx, "frame %d:\n", s->frame_count);
+ av_dlog(s->avctx, "frame %d:\n", s->frame_count);
switch(s->layer) {
case 1:
s->avctx->frame_size = 384;
for(ch=0;ch<s->nb_channels;ch++) {
samples_ptr = samples + ch;
for(i=0;i<nb_frames;i++) {
- RENAME(ff_mpa_synth_filter)(s->synth_buf[ch], &(s->synth_buf_offset[ch]),
+ RENAME(ff_mpa_synth_filter)(
+#if CONFIG_FLOAT
+ s,
+#endif
+ s->synth_buf[ch], &(s->synth_buf_offset[ch]),
RENAME(ff_mpa_synth_window), &s->dither_state,
samples_ptr, s->nb_channels,
s->sb_samples[ch][i]);
}
/* update codec info */
avctx->channels = s->nb_channels;
- avctx->bit_rate = s->bit_rate;
+ avctx->channel_layout = s->nb_channels == 1 ? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO;
+ if (!avctx->bit_rate)
+ avctx->bit_rate = s->bit_rate;
avctx->sub_id = s->layer;
if(*data_size < 1152*avctx->channels*sizeof(OUT_INT))
s->last_buf_size= 0;
}
-#if CONFIG_MP3ADU_DECODER
+#if CONFIG_MP3ADU_DECODER || CONFIG_MP3ADUFLOAT_DECODER
static int decode_frame_adu(AVCodecContext * avctx,
void *data, int *data_size,
AVPacket *avpkt)
/* update codec info */
avctx->sample_rate = s->sample_rate;
avctx->channels = s->nb_channels;
- avctx->bit_rate = s->bit_rate;
+ if (!avctx->bit_rate)
+ avctx->bit_rate = s->bit_rate;
avctx->sub_id = s->layer;
s->frame_size = len;
*data_size = out_size;
return buf_size;
}
-#endif /* CONFIG_MP3ADU_DECODER */
+#endif /* CONFIG_MP3ADU_DECODER || CONFIG_MP3ADUFLOAT_DECODER */
-#if CONFIG_MP3ON4_DECODER
+#if CONFIG_MP3ON4_DECODER || CONFIG_MP3ON4FLOAT_DECODER
/**
* Context for MP3On4 decoder
int i;
for (i = 0; i < s->frames; i++)
- if (s->mp3decctx[i])
- av_free(s->mp3decctx[i]);
+ av_free(s->mp3decctx[i]);
return 0;
}
*data_size = out_size;
return buf_size;
}
-#endif /* CONFIG_MP3ON4_DECODER */
+#endif /* CONFIG_MP3ON4_DECODER || CONFIG_MP3ON4FLOAT_DECODER */
#if !CONFIG_FLOAT
#if CONFIG_MP1_DECODER
-AVCodec mp1_decoder =
+AVCodec ff_mp1_decoder =
{
"mp1",
AVMEDIA_TYPE_AUDIO,
};
#endif
#if CONFIG_MP2_DECODER
-AVCodec mp2_decoder =
+AVCodec ff_mp2_decoder =
{
"mp2",
AVMEDIA_TYPE_AUDIO,
};
#endif
#if CONFIG_MP3_DECODER
-AVCodec mp3_decoder =
+AVCodec ff_mp3_decoder =
{
"mp3",
AVMEDIA_TYPE_AUDIO,
};
#endif
#if CONFIG_MP3ADU_DECODER
-AVCodec mp3adu_decoder =
+AVCodec ff_mp3adu_decoder =
{
"mp3adu",
AVMEDIA_TYPE_AUDIO,
};
#endif
#if CONFIG_MP3ON4_DECODER
-AVCodec mp3on4_decoder =
+AVCodec ff_mp3on4_decoder =
{
"mp3on4",
AVMEDIA_TYPE_AUDIO,