diff --git a/libavcodec/mpegaudio.h b/libavcodec/mpegaudio.h index b880b7a832..1591a170d7 100644 --- a/libavcodec/mpegaudio.h +++ b/libavcodec/mpegaudio.h @@ -26,8 +26,8 @@ #ifndef AVCODEC_MPEGAUDIO_H #define AVCODEC_MPEGAUDIO_H -#ifndef CONFIG_FLOAT -# define CONFIG_FLOAT 0 +#ifndef USE_FLOATS +# define USE_FLOATS 0 #endif #include @@ -58,7 +58,7 @@ #define FIX(a) ((int)((a) * FRAC_ONE)) -#if CONFIG_FLOAT +#if USE_FLOATS # define INTFLOAT float typedef float MPA_INT; typedef float OUT_INT; diff --git a/libavcodec/mpegaudiodec_fixed.c b/libavcodec/mpegaudiodec_fixed.c index 92121bba9a..904c88561d 100644 --- a/libavcodec/mpegaudiodec_fixed.c +++ b/libavcodec/mpegaudiodec_fixed.c @@ -21,7 +21,7 @@ #include "config.h" #include "libavutil/samplefmt.h" -#define CONFIG_FLOAT 0 +#define USE_FLOATS 0 #include "mpegaudio.h" diff --git a/libavcodec/mpegaudiodec_float.c b/libavcodec/mpegaudiodec_float.c index 7b50778979..35f07fabb8 100644 --- a/libavcodec/mpegaudiodec_float.c +++ b/libavcodec/mpegaudiodec_float.c @@ -22,7 +22,7 @@ #include "config.h" #include "libavutil/samplefmt.h" -#define CONFIG_FLOAT 1 +#define USE_FLOATS 1 #include "mpegaudio.h" diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index 8ca0970ef7..1f29679d91 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -392,7 +392,7 @@ static av_cold void decode_init_static(void) ci = ci_table[i]; cs = 1.0 / sqrt(1.0 + ci * ci); ca = cs * ci; -#if !CONFIG_FLOAT +#if !USE_FLOATS csa_table[i][0] = FIXHR(cs/4); csa_table[i][1] = FIXHR(ca/4); csa_table[i][2] = FIXHR(ca/4) + FIXHR(cs/4); @@ -828,7 +828,7 @@ static void switch_buffer(MPADecodeContext *s, int *pos, int *end_pos, v = -v; *dst = v; */ -#if CONFIG_FLOAT +#if USE_FLOATS #define READ_FLIP_SIGN(dst,src) \ v = AV_RN32A(src) ^ (get_bits1(&s->gb) << 31); \ AV_WN32A(dst, v); @@ -1137,7 +1137,7 @@ found2: /* ms stereo ONLY */ /* NOTE: the 1/sqrt(2) normalization factor is included in the global gain */ -#if CONFIG_FLOAT +#if USE_FLOATS s->fdsp.butterflies_float(g0->sb_hybrid, g1->sb_hybrid, 576); #else tab0 = g0->sb_hybrid; @@ -1152,7 +1152,7 @@ found2: } } -#if CONFIG_FLOAT +#if USE_FLOATS #if HAVE_MIPSFPU # include "mips/compute_antialias_float.h" #endif /* HAVE_MIPSFPU */ @@ -1160,10 +1160,10 @@ found2: #if HAVE_MIPSDSPR1 # include "mips/compute_antialias_fixed.h" #endif /* HAVE_MIPSDSPR1 */ -#endif /* CONFIG_FLOAT */ +#endif /* USE_FLOATS */ #ifndef compute_antialias -#if CONFIG_FLOAT +#if USE_FLOATS #define AA(j) do { \ float tmp0 = ptr[-1-j]; \ float tmp1 = ptr[ j]; \ diff --git a/libavcodec/mpegaudiodsp_fixed.c b/libavcodec/mpegaudiodsp_fixed.c index 8b69cc2c69..83c9d66095 100644 --- a/libavcodec/mpegaudiodsp_fixed.c +++ b/libavcodec/mpegaudiodsp_fixed.c @@ -16,5 +16,5 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#define CONFIG_FLOAT 0 +#define USE_FLOATS 0 #include "mpegaudiodsp_template.c" diff --git a/libavcodec/mpegaudiodsp_float.c b/libavcodec/mpegaudiodsp_float.c index 777cac85fd..c45b136089 100644 --- a/libavcodec/mpegaudiodsp_float.c +++ b/libavcodec/mpegaudiodsp_float.c @@ -16,5 +16,5 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#define CONFIG_FLOAT 1 +#define USE_FLOATS 1 #include "mpegaudiodsp_template.c" diff --git a/libavcodec/mpegaudiodsp_template.c b/libavcodec/mpegaudiodsp_template.c index f79e068a7b..62454ca306 100644 --- a/libavcodec/mpegaudiodsp_template.c +++ b/libavcodec/mpegaudiodsp_template.c @@ -27,7 +27,7 @@ #include "mpegaudiodsp.h" #include "mpegaudio.h" -#if CONFIG_FLOAT +#if USE_FLOATS #define RENAME(n) n##_float static inline float round_sample(float *sum) @@ -125,7 +125,7 @@ void RENAME(ff_mpadsp_apply_window)(MPA_INT *synth_buf, MPA_INT *window, register const MPA_INT *w, *w2, *p; int j; OUT_INT *samples2; -#if CONFIG_FLOAT +#if USE_FLOATS float sum, sum2; #else int64_t sum, sum2; @@ -200,7 +200,7 @@ av_cold void RENAME(ff_mpa_synth_init)(MPA_INT *window) for(i=0;i<257;i++) { INTFLOAT v; v = ff_mpa_enwindow[i]; -#if CONFIG_FLOAT +#if USE_FLOATS v *= 1.0 / (1LL<<(16 + FRAC_BITS)); #endif window[i] = v; diff --git a/libavcodec/mpegaudioenc_float.c b/libavcodec/mpegaudioenc_float.c index 7712307584..4d4ab2d7fa 100644 --- a/libavcodec/mpegaudioenc_float.c +++ b/libavcodec/mpegaudioenc_float.c @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#define USE_FLOATS +#define USE_FLOATS 1 #include "mpegaudioenc_template.c" AVCodec ff_mp2_encoder = { diff --git a/libavcodec/mpegaudioenc_template.c b/libavcodec/mpegaudioenc_template.c index a567dcdbb4..b2dfe78254 100644 --- a/libavcodec/mpegaudioenc_template.c +++ b/libavcodec/mpegaudioenc_template.c @@ -64,7 +64,7 @@ typedef struct MpegAudioContext { int16_t filter_bank[512]; int scale_factor_table[64]; unsigned char scale_diff_table[128]; -#ifdef USE_FLOATS +#if USE_FLOATS float scale_factor_inv_table[64]; #else int8_t scale_factor_shift[64]; @@ -158,7 +158,7 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx) if (v <= 0) v = 1; s->scale_factor_table[i] = v; -#ifdef USE_FLOATS +#if USE_FLOATS s->scale_factor_inv_table[i] = exp2(-(3 - i) / 3.0) / (float)(1 << 20); #else #define P 15 @@ -681,7 +681,7 @@ static void encode_frame(MpegAudioContext *s, for(m=0;m<3;m++) { sample = s->sb_samples[ch][k][l + m][i]; /* divide by scale factor */ -#ifdef USE_FLOATS +#if USE_FLOATS { float a; a = (float)sample * s->scale_factor_inv_table[s->scale_factors[ch][i][k]];