[FFmpeg-devel] [PATCH 3/5] avcodec/ac3: rename identifier used to select the fixed point variant

Michael Niedermayer michaelni at gmx.at
Sat Dec 28 02:29:49 CET 2013


the CONFIG_ prefix is used by configure, using it for other things
is potentially confusing to the reader

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavcodec/ac3.h          |   10 +++++-----
 libavcodec/ac3dec.c       |   20 ++++++++++----------
 libavcodec/ac3dec.h       |    2 +-
 libavcodec/ac3dec_fixed.c |    2 +-
 4 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/libavcodec/ac3.h b/libavcodec/ac3.h
index c9cd3e0..05ea4b5 100644
--- a/libavcodec/ac3.h
+++ b/libavcodec/ac3.h
@@ -51,11 +51,11 @@
 #define EXP_D25   2
 #define EXP_D45   3
 
-#ifndef CONFIG_AC3_FIXED
-#define CONFIG_AC3_FIXED 0
+#ifndef USE_FIXED
+#define USE_FIXED 0
 #endif
 
-#if CONFIG_AC3_FIXED
+#if USE_FIXED
 
 #define CONFIG_FFT_FLOAT 0
 
@@ -74,7 +74,7 @@
 #define INTFLOAT                int
 #define SHORTFLOAT              int16_t
 
-#else /* CONFIG_AC3_FIXED */
+#else /* USE_FIXED */
 
 #define FIXR(x)                 ((float)(x))
 #define FIXR12(x)               ((float)(x))
@@ -91,7 +91,7 @@
 #define INTFLOAT                float
 #define SHORTFLOAT              float
 
-#endif /* CONFIG_AC3_FIXED */
+#endif /* USE_FIXED */
 
 #define AC3_LEVEL(x)            ROUND15((x) * FIXR15(0.7071067811865476))
 
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index 440590b..14a0161 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -172,7 +172,7 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
     AC3_RENAME(ff_kbd_window_init)(s->window, 5.0, 256);
     ff_dsputil_init(&s->dsp, avctx);
 
-#if (CONFIG_AC3_FIXED)
+#if (USE_FIXED)
     avpriv_fixed_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
 #else
     avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
@@ -182,7 +182,7 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
     ff_fmt_convert_init(&s->fmt_conv, avctx);
     av_lfg_init(&s->dith_state, 0);
 
-    if (CONFIG_AC3_FIXED)
+    if (USE_FIXED)
         avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
     else
         avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
@@ -632,7 +632,7 @@ static inline void do_imdct(AC3DecodeContext *s, int channels)
             for (i = 0; i < 128; i++)
                 x[i] = s->transform_coeffs[ch][2 * i];
             s->imdct_256.imdct_half(&s->imdct_256, s->tmp_output, x);
-#if CONFIG_AC3_FIXED
+#if USE_FIXED
             s->fdsp.vector_fmul_window_fixed_scaled(s->outptr[ch - 1], s->delay[ch - 1],
                                        s->tmp_output, s->window, 128, 8);
 #else
@@ -644,7 +644,7 @@ static inline void do_imdct(AC3DecodeContext *s, int channels)
             s->imdct_256.imdct_half(&s->imdct_256, s->delay[ch - 1], x);
         } else {
             s->imdct_512.imdct_half(&s->imdct_512, s->tmp_output, s->transform_coeffs[ch]);
-#if CONFIG_AC3_FIXED
+#if USE_FIXED
             s->fdsp.vector_fmul_window_fixed_scaled(s->outptr[ch - 1], s->delay[ch - 1],
                                        s->tmp_output, s->window, 128, 8);
 #else
@@ -812,7 +812,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
             if (start_subband > 7)
                 start_subband += start_subband - 7;
             end_subband    = get_bits(gbc, 3) + 5;
-#if CONFIG_AC3_FIXED
+#if USE_FIXED
             s->spx_dst_end_freq = end_freq_inv_tab[end_subband];
 #endif
             if (end_subband   > 7)
@@ -835,7 +835,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
 
             s->spx_dst_start_freq = dst_start_freq;
             s->spx_src_start_freq = src_start_freq;
-#if !CONFIG_AC3_FIXED
+#if !USE_FIXED
             s->spx_dst_end_freq   = dst_end_freq;
 #endif
 
@@ -869,7 +869,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
                         int bandsize;
                         int spx_coord_exp, spx_coord_mant;
                         INTFLOAT nratio, sblend, nblend;
-#if CONFIG_AC3_FIXED
+#if USE_FIXED
                         int64_t accu;
                         /* calculate blending factors */
                         bandsize = s->spx_band_sizes[bnd];
@@ -910,7 +910,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
                         spx_coord_mant <<= (25 - spx_coord_exp - master_spx_coord);
 
                         /* multiply noise and signal blending factors by spx coordinate */
-#if CONFIG_AC3_FIXED
+#if USE_FIXED
                         accu = (int64_t)nblend * spx_coord_mant;
                         s->spx_noise_blend[ch][bnd]  = (int)((accu + (1<<22)) >> 23);
                         accu = (int64_t)sblend * spx_coord_mant;
@@ -1282,7 +1282,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
         } else {
             gain = s->dynamic_range[0];
         }
-#if CONFIG_AC3_FIXED
+#if USE_FIXED
         scale_coefs(s->transform_coeffs[ch], s->fixed_coeffs[ch], gain, 256);
 #else
         gain *= 1.0 / 4194304.0f;
@@ -1313,7 +1313,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
         do_imdct(s, s->channels);
 
         if (downmix_output) {
-#if CONFIG_AC3_FIXED
+#if USE_FIXED
             ac3_downmix_c_fixed16(s->outptr, s->downmix_coeffs,
                               s->out_channels, s->fbw_channels, 256);
 #else
diff --git a/libavcodec/ac3dec.h b/libavcodec/ac3dec.h
index 4d042ae..1434c09 100644
--- a/libavcodec/ac3dec.h
+++ b/libavcodec/ac3dec.h
@@ -199,7 +199,7 @@ typedef struct AC3DecodeContext {
 
 ///@name Optimization
     DSPContext dsp;                         ///< for optimization
-#if CONFIG_AC3_FIXED
+#if USE_FIXED
     AVFixedDSPContext fdsp;
 #else
     AVFloatDSPContext fdsp;
diff --git a/libavcodec/ac3dec_fixed.c b/libavcodec/ac3dec_fixed.c
index ecea58f..47edb9c 100644
--- a/libavcodec/ac3dec_fixed.c
+++ b/libavcodec/ac3dec_fixed.c
@@ -48,7 +48,7 @@
  */
 
 #define CONFIG_FFT_FLOAT 0
-#define CONFIG_AC3_FIXED 1
+#define USE_FIXED 1
 #define CONFIG_FFT_FIXED_32 1
 #include "ac3dec.h"
 
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list