diff --git a/libavcodec/mpc.c b/libavcodec/mpc.c index 36e0f04539..15febefe0b 100644 --- a/libavcodec/mpc.c +++ b/libavcodec/mpc.c @@ -36,7 +36,7 @@ void ff_mpc_init(void) { - ff_mpa_synth_init(ff_mpa_synth_window); + ff_mpa_synth_init_fixed(ff_mpa_synth_window_fixed); } /** @@ -51,8 +51,8 @@ static void mpc_synth(MPCContext *c, int16_t *out, int channels) for(ch = 0; ch < channels; ch++){ samples_ptr = samples + ch; for(i = 0; i < SAMPLES_PER_BAND; i++) { - ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]), - ff_mpa_synth_window, &dither_state, + ff_mpa_synth_filter_fixed(c->synth_buf[ch], &(c->synth_buf_offset[ch]), + ff_mpa_synth_window_fixed, &dither_state, samples_ptr, channels, c->sb_samples[ch][i]); samples_ptr += 32 * channels; diff --git a/libavcodec/mpegaudio.h b/libavcodec/mpegaudio.h index 2c3f2ec065..3422b6df68 100644 --- a/libavcodec/mpegaudio.h +++ b/libavcodec/mpegaudio.h @@ -158,9 +158,9 @@ typedef struct HuffTable { int ff_mpa_l2_select_table(int bitrate, int nb_channels, int freq, int lsf); int ff_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bitrate); -extern MPA_INT ff_mpa_synth_window[]; -void ff_mpa_synth_init(MPA_INT *window); -void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset, +extern MPA_INT ff_mpa_synth_window_fixed[]; +void ff_mpa_synth_init_fixed(MPA_INT *window); +void ff_mpa_synth_filter_fixed(MPA_INT *synth_buf_ptr, int *synth_buf_offset, MPA_INT *window, int *dither_state, OUT_INT *samples, int incr, INTFLOAT sb_samples[SBLIMIT]); diff --git a/libavcodec/mpegaudio_tablegen.c b/libavcodec/mpegaudio_tablegen.c index 27da2191d9..b4c240bd7c 100644 --- a/libavcodec/mpegaudio_tablegen.c +++ b/libavcodec/mpegaudio_tablegen.c @@ -33,9 +33,9 @@ int main(void) WRITE_ARRAY("static const", int8_t, table_4_3_exp); WRITE_ARRAY("static const", uint32_t, table_4_3_value); - WRITE_ARRAY("static const", uint32_t, exp_table); + WRITE_ARRAY("static const", uint32_t, exp_table_fixed); WRITE_ARRAY("static const", float, exp_table_float); - WRITE_2D_ARRAY("static const", uint32_t, expval_table); + WRITE_2D_ARRAY("static const", uint32_t, expval_table_fixed); WRITE_2D_ARRAY("static const", float, expval_table_float); return 0; diff --git a/libavcodec/mpegaudio_tablegen.h b/libavcodec/mpegaudio_tablegen.h index 6bde277916..2264b739d2 100644 --- a/libavcodec/mpegaudio_tablegen.h +++ b/libavcodec/mpegaudio_tablegen.h @@ -33,8 +33,8 @@ #else 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 uint32_t exp_table_fixed[512]; +static uint32_t expval_table_fixed[512][16]; static float exp_table_float[512]; static float expval_table_float[512][16]; @@ -59,10 +59,10 @@ static void mpegaudio_tableinit(void) for (exponent = 0; exponent < 512; exponent++) { for (value = 0; value < 16; value++) { double f = (double)value * cbrtf(value) * pow(2, (exponent - 400) * 0.25 + FRAC_BITS + 5); - expval_table[exponent][value] = llrint(f); + expval_table_fixed[exponent][value] = llrint(f); expval_table_float[exponent][value] = f; } - exp_table[exponent] = expval_table[exponent][1]; + exp_table_fixed[exponent] = expval_table_fixed[exponent][1]; exp_table_float[exponent] = expval_table_float[exponent][1]; } } diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 35e217ea3e..77ecb44c9e 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -58,7 +58,7 @@ # define FIXHR(a) ((int)((a) * (1LL<<32) + 0.5)) # define MULH3(x, y, s) MULH((s)*(x), y) # define MULLx(x, y, s) MULL(x,y,s) -# define RENAME(a) a +# define RENAME(a) a ## _fixed # define OUT_FMT AV_SAMPLE_FMT_S16 #endif @@ -621,7 +621,7 @@ static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window, 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, +void ff_mpa_synth_filter_fixed(MPA_INT *synth_buf_ptr, int *synth_buf_offset, MPA_INT *window, int *dither_state, OUT_INT *samples, int incr, INTFLOAT sb_samples[SBLIMIT]) diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index 76ecb79621..0f4dd18966 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -1616,8 +1616,8 @@ static void qdm2_synthesis_filter (QDM2Context *q, int index) OUT_INT *samples_ptr = samples + ch; for (i = 0; i < 8; i++) { - ff_mpa_synth_filter(q->synth_buf[ch], &(q->synth_buf_offset[ch]), - ff_mpa_synth_window, &dither_state, + ff_mpa_synth_filter_fixed(q->synth_buf[ch], &(q->synth_buf_offset[ch]), + ff_mpa_synth_window_fixed, &dither_state, samples_ptr, q->nb_channels, q->sb_samples[ch][(8 * index) + i]); samples_ptr += 32 * q->nb_channels; @@ -1646,7 +1646,7 @@ static av_cold void qdm2_init(QDM2Context *q) { initialized = 1; qdm2_init_vlc(); - ff_mpa_synth_init(ff_mpa_synth_window); + ff_mpa_synth_init_fixed(ff_mpa_synth_window_fixed); softclip_table_init(); rnd_table_init(); init_noise_samples();