[FFmpeg-devel] [PATCH 8/8] avfft: add AV prefixes to DCTTransformType enum.

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


---
 libavcodec/avfft.c        |    2 +-
 libavcodec/avfft.h        |   18 ++++++++++++------
 libavcodec/binkaudio.c    |    2 +-
 libavcodec/dct.c          |   14 +++++++-------
 libavcodec/fft-test.c     |    6 +++---
 libavcodec/fft.h          |    2 +-
 libavcodec/mpegaudiodec.c |    2 +-
 libavcodec/wmavoice.c     |    4 ++--
 8 files changed, 28 insertions(+), 22 deletions(-)

diff --git a/libavcodec/avfft.c b/libavcodec/avfft.c
index dba8722..06ae8b2 100644
--- a/libavcodec/avfft.c
+++ b/libavcodec/avfft.c
@@ -116,7 +116,7 @@ void av_rdft_end(AVRDFTContext *s)
 
 #if CONFIG_DCT
 
-AVDCTContext *av_dct_init(int nbits, enum DCTTransformType inverse)
+AVDCTContext *av_dct_init(int nbits, enum AVDCTTransformType inverse)
 {
     AVDCTContext *s = av_malloc(sizeof(*s));
 
diff --git a/libavcodec/avfft.h b/libavcodec/avfft.h
index 5727bf1..128c432 100644
--- a/libavcodec/avfft.h
+++ b/libavcodec/avfft.h
@@ -80,11 +80,11 @@ void av_rdft_end(AVRDFTContext *s);
 
 typedef struct AVDCTContext AVDCTContext;
 
-enum DCTTransformType {
-    DCT_II = 0,
-    DCT_III,
-    DCT_I,
-    DST_I,
+enum AVDCTTransformType {
+    AV_DCT_II = 0,
+    AV_DCT_III,
+    AV_DCT_I,
+    AV_DST_I,
 };
 
 /**
@@ -95,7 +95,7 @@ enum DCTTransformType {
  *
  * @note the first element of the input of DST-I is ignored
  */
-AVDCTContext *av_dct_init(int nbits, enum DCTTransformType type);
+AVDCTContext *av_dct_init(int nbits, enum AVDCTTransformType type);
 void av_dct_calc(AVDCTContext *s, AVFFTSample *data);
 void av_dct_end (AVDCTContext *s);
 
@@ -111,6 +111,12 @@ attribute_deprecated enum RDFTransformType {
 };
 typedef attribute_deprecated AVRDFTContext RDFTContext;
 typedef attribute_deprecated AVDCTContext DCTContext;
+attribute_deprecated enum DCTTransformType {
+    DCT_II = 0,
+    DCT_III,
+    DCT_I,
+    DST_I,
+};
 #endif
 
 #endif /* AVCODEC_AVFFT_H */
diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c
index ebfdf65..86d9700 100644
--- a/libavcodec/binkaudio.c
+++ b/libavcodec/binkaudio.c
@@ -131,7 +131,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
     if (CONFIG_BINKAUDIO_RDFT_DECODER && avctx->codec->id == CODEC_ID_BINKAUDIO_RDFT)
         ff_rdft_init(&s->trans.rdft, frame_len_bits, AV_DFT_C2R);
     else if (CONFIG_BINKAUDIO_DCT_DECODER)
-        ff_dct_init(&s->trans.dct, frame_len_bits, DCT_III);
+        ff_dct_init(&s->trans.dct, frame_len_bits, AV_DCT_III);
     else
         return -1;
 
diff --git a/libavcodec/dct.c b/libavcodec/dct.c
index d560a22..86d5b07 100644
--- a/libavcodec/dct.c
+++ b/libavcodec/dct.c
@@ -181,7 +181,7 @@ void ff_dct_calc(AVDCTContext *s, AVFFTSample *data)
     s->dct_calc(s, data);
 }
 
-av_cold int ff_dct_init(AVDCTContext *s, int nbits, enum DCTTransformType inverse)
+av_cold int ff_dct_init(AVDCTContext *s, int nbits, enum AVDCTTransformType inverse)
 {
     int n = 1 << nbits;
     int i;
@@ -195,7 +195,7 @@ av_cold int ff_dct_init(AVDCTContext *s, int nbits, enum DCTTransformType invers
 
     s->csc2 = av_malloc(n/2 * sizeof(AVFFTSample));
 
-    if (ff_rdft_init(&s->rdft, nbits, inverse == DCT_III) < 0) {
+    if (ff_rdft_init(&s->rdft, nbits, inverse == AV_DCT_III) < 0) {
         av_free(s->csc2);
         return -1;
     }
@@ -204,13 +204,13 @@ av_cold int ff_dct_init(AVDCTContext *s, int nbits, enum DCTTransformType invers
         s->csc2[i] = 0.5 / sin((M_PI / (2*n) * (2*i + 1)));
 
     switch(inverse) {
-    case DCT_I  : s->dct_calc = ff_dct_calc_I_c; break;
-    case DCT_II : s->dct_calc = ff_dct_calc_II_c ; break;
-    case DCT_III: s->dct_calc = ff_dct_calc_III_c; break;
-    case DST_I  : s->dct_calc = ff_dst_calc_I_c; break;
+    case AV_DCT_I  : s->dct_calc = ff_dct_calc_I_c; break;
+    case AV_DCT_II : s->dct_calc = ff_dct_calc_II_c ; break;
+    case AV_DCT_III: s->dct_calc = ff_dct_calc_III_c; break;
+    case AV_DST_I  : s->dct_calc = ff_dst_calc_I_c; break;
     }
 
-    if (inverse == DCT_II && nbits == 5)
+    if (inverse == AV_DCT_II && nbits == 5)
         s->dct_calc = dct32_func;
 
     s->dct32 = dct32;
diff --git a/libavcodec/fft-test.c b/libavcodec/fft-test.c
index 978cd2a..03c286e 100644
--- a/libavcodec/fft-test.c
+++ b/libavcodec/fft-test.c
@@ -305,10 +305,10 @@ int main(int argc, char **argv)
         break;
     case TRANSFORM_DCT:
         if (do_inverse)
-            av_log(NULL, AV_LOG_INFO,"DCT_III");
+            av_log(NULL, AV_LOG_INFO,"AV_DCT_III");
         else
-            av_log(NULL, AV_LOG_INFO,"DCT_II");
-        ff_dct_init(d, fft_nbits, do_inverse ? DCT_III : DCT_II);
+            av_log(NULL, AV_LOG_INFO,"AV_DCT_II");
+        ff_dct_init(d, fft_nbits, do_inverse ? AV_DCT_III : AV_DCT_II);
         break;
     }
     av_log(NULL, AV_LOG_INFO," %d test\n", fft_size);
diff --git a/libavcodec/fft.h b/libavcodec/fft.h
index d892b8e..1b264e9 100644
--- a/libavcodec/fft.h
+++ b/libavcodec/fft.h
@@ -238,7 +238,7 @@ struct AVDCTContext {
  *
  * @note the first element of the input of DST-I is ignored
  */
-int  ff_dct_init(AVDCTContext *s, int nbits, enum DCTTransformType type);
+int  ff_dct_init(AVDCTContext *s, int nbits, enum AVDCTTransformType type);
 void ff_dct_calc(AVDCTContext *s, AVFFTSample *data);
 void ff_dct_end (AVDCTContext *s);
 
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index aa31e46..e740713 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -325,7 +325,7 @@ static av_cold int decode_init(AVCodecContext * avctx)
     ff_mpegaudiodec_init_mmx(s);
 #endif
 #if CONFIG_FLOAT
-    ff_dct_init(&s->dct, 5, DCT_II);
+    ff_dct_init(&s->dct, 5, AV_DCT_II);
 #endif
     if (HAVE_ALTIVEC && CONFIG_FLOAT) ff_mpegaudiodec_init_altivec(s);
 
diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c
index 763933b..fee162b 100644
--- a/libavcodec/wmavoice.c
+++ b/libavcodec/wmavoice.c
@@ -355,8 +355,8 @@ static av_cold int wmavoice_decode_init(AVCodecContext *ctx)
     if (s->do_apf) {
         ff_rdft_init(&s->rdft,  7, AV_DFT_R2C);
         ff_rdft_init(&s->irdft, 7, AV_IDFT_C2R);
-        ff_dct_init(&s->dct,  6, DCT_I);
-        ff_dct_init(&s->dst,  6, DST_I);
+        ff_dct_init(&s->dct,  6, AV_DCT_I);
+        ff_dct_init(&s->dst,  6, AV_DST_I);
 
         ff_sine_window_init(s->cos, 256);
         memcpy(&s->sin[255], s->cos, 256 * sizeof(s->cos[0]));
-- 
1.7.4.1




More information about the ffmpeg-devel mailing list