Commit 4bac1bbc authored by Mans Rullgard's avatar Mans Rullgard

mpegaudio: add _fixed suffix to some names

This adds a _fixed suffix to the fixed-point versions of things
with both float and fixed-point variants.  This makes it more
consistent with other dual-implementation things, e.g. fft.
Signed-off-by: 's avatarMans Rullgard <mans@mansr.com>
parent d0005d34
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
void ff_mpc_init(void) 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) ...@@ -51,8 +51,8 @@ static void mpc_synth(MPCContext *c, int16_t *out, int channels)
for(ch = 0; ch < channels; ch++){ for(ch = 0; ch < channels; ch++){
samples_ptr = samples + ch; samples_ptr = samples + ch;
for(i = 0; i < SAMPLES_PER_BAND; i++) { for(i = 0; i < SAMPLES_PER_BAND; i++) {
ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]), ff_mpa_synth_filter_fixed(c->synth_buf[ch], &(c->synth_buf_offset[ch]),
ff_mpa_synth_window, &dither_state, ff_mpa_synth_window_fixed, &dither_state,
samples_ptr, channels, samples_ptr, channels,
c->sb_samples[ch][i]); c->sb_samples[ch][i]);
samples_ptr += 32 * channels; samples_ptr += 32 * channels;
......
...@@ -158,9 +158,9 @@ typedef struct HuffTable { ...@@ -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_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); 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[]; extern MPA_INT ff_mpa_synth_window_fixed[];
void ff_mpa_synth_init(MPA_INT *window); void ff_mpa_synth_init_fixed(MPA_INT *window);
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, MPA_INT *window, int *dither_state,
OUT_INT *samples, int incr, OUT_INT *samples, int incr,
INTFLOAT sb_samples[SBLIMIT]); INTFLOAT sb_samples[SBLIMIT]);
......
...@@ -33,9 +33,9 @@ int main(void) ...@@ -33,9 +33,9 @@ int main(void)
WRITE_ARRAY("static const", int8_t, table_4_3_exp); 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, 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_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); WRITE_2D_ARRAY("static const", float, expval_table_float);
return 0; return 0;
......
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
#else #else
static int8_t table_4_3_exp[TABLE_4_3_SIZE]; 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 table_4_3_value[TABLE_4_3_SIZE];
static uint32_t exp_table[512]; static uint32_t exp_table_fixed[512];
static uint32_t expval_table[512][16]; static uint32_t expval_table_fixed[512][16];
static float exp_table_float[512]; static float exp_table_float[512];
static float expval_table_float[512][16]; static float expval_table_float[512][16];
...@@ -59,10 +59,10 @@ static void mpegaudio_tableinit(void) ...@@ -59,10 +59,10 @@ static void mpegaudio_tableinit(void)
for (exponent = 0; exponent < 512; exponent++) { for (exponent = 0; exponent < 512; exponent++) {
for (value = 0; value < 16; value++) { for (value = 0; value < 16; value++) {
double f = (double)value * cbrtf(value) * pow(2, (exponent - 400) * 0.25 + FRAC_BITS + 5); 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; 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]; exp_table_float[exponent] = expval_table_float[exponent][1];
} }
} }
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
# define FIXHR(a) ((int)((a) * (1LL<<32) + 0.5)) # define FIXHR(a) ((int)((a) * (1LL<<32) + 0.5))
# define MULH3(x, y, s) MULH((s)*(x), y) # define MULH3(x, y, s) MULH((s)*(x), y)
# define MULLx(x, y, s) MULL(x,y,s) # 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 # define OUT_FMT AV_SAMPLE_FMT_S16
#endif #endif
...@@ -621,7 +621,7 @@ static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window, ...@@ -621,7 +621,7 @@ static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window,
32 samples. */ 32 samples. */
/* XXX: optimize by avoiding ring buffer usage */ /* XXX: optimize by avoiding ring buffer usage */
#if !CONFIG_FLOAT #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, MPA_INT *window, int *dither_state,
OUT_INT *samples, int incr, OUT_INT *samples, int incr,
INTFLOAT sb_samples[SBLIMIT]) INTFLOAT sb_samples[SBLIMIT])
......
...@@ -1616,8 +1616,8 @@ static void qdm2_synthesis_filter (QDM2Context *q, int index) ...@@ -1616,8 +1616,8 @@ static void qdm2_synthesis_filter (QDM2Context *q, int index)
OUT_INT *samples_ptr = samples + ch; OUT_INT *samples_ptr = samples + ch;
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
ff_mpa_synth_filter(q->synth_buf[ch], &(q->synth_buf_offset[ch]), ff_mpa_synth_filter_fixed(q->synth_buf[ch], &(q->synth_buf_offset[ch]),
ff_mpa_synth_window, &dither_state, ff_mpa_synth_window_fixed, &dither_state,
samples_ptr, q->nb_channels, samples_ptr, q->nb_channels,
q->sb_samples[ch][(8 * index) + i]); q->sb_samples[ch][(8 * index) + i]);
samples_ptr += 32 * q->nb_channels; samples_ptr += 32 * q->nb_channels;
...@@ -1646,7 +1646,7 @@ static av_cold void qdm2_init(QDM2Context *q) { ...@@ -1646,7 +1646,7 @@ static av_cold void qdm2_init(QDM2Context *q) {
initialized = 1; initialized = 1;
qdm2_init_vlc(); qdm2_init_vlc();
ff_mpa_synth_init(ff_mpa_synth_window); ff_mpa_synth_init_fixed(ff_mpa_synth_window_fixed);
softclip_table_init(); softclip_table_init();
rnd_table_init(); rnd_table_init();
init_noise_samples(); init_noise_samples();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment