[FFmpeg-devel] [PATCH 2/2] Move MDCT function pointers to MDCTContext

Mans Rullgard mans
Tue Sep 15 23:22:36 CEST 2009


---
 libavcodec/arm/fft_init_arm.c |    6 +++---
 libavcodec/dsputil.h          |   12 ++++++------
 libavcodec/mdct.c             |    6 +++---
 libavcodec/x86/fft.c          |   12 ++++++------
 4 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/libavcodec/arm/fft_init_arm.c b/libavcodec/arm/fft_init_arm.c
index 647cd06..20cb4f5 100644
--- a/libavcodec/arm/fft_init_arm.c
+++ b/libavcodec/arm/fft_init_arm.c
@@ -38,8 +38,8 @@ av_cold void ff_fft_init_arm(FFTContext *s)
 av_cold void ff_mdct_init_arm(MDCTContext *s)
 {
     if (HAVE_NEON) {
-        s->fft.imdct_calc = ff_imdct_calc_neon;
-        s->fft.imdct_half = ff_imdct_half_neon;
-        s->fft.mdct_calc  = ff_mdct_calc_neon;
+        s->imdct_calc = ff_imdct_calc_neon;
+        s->imdct_half = ff_imdct_half_neon;
+        s->mdct_calc  = ff_mdct_calc_neon;
     }
 }
diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h
index fa2cb14..877ec80 100644
--- a/libavcodec/dsputil.h
+++ b/libavcodec/dsputil.h
@@ -680,9 +680,6 @@ typedef struct FFTContext {
     FFTComplex *tmp_buf;
     void (*fft_permute)(struct FFTContext *s, FFTComplex *z);
     void (*fft_calc)(struct FFTContext *s, FFTComplex *z);
-    void (*imdct_calc)(struct MDCTContext *s, FFTSample *output, const FFTSample *input);
-    void (*imdct_half)(struct MDCTContext *s, FFTSample *output, const FFTSample *input);
-    void (*mdct_calc)(struct MDCTContext *s, FFTSample *output, const FFTSample *input);
     int split_radix;
 } FFTContext;
 
@@ -727,21 +724,24 @@ typedef struct MDCTContext {
     FFTSample *tcos;
     FFTSample *tsin;
     FFTContext fft;
+    void (*imdct_calc)(struct MDCTContext *s, FFTSample *output, const FFTSample *input);
+    void (*imdct_half)(struct MDCTContext *s, FFTSample *output, const FFTSample *input);
+    void (*mdct_calc)(struct MDCTContext *s, FFTSample *output, const FFTSample *input);
 } MDCTContext;
 
 static inline void ff_imdct_calc(MDCTContext *s, FFTSample *output, const FFTSample *input)
 {
-    s->fft.imdct_calc(s, output, input);
+    s->imdct_calc(s, output, input);
 }
 static inline void ff_imdct_half(MDCTContext *s, FFTSample *output, const FFTSample *input)
 {
-    s->fft.imdct_half(s, output, input);
+    s->imdct_half(s, output, input);
 }
 
 static inline void ff_mdct_calc(MDCTContext *s, FFTSample *output,
                                 const FFTSample *input)
 {
-    s->fft.mdct_calc(s, output, input);
+    s->mdct_calc(s, output, input);
 }
 
 /**
diff --git a/libavcodec/mdct.c b/libavcodec/mdct.c
index e19291a..dad966d 100644
--- a/libavcodec/mdct.c
+++ b/libavcodec/mdct.c
@@ -89,9 +89,9 @@ av_cold int ff_mdct_init(MDCTContext *s, int nbits, int inverse, double scale)
     if (!s->tsin)
         goto fail;
 
-    s->fft.imdct_calc = ff_imdct_calc_c;
-    s->fft.imdct_half = ff_imdct_half_c;
-    s->fft.mdct_calc  = ff_mdct_calc_c;
+    s->imdct_calc = ff_imdct_calc_c;
+    s->imdct_half = ff_imdct_half_c;
+    s->mdct_calc  = ff_mdct_calc_c;
 
     if (ARCH_ARM) ff_mdct_init_arm(s);
     if (HAVE_MMX) ff_mdct_init_mmx(s);
diff --git a/libavcodec/x86/fft.c b/libavcodec/x86/fft.c
index aacbaac..d7226a4 100644
--- a/libavcodec/x86/fft.c
+++ b/libavcodec/x86/fft.c
@@ -43,16 +43,16 @@ av_cold void ff_mdct_init_mmx(MDCTContext *s)
     int has_vectors = mm_support();
     if (has_vectors & FF_MM_SSE && HAVE_SSE) {
         /* SSE for P3/P4/K8 */
-        s->fft.imdct_calc = ff_imdct_calc_sse;
-        s->fft.imdct_half = ff_imdct_half_sse;
+        s->imdct_calc = ff_imdct_calc_sse;
+        s->imdct_half = ff_imdct_half_sse;
     } else if (has_vectors & FF_MM_3DNOWEXT && HAVE_AMD3DNOWEXT) {
         /* 3DNowEx for K7 */
-        s->fft.imdct_calc = ff_imdct_calc_3dn2;
-        s->fft.imdct_half = ff_imdct_half_3dn2;
+        s->imdct_calc = ff_imdct_calc_3dn2;
+        s->imdct_half = ff_imdct_half_3dn2;
     } else if (has_vectors & FF_MM_3DNOW && HAVE_AMD3DNOW) {
         /* 3DNow! for K6-2/3 */
-        s->fft.imdct_calc = ff_imdct_calc_3dn;
-        s->fft.imdct_half = ff_imdct_half_3dn;
+        s->imdct_calc = ff_imdct_calc_3dn;
+        s->imdct_half = ff_imdct_half_3dn;
     }
 #endif
 }
-- 
1.6.4.2




More information about the ffmpeg-devel mailing list