[FFmpeg-devel] [PATCH 7/8] avfft: add AV prefix to DCTContext.

Anton Khirnov anton
Sun Mar 13 14:48:38 CET 2011


---
 libavcodec/avfft.c     |    8 ++++----
 libavcodec/avfft.h     |    9 +++++----
 libavcodec/binkaudio.c |    2 +-
 libavcodec/dct.c       |   16 ++++++++--------
 libavcodec/fft-test.c  |    2 +-
 libavcodec/fft.h       |   12 ++++++------
 libavcodec/mpegaudio.h |    2 +-
 libavcodec/wmavoice.c  |    2 +-
 libavcodec/x86/fft.c   |    2 +-
 9 files changed, 28 insertions(+), 27 deletions(-)

diff --git a/libavcodec/avfft.c b/libavcodec/avfft.c
index 2852e27..dba8722 100644
--- a/libavcodec/avfft.c
+++ b/libavcodec/avfft.c
@@ -116,9 +116,9 @@ void av_rdft_end(AVRDFTContext *s)
 
 #if CONFIG_DCT
 
-DCTContext *av_dct_init(int nbits, enum DCTTransformType inverse)
+AVDCTContext *av_dct_init(int nbits, enum DCTTransformType inverse)
 {
-    DCTContext *s = av_malloc(sizeof(*s));
+    AVDCTContext *s = av_malloc(sizeof(*s));
 
     if (s && ff_dct_init(s, nbits, inverse))
         av_freep(&s);
@@ -126,12 +126,12 @@ DCTContext *av_dct_init(int nbits, enum DCTTransformType inverse)
     return s;
 }
 
-void av_dct_calc(DCTContext *s, AVFFTSample *data)
+void av_dct_calc(AVDCTContext *s, AVFFTSample *data)
 {
     ff_dct_calc(s, data);
 }
 
-void av_dct_end(DCTContext *s)
+void av_dct_end(AVDCTContext *s)
 {
     if (s) {
         ff_dct_end(s);
diff --git a/libavcodec/avfft.h b/libavcodec/avfft.h
index 6f73ef0..5727bf1 100644
--- a/libavcodec/avfft.h
+++ b/libavcodec/avfft.h
@@ -78,7 +78,7 @@ void av_rdft_end(AVRDFTContext *s);
 
 /* Discrete Cosine Transform */
 
-typedef struct DCTContext DCTContext;
+typedef struct AVDCTContext AVDCTContext;
 
 enum DCTTransformType {
     DCT_II = 0,
@@ -95,9 +95,9 @@ 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, AVFFTSample *data);
-void av_dct_end (DCTContext *s);
+AVDCTContext *av_dct_init(int nbits, enum DCTTransformType type);
+void av_dct_calc(AVDCTContext *s, AVFFTSample *data);
+void av_dct_end (AVDCTContext *s);
 
 #if FF_API_OLD_FFT
 typedef attribute_deprecated AVFFTSample FFTSample;
@@ -110,6 +110,7 @@ attribute_deprecated enum RDFTransformType {
     DFT_C2R,
 };
 typedef attribute_deprecated AVRDFTContext RDFTContext;
+typedef attribute_deprecated AVDCTContext DCTContext;
 #endif
 
 #endif /* AVCODEC_AVFFT_H */
diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c
index cf270be..ebfdf65 100644
--- a/libavcodec/binkaudio.c
+++ b/libavcodec/binkaudio.c
@@ -59,7 +59,7 @@ typedef struct {
     float *coeffs_ptr[MAX_CHANNELS]; ///< pointers to the coeffs arrays for float_to_int16_interleave
     union {
         AVRDFTContext rdft;
-        DCTContext dct;
+        AVDCTContext dct;
     } trans;
 } BinkAudioContext;
 
diff --git a/libavcodec/dct.c b/libavcodec/dct.c
index 1475cb2..d560a22 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, AVFFTSample *data)
+static void ff_dst_calc_I_c(AVDCTContext *ctx, AVFFTSample *data)
 {
     int n = 1 << ctx->nbits;
     int i;
@@ -71,7 +71,7 @@ static void ff_dst_calc_I_c(DCTContext *ctx, AVFFTSample *data)
     data[n-1] = 0;
 }
 
-static void ff_dct_calc_I_c(DCTContext *ctx, AVFFTSample *data)
+static void ff_dct_calc_I_c(AVDCTContext *ctx, AVFFTSample *data)
 {
     int n = 1 << ctx->nbits;
     int i;
@@ -101,7 +101,7 @@ static void ff_dct_calc_I_c(DCTContext *ctx, AVFFTSample *data)
         data[i] = data[i - 2] - data[i];
 }
 
-static void ff_dct_calc_III_c(DCTContext *ctx, AVFFTSample *data)
+static void ff_dct_calc_III_c(AVDCTContext *ctx, AVFFTSample *data)
 {
     int n = 1 << ctx->nbits;
     int i;
@@ -134,7 +134,7 @@ static void ff_dct_calc_III_c(DCTContext *ctx, AVFFTSample *data)
     }
 }
 
-static void ff_dct_calc_II_c(DCTContext *ctx, AVFFTSample *data)
+static void ff_dct_calc_II_c(AVDCTContext *ctx, AVFFTSample *data)
 {
     int n = 1 << ctx->nbits;
     int i;
@@ -171,17 +171,17 @@ static void ff_dct_calc_II_c(DCTContext *ctx, AVFFTSample *data)
     }
 }
 
-static void dct32_func(DCTContext *ctx, AVFFTSample *data)
+static void dct32_func(AVDCTContext *ctx, AVFFTSample *data)
 {
     ctx->dct32(data, data);
 }
 
-void ff_dct_calc(DCTContext *s, AVFFTSample *data)
+void ff_dct_calc(AVDCTContext *s, AVFFTSample *data)
 {
     s->dct_calc(s, data);
 }
 
-av_cold int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType inverse)
+av_cold int ff_dct_init(AVDCTContext *s, int nbits, enum DCTTransformType inverse)
 {
     int n = 1 << nbits;
     int i;
@@ -219,7 +219,7 @@ av_cold int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType inverse)
     return 0;
 }
 
-av_cold void ff_dct_end(DCTContext *s)
+av_cold void ff_dct_end(AVDCTContext *s)
 {
     ff_rdft_end(&s->rdft);
     av_free(s->csc2);
diff --git a/libavcodec/fft-test.c b/libavcodec/fft-test.c
index d0de452..978cd2a 100644
--- a/libavcodec/fft-test.c
+++ b/libavcodec/fft-test.c
@@ -232,7 +232,7 @@ int main(int argc, char **argv)
     AVFFTContext s1, *s = &s1;
     AVFFTContext m1, *m = &m1;
     AVRDFTContext r1, *r = &r1;
-    DCTContext d1, *d = &d1;
+    AVDCTContext d1, *d = &d1;
     int fft_nbits, fft_size, fft_size_2;
     double scale = 1.0;
     AVLFG prng;
diff --git a/libavcodec/fft.h b/libavcodec/fft.h
index caf0505..d892b8e 100644
--- a/libavcodec/fft.h
+++ b/libavcodec/fft.h
@@ -113,7 +113,7 @@ int ff_fft_init(AVFFTContext *s, int nbits, int inverse);
 void ff_fft_init_altivec(AVFFTContext *s);
 void ff_fft_init_mmx(AVFFTContext *s);
 void ff_fft_init_arm(AVFFTContext *s);
-void ff_dct_init_mmx(DCTContext *s);
+void ff_dct_init_mmx(AVDCTContext *s);
 
 /**
  * Do the permutation needed BEFORE calling ff_fft_calc().
@@ -220,13 +220,13 @@ static av_always_inline void ff_rdft_calc(AVRDFTContext *s, AVFFTSample *data)
 
 /* Discrete Cosine Transform */
 
-struct DCTContext {
+struct AVDCTContext {
     int nbits;
     int inverse;
     AVRDFTContext rdft;
     const float *costab;
     AVFFTSample *csc2;
-    void (*dct_calc)(struct DCTContext *s, AVFFTSample *data);
+    void (*dct_calc)(struct AVDCTContext *s, AVFFTSample *data);
     void (*dct32)(AVFFTSample *out, const AVFFTSample *in);
 };
 
@@ -238,8 +238,8 @@ 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, AVFFTSample *data);
-void ff_dct_end (DCTContext *s);
+int  ff_dct_init(AVDCTContext *s, int nbits, enum DCTTransformType type);
+void ff_dct_calc(AVDCTContext *s, AVFFTSample *data);
+void ff_dct_end (AVDCTContext *s);
 
 #endif /* AVCODEC_FFT_H */
diff --git a/libavcodec/mpegaudio.h b/libavcodec/mpegaudio.h
index 97c7855..b5ee067 100644
--- a/libavcodec/mpegaudio.h
+++ b/libavcodec/mpegaudio.h
@@ -158,7 +158,7 @@ typedef struct MPADecodeContext {
     int error_recognition;
     AVCodecContext* avctx;
 #if CONFIG_FLOAT
-    DCTContext dct;
+    AVDCTContext dct;
 #endif
     void (*apply_window_mp3)(MPA_INT *synth_buf, MPA_INT *window,
                              int *dither_state, OUT_INT *samples, int incr);
diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c
index 050520b..763933b 100644
--- a/libavcodec/wmavoice.c
+++ b/libavcodec/wmavoice.c
@@ -262,7 +262,7 @@ typedef struct {
      */
     AVRDFTContext rdft, irdft;    ///< contexts for FFT-calculation in the
                                   ///< postfilter (for denoise filter)
-    DCTContext dct, dst;          ///< contexts for phase shift (in Hilbert
+    AVDCTContext dct, dst;        ///< contexts for phase shift (in Hilbert
                                   ///< transform, part of postfilter)
     float sin[511], cos[511];     ///< 8-bit cosine/sine windows over [-pi,pi]
                                   ///< range
diff --git a/libavcodec/x86/fft.c b/libavcodec/x86/fft.c
index d0f6e11..8e5e04f 100644
--- a/libavcodec/x86/fft.c
+++ b/libavcodec/x86/fft.c
@@ -46,7 +46,7 @@ av_cold void ff_fft_init_mmx(AVFFTContext *s)
 }
 
 #if CONFIG_DCT
-av_cold void ff_dct_init_mmx(DCTContext *s)
+av_cold void ff_dct_init_mmx(AVDCTContext *s)
 {
     int has_vectors = av_get_cpu_flags();
     if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE)
-- 
1.7.4.1




More information about the ffmpeg-devel mailing list