[2/8] avfft: add AV prefix to FFTSample.

Message ID 1300136301-5437-2-git-send-email-anton@khirnov.net
State Old
Headers show

Commit Message

Anton Khirnov March 14, 2011, 8:58 p.m.
---
 ffplay.c                      |    4 +-
 libavcodec/arm/fft_init_arm.c |    8 +++---
 libavcodec/arm/fft_neon.S     |    2 +-
 libavcodec/avfft.c            |   10 ++++----
 libavcodec/avfft.h            |   21 ++++++++++++------
 libavcodec/binkaudio.c        |    4 +-
 libavcodec/dct.c              |   14 ++++++------
 libavcodec/fft-test.c         |   10 ++++----
 libavcodec/fft.c              |   18 ++++++++--------
 libavcodec/fft.h              |   46 ++++++++++++++++++++--------------------
 libavcodec/mdct.c             |   32 ++++++++++++++--------------
 libavcodec/ppc/fft_altivec.c  |    4 +-
 libavcodec/qdm2.c             |    2 +-
 libavcodec/rdft.c             |    8 +++---
 libavcodec/version.h          |    3 ++
 libavcodec/wma.h              |    2 +-
 libavcodec/x86/dct32_sse.c    |    2 +-
 libavcodec/x86/fft.h          |   14 ++++++------
 libavcodec/x86/fft_3dn2.c     |   12 +++++-----
 libavcodec/x86/fft_mmx.asm    |    2 +-
 libavcodec/x86/fft_sse.c      |    2 +-
 21 files changed, 115 insertions(+), 105 deletions(-)

Patch

diff --git a/ffplay.c b/ffplay.c
index 6019437..8a30b5a 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -173,7 +173,7 @@  typedef struct VideoState {
     int last_i_start;
     RDFTContext *rdft;
     int rdft_bits;
-    FFTSample *rdft_data;
+    AVFFTSample *rdft_data;
     int xpos;
 
     SDL_Thread *subtitle_tid;
@@ -883,7 +883,7 @@  static void video_audio_display(VideoState *s)
             s->rdft_data= av_malloc(4*nb_freq*sizeof(*s->rdft_data));
         }
         {
-            FFTSample *data[2];
+            AVFFTSample *data[2];
             for(ch = 0;ch < nb_display_channels; ch++) {
                 data[ch] = s->rdft_data + 2*nb_freq*ch;
                 i = i_start + ch;
diff --git a/libavcodec/arm/fft_init_arm.c b/libavcodec/arm/fft_init_arm.c
index dff0689..f6ed47c 100644
--- a/libavcodec/arm/fft_init_arm.c
+++ b/libavcodec/arm/fft_init_arm.c
@@ -24,11 +24,11 @@ 
 void ff_fft_permute_neon(FFTContext *s, FFTComplex *z);
 void ff_fft_calc_neon(FFTContext *s, FFTComplex *z);
 
-void ff_imdct_calc_neon(FFTContext *s, FFTSample *output, const FFTSample *input);
-void ff_imdct_half_neon(FFTContext *s, FFTSample *output, const FFTSample *input);
-void ff_mdct_calc_neon(FFTContext *s, FFTSample *output, const FFTSample *input);
+void ff_imdct_calc_neon(FFTContext *s, AVFFTSample *output, const AVFFTSample *input);
+void ff_imdct_half_neon(FFTContext *s, AVFFTSample *output, const AVFFTSample *input);
+void ff_mdct_calc_neon(FFTContext *s,  AVFFTSample *output, const AVFFTSample *input);
 
-void ff_rdft_calc_neon(struct RDFTContext *s, FFTSample *z);
+void ff_rdft_calc_neon(struct RDFTContext *s, AVFFTSample *z);
 
 void ff_synth_filter_float_neon(FFTContext *imdct,
                                 float *synth_buf_ptr, int *synth_buf_offset,
diff --git a/libavcodec/arm/fft_neon.S b/libavcodec/arm/fft_neon.S
index 1db7abd..edbaf23 100644
--- a/libavcodec/arm/fft_neon.S
+++ b/libavcodec/arm/fft_neon.S
@@ -206,7 +206,7 @@  endfunc
 function fft_pass_neon
         push            {r4-r6,lr}
         mov             r6,  r2                 @ n
-        lsl             r5,  r2,  #3            @ 2 * n * sizeof FFTSample
+        lsl             r5,  r2,  #3            @ 2 * n * sizeof AVFFTSample
         lsl             r4,  r2,  #4            @ 2 * n * sizeof FFTComplex
         lsl             r2,  r2,  #5            @ 4 * n * sizeof FFTComplex
         add             r3,  r2,  r4
diff --git a/libavcodec/avfft.c b/libavcodec/avfft.c
index 7d5d083..3cd472a 100644
--- a/libavcodec/avfft.c
+++ b/libavcodec/avfft.c
@@ -62,17 +62,17 @@  FFTContext *av_mdct_init(int nbits, int inverse, double scale)
     return s;
 }
 
-void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input)
+void av_imdct_calc(FFTContext *s, AVFFTSample *output, const AVFFTSample *input)
 {
     s->imdct_calc(s, output, input);
 }
 
-void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input)
+void av_imdct_half(FFTContext *s, AVFFTSample *output, const AVFFTSample *input)
 {
     s->imdct_half(s, output, input);
 }
 
-void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input)
+void av_mdct_calc(FFTContext *s, AVFFTSample *output, const AVFFTSample *input)
 {
     s->mdct_calc(s, output, input);
 }
@@ -99,7 +99,7 @@  RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans)
     return s;
 }
 
-void av_rdft_calc(RDFTContext *s, FFTSample *data)
+void av_rdft_calc(RDFTContext *s, AVFFTSample *data)
 {
     ff_rdft_calc(s, data);
 }
@@ -126,7 +126,7 @@  DCTContext *av_dct_init(int nbits, enum DCTTransformType inverse)
     return s;
 }
 
-void av_dct_calc(DCTContext *s, FFTSample *data)
+void av_dct_calc(DCTContext *s, AVFFTSample *data)
 {
     ff_dct_calc(s, data);
 }
diff --git a/libavcodec/avfft.h b/libavcodec/avfft.h
index be2d9c7..21e3135 100644
--- a/libavcodec/avfft.h
+++ b/libavcodec/avfft.h
@@ -19,10 +19,13 @@ 
 #ifndef AVCODEC_AVFFT_H
 #define AVCODEC_AVFFT_H
 
-typedef float FFTSample;
+#include "libavcodec/version.h"
+#include "libavutil/attributes.h"
+
+typedef float AVFFTSample;
 
 typedef struct FFTComplex {
-    FFTSample re, im;
+    AVFFTSample re, im;
 } FFTComplex;
 
 typedef struct FFTContext FFTContext;
@@ -48,9 +51,9 @@  void av_fft_calc(FFTContext *s, FFTComplex *z);
 void av_fft_end(FFTContext *s);
 
 FFTContext *av_mdct_init(int nbits, int inverse, double scale);
-void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
-void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input);
-void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
+void av_imdct_calc(FFTContext *s, AVFFTSample *output, const AVFFTSample *input);
+void av_imdct_half(FFTContext *s, AVFFTSample *output, const AVFFTSample *input);
+void av_mdct_calc(FFTContext *s, AVFFTSample *output, const AVFFTSample *input);
 void av_mdct_end(FFTContext *s);
 
 /* Real Discrete Fourier Transform */
@@ -70,7 +73,7 @@  typedef struct RDFTContext RDFTContext;
  * @param trans           the type of transform
  */
 RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans);
-void av_rdft_calc(RDFTContext *s, FFTSample *data);
+void av_rdft_calc(RDFTContext *s, AVFFTSample *data);
 void av_rdft_end(RDFTContext *s);
 
 /* Discrete Cosine Transform */
@@ -93,7 +96,11 @@  enum DCTTransformType {
  * @note the first element of the input of DST-I is ignored
  */
 DCTContext *av_dct_init(int nbits, enum DCTTransformType type);
-void av_dct_calc(DCTContext *s, FFTSample *data);
+void av_dct_calc(DCTContext *s, AVFFTSample *data);
 void av_dct_end (DCTContext *s);
 
+#if FF_API_OLD_FFT
+typedef attribute_deprecated AVFFTSample FFTSample;
+#endif
+
 #endif /* AVCODEC_AVFFT_H */
diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c
index a00d657..48cec1b 100644
--- a/libavcodec/binkaudio.c
+++ b/libavcodec/binkaudio.c
@@ -54,7 +54,7 @@  typedef struct {
     int num_bands;
     unsigned int *bands;
     float root;
-    DECLARE_ALIGNED(16, FFTSample, coeffs)[BINK_BLOCK_MAX_SIZE];
+    DECLARE_ALIGNED(16, AVFFTSample, coeffs)[BINK_BLOCK_MAX_SIZE];
     DECLARE_ALIGNED(16, short, previous)[BINK_BLOCK_MAX_SIZE / 16];  ///< coeffs from previous audio block
     float *coeffs_ptr[MAX_CHANNELS]; ///< pointers to the coeffs arrays for float_to_int16_interleave
     union {
@@ -166,7 +166,7 @@  static void decode_block(BinkAudioContext *s, short *out, int use_dct)
         skip_bits(gb, 2);
 
     for (ch = 0; ch < s->channels; ch++) {
-        FFTSample *coeffs = s->coeffs_ptr[ch];
+        AVFFTSample *coeffs = s->coeffs_ptr[ch];
         if (s->version_b) {
             coeffs[0] = av_int2flt(get_bits(gb, 32)) * s->root;
             coeffs[1] = av_int2flt(get_bits(gb, 32)) * s->root;
diff --git a/libavcodec/dct.c b/libavcodec/dct.c
index dab94c3..1475cb2 100644
--- a/libavcodec/dct.c
+++ b/libavcodec/dct.c
@@ -41,7 +41,7 @@ 
 /* cos((M_PI * x / (2*n)) */
 #define COS(s,n,x) (s->costab[x])
 
-static void ff_dst_calc_I_c(DCTContext *ctx, FFTSample *data)
+static void ff_dst_calc_I_c(DCTContext *ctx, AVFFTSample *data)
 {
     int n = 1 << ctx->nbits;
     int i;
@@ -71,7 +71,7 @@  static void ff_dst_calc_I_c(DCTContext *ctx, FFTSample *data)
     data[n-1] = 0;
 }
 
-static void ff_dct_calc_I_c(DCTContext *ctx, FFTSample *data)
+static void ff_dct_calc_I_c(DCTContext *ctx, AVFFTSample *data)
 {
     int n = 1 << ctx->nbits;
     int i;
@@ -101,7 +101,7 @@  static void ff_dct_calc_I_c(DCTContext *ctx, FFTSample *data)
         data[i] = data[i - 2] - data[i];
 }
 
-static void ff_dct_calc_III_c(DCTContext *ctx, FFTSample *data)
+static void ff_dct_calc_III_c(DCTContext *ctx, AVFFTSample *data)
 {
     int n = 1 << ctx->nbits;
     int i;
@@ -134,7 +134,7 @@  static void ff_dct_calc_III_c(DCTContext *ctx, FFTSample *data)
     }
 }
 
-static void ff_dct_calc_II_c(DCTContext *ctx, FFTSample *data)
+static void ff_dct_calc_II_c(DCTContext *ctx, AVFFTSample *data)
 {
     int n = 1 << ctx->nbits;
     int i;
@@ -171,12 +171,12 @@  static void ff_dct_calc_II_c(DCTContext *ctx, FFTSample *data)
     }
 }
 
-static void dct32_func(DCTContext *ctx, FFTSample *data)
+static void dct32_func(DCTContext *ctx, AVFFTSample *data)
 {
     ctx->dct32(data, data);
 }
 
-void ff_dct_calc(DCTContext *s, FFTSample *data)
+void ff_dct_calc(DCTContext *s, AVFFTSample *data)
 {
     s->dct_calc(s, data);
 }
@@ -193,7 +193,7 @@  av_cold int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType inverse)
 
     s->costab = ff_cos_tabs[nbits+2];
 
-    s->csc2 = av_malloc(n/2 * sizeof(FFTSample));
+    s->csc2 = av_malloc(n/2 * sizeof(AVFFTSample));
 
     if (ff_rdft_init(&s->rdft, nbits, inverse == DCT_III) < 0) {
         av_free(s->csc2);
diff --git a/libavcodec/fft-test.c b/libavcodec/fft-test.c
index 85282f5..1c536d2 100644
--- a/libavcodec/fft-test.c
+++ b/libavcodec/fft-test.c
@@ -223,7 +223,7 @@  enum tf_transform {
 int main(int argc, char **argv)
 {
     FFTComplex *tab, *tab1, *tab_ref;
-    FFTSample *tab2;
+    AVFFTSample *tab2;
     int it, i, c;
     int do_speed = 0;
     int err = 1;
@@ -276,7 +276,7 @@  int main(int argc, char **argv)
     tab = av_malloc(fft_size * sizeof(FFTComplex));
     tab1 = av_malloc(fft_size * sizeof(FFTComplex));
     tab_ref = av_malloc(fft_size * sizeof(FFTComplex));
-    tab2 = av_malloc(fft_size * sizeof(FFTSample));
+    tab2 = av_malloc(fft_size * sizeof(AVFFTSample));
 
     switch (transform) {
     case TRANSFORM_MDCT:
@@ -354,7 +354,7 @@  int main(int argc, char **argv)
                 tab1[fft_size_2+i].im = -tab1[fft_size_2-i].im;
             }
 
-            memcpy(tab2, tab1, fft_size * sizeof(FFTSample));
+            memcpy(tab2, tab1, fft_size * sizeof(AVFFTSample));
             tab2[1] = tab1[fft_size_2].re;
 
             ff_rdft_calc(r, tab2);
@@ -412,11 +412,11 @@  int main(int argc, char **argv)
                     ff_fft_calc(s, tab);
                     break;
                 case TRANSFORM_RDFT:
-                    memcpy(tab2, tab1, fft_size * sizeof(FFTSample));
+                    memcpy(tab2, tab1, fft_size * sizeof(AVFFTSample));
                     ff_rdft_calc(r, tab2);
                     break;
                 case TRANSFORM_DCT:
-                    memcpy(tab2, tab1, fft_size * sizeof(FFTSample));
+                    memcpy(tab2, tab1, fft_size * sizeof(AVFFTSample));
                     ff_dct_calc(d, tab2);
                     break;
                 }
diff --git a/libavcodec/fft.c b/libavcodec/fft.c
index eade76a..f6b9402 100644
--- a/libavcodec/fft.c
+++ b/libavcodec/fft.c
@@ -47,7 +47,7 @@  COSTABLE(16384);
 COSTABLE(32768);
 COSTABLE(65536);
 #endif
-COSTABLE_CONST FFTSample * const ff_cos_tabs[] = {
+COSTABLE_CONST AVFFTSample * const ff_cos_tabs[] = {
     NULL, NULL, NULL, NULL,
     ff_cos_16, ff_cos_32, ff_cos_64, ff_cos_128, ff_cos_256, ff_cos_512, ff_cos_1024,
     ff_cos_2048, ff_cos_4096, ff_cos_8192, ff_cos_16384, ff_cos_32768, ff_cos_65536,
@@ -73,7 +73,7 @@  av_cold void ff_init_ff_cos_tabs(int index)
     int i;
     int m = 1<<index;
     double freq = 2*M_PI/m;
-    FFTSample *tab = ff_cos_tabs[index];
+    AVFFTSample *tab = ff_cos_tabs[index];
     for(i=0; i<=m/4; i++)
         tab[i] = cos(i*freq);
     for(i=1; i<m/4; i++)
@@ -164,7 +164,7 @@  av_cold void ff_fft_end(FFTContext *s)
 // this is slightly slower for small data, but avoids store->load aliasing
 // for addresses separated by large powers of 2.
 #define BUTTERFLIES_BIG(a0,a1,a2,a3) {\
-    FFTSample r0=a0.re, i0=a0.im, r1=a1.re, i1=a1.im;\
+    AVFFTSample r0=a0.re, i0=a0.im, r1=a1.re, i1=a1.im;\
     BF(t3, t5, t5, t1);\
     BF(a2.re, a0.re, r0, t5);\
     BF(a3.im, a1.im, i1, t3);\
@@ -191,13 +191,13 @@  av_cold void ff_fft_end(FFTContext *s)
 
 /* z[0...8n-1], w[1...2n-1] */
 #define PASS(name)\
-static void name(FFTComplex *z, const FFTSample *wre, unsigned int n)\
+static void name(FFTComplex *z, const AVFFTSample *wre, unsigned int n)\
 {\
-    FFTSample t1, t2, t3, t4, t5, t6;\
+    AVFFTSample t1, t2, t3, t4, t5, t6;\
     int o1 = 2*n;\
     int o2 = 4*n;\
     int o3 = 6*n;\
-    const FFTSample *wim = wre+o1;\
+    const AVFFTSample *wim = wre+o1;\
     n--;\
 \
     TRANSFORM_ZERO(z[0],z[o1],z[o2],z[o3]);\
@@ -227,7 +227,7 @@  static void fft##n(FFTComplex *z)\
 
 static void fft4(FFTComplex *z)
 {
-    FFTSample t1, t2, t3, t4, t5, t6, t7, t8;
+    AVFFTSample t1, t2, t3, t4, t5, t6, t7, t8;
 
     BF(t3, t1, z[0].re, z[1].re);
     BF(t8, t6, z[3].re, z[2].re);
@@ -241,7 +241,7 @@  static void fft4(FFTComplex *z)
 
 static void fft8(FFTComplex *z)
 {
-    FFTSample t1, t2, t3, t4, t5, t6, t7, t8;
+    AVFFTSample t1, t2, t3, t4, t5, t6, t7, t8;
 
     fft4(z);
 
@@ -262,7 +262,7 @@  static void fft8(FFTComplex *z)
 #if !CONFIG_SMALL
 static void fft16(FFTComplex *z)
 {
-    FFTSample t1, t2, t3, t4, t5, t6;
+    AVFFTSample t1, t2, t3, t4, t5, t6;
 
     fft8(z);
     fft4(z+8);
diff --git a/libavcodec/fft.h b/libavcodec/fft.h
index 58a7f30..2f3b4a4 100644
--- a/libavcodec/fft.h
+++ b/libavcodec/fft.h
@@ -37,13 +37,13 @@  struct FFTContext {
     int mdct_size; /* size of MDCT (i.e. number of input data * 2) */
     int mdct_bits; /* n = 2^nbits */
     /* pre/post rotation tables */
-    FFTSample *tcos;
-    FFTSample *tsin;
+    AVFFTSample *tcos;
+    AVFFTSample *tsin;
     void (*fft_permute)(struct FFTContext *s, FFTComplex *z);
     void (*fft_calc)(struct FFTContext *s, FFTComplex *z);
-    void (*imdct_calc)(struct FFTContext *s, FFTSample *output, const FFTSample *input);
-    void (*imdct_half)(struct FFTContext *s, FFTSample *output, const FFTSample *input);
-    void (*mdct_calc)(struct FFTContext *s, FFTSample *output, const FFTSample *input);
+    void (*imdct_calc)(struct FFTContext *s, AVFFTSample *output, const AVFFTSample *input);
+    void (*imdct_half)(struct FFTContext *s, AVFFTSample *output, const AVFFTSample *input);
+    void (*mdct_calc)(struct FFTContext *s, AVFFTSample *output, const AVFFTSample *input);
     int fft_permutation;
 #define FF_FFT_PERM_DEFAULT   0
 #define FF_FFT_PERM_SWAP_LSBS 1
@@ -63,9 +63,9 @@  struct FFTContext {
 #endif
 
 #define COSTABLE(size) \
-    COSTABLE_CONST DECLARE_ALIGNED(16, FFTSample, ff_cos_##size)[size/2]
+    COSTABLE_CONST DECLARE_ALIGNED(16, AVFFTSample, ff_cos_##size)[size/2]
 #define SINTABLE(size) \
-    SINTABLE_CONST DECLARE_ALIGNED(16, FFTSample, ff_sin_##size)[size/2]
+    SINTABLE_CONST DECLARE_ALIGNED(16, AVFFTSample, ff_sin_##size)[size/2]
 #define SINETABLE(size) \
     SINETABLE_CONST DECLARE_ALIGNED(16, float, ff_sine_##size)[size]
 extern COSTABLE(16);
@@ -81,7 +81,7 @@  extern COSTABLE(8192);
 extern COSTABLE(16384);
 extern COSTABLE(32768);
 extern COSTABLE(65536);
-extern COSTABLE_CONST FFTSample* const ff_cos_tabs[17];
+extern COSTABLE_CONST AVFFTSample* const ff_cos_tabs[17];
 
 /**
  * Initialize the cosine table in ff_cos_tabs[index]
@@ -134,17 +134,17 @@  void ff_fft_end(FFTContext *s);
 
 /* MDCT computation */
 
-static inline void ff_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input)
+static inline void ff_imdct_calc(FFTContext *s, AVFFTSample *output, const AVFFTSample *input)
 {
     s->imdct_calc(s, output, input);
 }
-static inline void ff_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input)
+static inline void ff_imdct_half(FFTContext *s, AVFFTSample *output, const AVFFTSample *input)
 {
     s->imdct_half(s, output, input);
 }
 
-static inline void ff_mdct_calc(FFTContext *s, FFTSample *output,
-                                const FFTSample *input)
+static inline void ff_mdct_calc(FFTContext *s, AVFFTSample *output,
+                                const AVFFTSample *input)
 {
     s->mdct_calc(s, output, input);
 }
@@ -184,9 +184,9 @@  extern SINETABLE(4096);
 extern SINETABLE_CONST float * const ff_sine_windows[13];
 
 int ff_mdct_init(FFTContext *s, int nbits, int inverse, double scale);
-void ff_imdct_calc_c(FFTContext *s, FFTSample *output, const FFTSample *input);
-void ff_imdct_half_c(FFTContext *s, FFTSample *output, const FFTSample *input);
-void ff_mdct_calc_c(FFTContext *s, FFTSample *output, const FFTSample *input);
+void ff_imdct_calc_c(FFTContext *s, AVFFTSample *output, const AVFFTSample *input);
+void ff_imdct_half_c(FFTContext *s, AVFFTSample *output, const AVFFTSample *input);
+void ff_mdct_calc_c(FFTContext *s, AVFFTSample *output, const AVFFTSample *input);
 void ff_mdct_end(FFTContext *s);
 
 /* Real Discrete Fourier Transform */
@@ -197,10 +197,10 @@  struct RDFTContext {
     int sign_convention;
 
     /* pre/post rotation tables */
-    const FFTSample *tcos;
-    SINTABLE_CONST FFTSample *tsin;
+    const AVFFTSample *tcos;
+    SINTABLE_CONST AVFFTSample *tsin;
     FFTContext fft;
-    void (*rdft_calc)(struct RDFTContext *s, FFTSample *z);
+    void (*rdft_calc)(struct RDFTContext *s, AVFFTSample *z);
 };
 
 /**
@@ -213,7 +213,7 @@  void ff_rdft_end(RDFTContext *s);
 
 void ff_rdft_init_arm(RDFTContext *s);
 
-static av_always_inline void ff_rdft_calc(RDFTContext *s, FFTSample *data)
+static av_always_inline void ff_rdft_calc(RDFTContext *s, AVFFTSample *data)
 {
     s->rdft_calc(s, data);
 }
@@ -225,9 +225,9 @@  struct DCTContext {
     int inverse;
     RDFTContext rdft;
     const float *costab;
-    FFTSample *csc2;
-    void (*dct_calc)(struct DCTContext *s, FFTSample *data);
-    void (*dct32)(FFTSample *out, const FFTSample *in);
+    AVFFTSample *csc2;
+    void (*dct_calc)(struct DCTContext *s, AVFFTSample *data);
+    void (*dct32)(AVFFTSample *out, const AVFFTSample *in);
 };
 
 /**
@@ -239,7 +239,7 @@  struct DCTContext {
  * @note the first element of the input of DST-I is ignored
  */
 int  ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType type);
-void ff_dct_calc(DCTContext *s, FFTSample *data);
+void ff_dct_calc(DCTContext *s, AVFFTSample *data);
 void ff_dct_end (DCTContext *s);
 
 #endif /* AVCODEC_FFT_H */
diff --git a/libavcodec/mdct.c b/libavcodec/mdct.c
index 31e2216..cf1821f 100644
--- a/libavcodec/mdct.c
+++ b/libavcodec/mdct.c
@@ -76,7 +76,7 @@  av_cold int ff_mdct_init(FFTContext *s, int nbits, int inverse, double scale)
     if (ff_fft_init(s, s->mdct_bits - 2, inverse) < 0)
         goto fail;
 
-    s->tcos = av_malloc(n/2 * sizeof(FFTSample));
+    s->tcos = av_malloc(n/2 * sizeof(AVFFTSample));
     if (!s->tcos)
         goto fail;
 
@@ -109,10 +109,10 @@  av_cold int ff_mdct_init(FFTContext *s, int nbits, int inverse, double scale)
 /* complex multiplication: p = a * b */
 #define CMUL(pre, pim, are, aim, bre, bim) \
 {\
-    FFTSample _are = (are);\
-    FFTSample _aim = (aim);\
-    FFTSample _bre = (bre);\
-    FFTSample _bim = (bim);\
+    AVFFTSample _are = (are);\
+    AVFFTSample _aim = (aim);\
+    AVFFTSample _bre = (bre);\
+    AVFFTSample _bim = (bim);\
     (pre) = _are * _bre - _aim * _bim;\
     (pim) = _are * _bim + _aim * _bre;\
 }
@@ -123,13 +123,13 @@  av_cold int ff_mdct_init(FFTContext *s, int nbits, int inverse, double scale)
  * @param output N/2 samples
  * @param input N/2 samples
  */
-void ff_imdct_half_c(FFTContext *s, FFTSample *output, const FFTSample *input)
+void ff_imdct_half_c(FFTContext *s, AVFFTSample *output, const AVFFTSample *input)
 {
     int k, n8, n4, n2, n, j;
     const uint16_t *revtab = s->revtab;
-    const FFTSample *tcos = s->tcos;
-    const FFTSample *tsin = s->tsin;
-    const FFTSample *in1, *in2;
+    const AVFFTSample *tcos = s->tcos;
+    const AVFFTSample *tsin = s->tsin;
+    const AVFFTSample *in1, *in2;
     FFTComplex *z = (FFTComplex *)output;
 
     n = 1 << s->mdct_bits;
@@ -150,7 +150,7 @@  void ff_imdct_half_c(FFTContext *s, FFTSample *output, const FFTSample *input)
 
     /* post rotation + reordering */
     for(k = 0; k < n8; k++) {
-        FFTSample r0, i0, r1, i1;
+        AVFFTSample r0, i0, r1, i1;
         CMUL(r0, i1, z[n8-k-1].im, z[n8-k-1].re, tsin[n8-k-1], tcos[n8-k-1]);
         CMUL(r1, i0, z[n8+k  ].im, z[n8+k  ].re, tsin[n8+k  ], tcos[n8+k  ]);
         z[n8-k-1].re = r0;
@@ -165,7 +165,7 @@  void ff_imdct_half_c(FFTContext *s, FFTSample *output, const FFTSample *input)
  * @param output N samples
  * @param input N/2 samples
  */
-void ff_imdct_calc_c(FFTContext *s, FFTSample *output, const FFTSample *input)
+void ff_imdct_calc_c(FFTContext *s, AVFFTSample *output, const AVFFTSample *input)
 {
     int k;
     int n = 1 << s->mdct_bits;
@@ -185,13 +185,13 @@  void ff_imdct_calc_c(FFTContext *s, FFTSample *output, const FFTSample *input)
  * @param input N samples
  * @param out N/2 samples
  */
-void ff_mdct_calc_c(FFTContext *s, FFTSample *out, const FFTSample *input)
+void ff_mdct_calc_c(FFTContext *s, AVFFTSample *out, const AVFFTSample *input)
 {
     int i, j, n, n8, n4, n2, n3;
-    FFTSample re, im;
+    AVFFTSample re, im;
     const uint16_t *revtab = s->revtab;
-    const FFTSample *tcos = s->tcos;
-    const FFTSample *tsin = s->tsin;
+    const AVFFTSample *tcos = s->tcos;
+    const AVFFTSample *tsin = s->tsin;
     FFTComplex *x = (FFTComplex *)out;
 
     n = 1 << s->mdct_bits;
@@ -217,7 +217,7 @@  void ff_mdct_calc_c(FFTContext *s, FFTSample *out, const FFTSample *input)
 
     /* post rotation */
     for(i=0;i<n8;i++) {
-        FFTSample r0, i0, r1, i1;
+        AVFFTSample r0, i0, r1, i1;
         CMUL(i1, r0, x[n8-i-1].re, x[n8-i-1].im, -tsin[n8-i-1], -tcos[n8-i-1]);
         CMUL(i0, r1, x[n8+i  ].re, x[n8+i  ].im, -tsin[n8+i  ], -tcos[n8+i  ]);
         x[n8-i-1].re = r0;
diff --git a/libavcodec/ppc/fft_altivec.c b/libavcodec/ppc/fft_altivec.c
index ec610b0..01a2a06 100644
--- a/libavcodec/ppc/fft_altivec.c
+++ b/libavcodec/ppc/fft_altivec.c
@@ -36,7 +36,7 @@  void ff_fft_calc_altivec(FFTContext *s, FFTComplex *z);
 void ff_fft_calc_interleave_altivec(FFTContext *s, FFTComplex *z);
 
 #if HAVE_GNU_AS
-static void ff_imdct_half_altivec(FFTContext *s, FFTSample *output, const FFTSample *input)
+static void ff_imdct_half_altivec(FFTContext *s, AVFFTSample *output, const AVFFTSample *input)
 {
     int j, k;
     int n = 1 << s->mdct_bits;
@@ -116,7 +116,7 @@  static void ff_imdct_half_altivec(FFTContext *s, FFTSample *output, const FFTSam
     } while(k >= 0);
 }
 
-static void ff_imdct_calc_altivec(FFTContext *s, FFTSample *output, const FFTSample *input)
+static void ff_imdct_calc_altivec(FFTContext *s, AVFFTSample *output, const AVFFTSample *input)
 {
     int k;
     int n = 1 << s->mdct_bits;
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index 3779b8e..e31de2e 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -1588,7 +1588,7 @@  static void qdm2_calculate_fft (QDM2Context *q, int channel, int sub_packet)
     int i;
     q->fft.complex[channel][0].re *= 2.0f;
     q->fft.complex[channel][0].im = 0.0f;
-    ff_rdft_calc(&q->rdft_ctx, (FFTSample *)q->fft.complex[channel]);
+    ff_rdft_calc(&q->rdft_ctx, (AVFFTSample *)q->fft.complex[channel]);
     /* add samples to output buffer */
     for (i = 0; i < ((q->fft_frame_size + 15) & ~15); i++)
         q->output_buffer[q->channels * i + channel] += ((float *) q->fft.complex[channel])[i] * gain;
diff --git a/libavcodec/rdft.c b/libavcodec/rdft.c
index 59b4624..9a48dd6 100644
--- a/libavcodec/rdft.c
+++ b/libavcodec/rdft.c
@@ -44,7 +44,7 @@  SINTABLE(16384);
 SINTABLE(32768);
 SINTABLE(65536);
 #endif
-static SINTABLE_CONST FFTSample * const ff_sin_tabs[] = {
+static SINTABLE_CONST AVFFTSample * const ff_sin_tabs[] = {
     NULL, NULL, NULL, NULL,
     ff_sin_16, ff_sin_32, ff_sin_64, ff_sin_128, ff_sin_256, ff_sin_512, ff_sin_1024,
     ff_sin_2048, ff_sin_4096, ff_sin_8192, ff_sin_16384, ff_sin_32768, ff_sin_65536,
@@ -54,15 +54,15 @@  static SINTABLE_CONST FFTSample * const ff_sin_tabs[] = {
  * the two real FFTs into one complex FFT. Unmangle the results.
  * ref: http://www.engineeringproductivitytools.com/stuff/T0001/PT10.HTM
  */
-static void ff_rdft_calc_c(RDFTContext* s, FFTSample* data)
+static void ff_rdft_calc_c(RDFTContext* s, AVFFTSample* data)
 {
     int i, i1, i2;
     FFTComplex ev, od;
     const int n = 1 << s->nbits;
     const float k1 = 0.5;
     const float k2 = 0.5 - s->inverse;
-    const FFTSample *tcos = s->tcos;
-    const FFTSample *tsin = s->tsin;
+    const AVFFTSample *tcos = s->tcos;
+    const AVFFTSample *tsin = s->tsin;
 
     if (!s->inverse) {
         ff_fft_permute(&s->fft, (FFTComplex*)data);
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 591f009..039a1c7 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -71,5 +71,8 @@ 
 #ifndef FF_API_OLD_AUDIOCONVERT
 #define FF_API_OLD_AUDIOCONVERT (LIBAVCODEC_VERSION_MAJOR < 53)
 #endif
+#ifndef FF_API_OLD_FFT
+#define FF_API_OLD_FFT          (LIBAVCODEC_VERSION_MAJOR < 54)
+#endif
 
 #endif /* AVCODEC_VERSION_H */
diff --git a/libavcodec/wma.h b/libavcodec/wma.h
index a51b3e8..758bd54 100644
--- a/libavcodec/wma.h
+++ b/libavcodec/wma.h
@@ -117,7 +117,7 @@  typedef struct WMACodecContext {
     float max_exponent[MAX_CHANNELS];
     WMACoef coefs1[MAX_CHANNELS][BLOCK_MAX_SIZE];
     DECLARE_ALIGNED(16, float, coefs)[MAX_CHANNELS][BLOCK_MAX_SIZE];
-    DECLARE_ALIGNED(16, FFTSample, output)[BLOCK_MAX_SIZE * 2];
+    DECLARE_ALIGNED(16, AVFFTSample, output)[BLOCK_MAX_SIZE * 2];
     FFTContext mdct_ctx[BLOCK_NB_SIZES];
     float *windows[BLOCK_NB_SIZES];
     /* output buffer for one frame and the last for IMDCT windowing */
diff --git a/libavcodec/x86/dct32_sse.c b/libavcodec/x86/dct32_sse.c
index 74338d6..74a250a 100644
--- a/libavcodec/x86/dct32_sse.c
+++ b/libavcodec/x86/dct32_sse.c
@@ -60,7 +60,7 @@  DECLARE_ALIGNED(16, static const int32_t, smask)[4] = {
 #define BUTTERFLY2(val, mask, cos, tmp) BUTTERFLY0(val, mask, cos, tmp, $0x1b)
 #define BUTTERFLY3(val, mask, cos, tmp) BUTTERFLY0(val, mask, cos, tmp, $0xb1)
 
-void ff_dct32_float_sse(FFTSample *out, const FFTSample *in)
+void ff_dct32_float_sse(AVFFTSample *out, const AVFFTSample *in)
 {
     int32_t tmp1 = 0;
     __asm__ volatile(
diff --git a/libavcodec/x86/fft.h b/libavcodec/x86/fft.h
index 2affacb..706d431 100644
--- a/libavcodec/x86/fft.h
+++ b/libavcodec/x86/fft.h
@@ -26,12 +26,12 @@  void ff_fft_calc_sse(FFTContext *s, FFTComplex *z);
 void ff_fft_calc_3dn(FFTContext *s, FFTComplex *z);
 void ff_fft_calc_3dn2(FFTContext *s, FFTComplex *z);
 
-void ff_imdct_calc_3dn(FFTContext *s, FFTSample *output, const FFTSample *input);
-void ff_imdct_half_3dn(FFTContext *s, FFTSample *output, const FFTSample *input);
-void ff_imdct_calc_3dn2(FFTContext *s, FFTSample *output, const FFTSample *input);
-void ff_imdct_half_3dn2(FFTContext *s, FFTSample *output, const FFTSample *input);
-void ff_imdct_calc_sse(FFTContext *s, FFTSample *output, const FFTSample *input);
-void ff_imdct_half_sse(FFTContext *s, FFTSample *output, const FFTSample *input);
-void ff_dct32_float_sse(FFTSample *out, const FFTSample *in);
+void ff_imdct_calc_3dn(FFTContext *s, AVFFTSample *output, const AVFFTSample *input);
+void ff_imdct_half_3dn(FFTContext *s, AVFFTSample *output, const AVFFTSample *input);
+void ff_imdct_calc_3dn2(FFTContext *s, AVFFTSample *output, const AVFFTSample *input);
+void ff_imdct_half_3dn2(FFTContext *s, AVFFTSample *output, const AVFFTSample *input);
+void ff_imdct_calc_sse(FFTContext *s, AVFFTSample *output, const AVFFTSample *input);
+void ff_imdct_half_sse(FFTContext *s, AVFFTSample *output, const AVFFTSample *input);
+void ff_dct32_float_sse(AVFFTSample *out, const AVFFTSample *in);
 
 #endif
diff --git a/libavcodec/x86/fft_3dn2.c b/libavcodec/x86/fft_3dn2.c
index 2abb8cf..cf5d0b5 100644
--- a/libavcodec/x86/fft_3dn2.c
+++ b/libavcodec/x86/fft_3dn2.c
@@ -50,10 +50,10 @@  void ff_fft_calc_3dn2(FFTContext *s, FFTComplex *z)
     __asm__ volatile("femms");
     if(n <= 8)
         for(i=0; i<n; i+=2)
-            FFSWAP(FFTSample, z[i].im, z[i+1].re);
+            FFSWAP(AVFFTSample, z[i].im, z[i+1].re);
 }
 
-void ff_imdct_half_3dn2(FFTContext *s, FFTSample *output, const FFTSample *input)
+void ff_imdct_half_3dn2(FFTContext *s, AVFFTSample *output, const AVFFTSample *input)
 {
     x86_reg j, k;
     long n = s->mdct_size;
@@ -61,9 +61,9 @@  void ff_imdct_half_3dn2(FFTContext *s, FFTSample *output, const FFTSample *input
     long n4 = n >> 2;
     long n8 = n >> 3;
     const uint16_t *revtab = s->revtab;
-    const FFTSample *tcos = s->tcos;
-    const FFTSample *tsin = s->tsin;
-    const FFTSample *in1, *in2;
+    const AVFFTSample *tcos = s->tcos;
+    const AVFFTSample *tsin = s->tsin;
+    const AVFFTSample *in1, *in2;
     FFTComplex *z = (FFTComplex *)output;
 
     /* pre rotation */
@@ -144,7 +144,7 @@  void ff_imdct_half_3dn2(FFTContext *s, FFTSample *output, const FFTSample *input
     __asm__ volatile("femms");
 }
 
-void ff_imdct_calc_3dn2(FFTContext *s, FFTSample *output, const FFTSample *input)
+void ff_imdct_calc_3dn2(FFTContext *s, AVFFTSample *output, const AVFFTSample *input)
 {
     x86_reg j, k;
     long n = s->mdct_size;
diff --git a/libavcodec/x86/fft_mmx.asm b/libavcodec/x86/fft_mmx.asm
index 68e20df..f155cfa 100644
--- a/libavcodec/x86/fft_mmx.asm
+++ b/libavcodec/x86/fft_mmx.asm
@@ -566,7 +566,7 @@  INIT_XMM
     jl       .post
 %endmacro
 
-cglobal imdct_half_sse, 3,7,8; FFTContext *s, FFTSample *output, const FFTSample *input
+cglobal imdct_half_sse, 3,7,8; FFTContext *s, AVFFTSample *output, const AVFFTSample *input
 %ifdef ARCH_X86_64
 %define rrevtab r10
 %define rtcos   r11
diff --git a/libavcodec/x86/fft_sse.c b/libavcodec/x86/fft_sse.c
index 0d151bc..652dcac 100644
--- a/libavcodec/x86/fft_sse.c
+++ b/libavcodec/x86/fft_sse.c
@@ -71,7 +71,7 @@  void ff_fft_permute_sse(FFTContext *s, FFTComplex *z)
     memcpy(z, s->tmp_buf, n*sizeof(FFTComplex));
 }
 
-void ff_imdct_calc_sse(FFTContext *s, FFTSample *output, const FFTSample *input)
+void ff_imdct_calc_sse(FFTContext *s, AVFFTSample *output, const AVFFTSample *input)
 {
     x86_reg j, k;
     long n = s->mdct_size;