diff fft.c @ 10175:5cf49858179a libavcodec

Move per-arch fft init bits into the corresponding subdirs
author mru
date Tue, 15 Sep 2009 21:14:14 +0000
parents eda985c53dba
children 74715d4288ad
line wrap: on
line diff
--- a/fft.c	Tue Sep 15 16:18:16 2009 +0000
+++ b/fft.c	Tue Sep 15 21:14:14 2009 +0000
@@ -62,7 +62,6 @@
 {
     int i, j, m, n;
     float alpha, c1, s1, s2;
-    int split_radix = 1;
     int av_unused has_vectors;
 
     if (nbits < 2 || nbits > 16)
@@ -87,41 +86,13 @@
     s->imdct_half  = ff_imdct_half_c;
     s->mdct_calc   = ff_mdct_calc_c;
     s->exptab1     = NULL;
+    s->split_radix = 1;
 
-#if HAVE_MMX && HAVE_YASM
-    has_vectors = mm_support();
-    if (has_vectors & FF_MM_SSE && HAVE_SSE) {
-        /* SSE for P3/P4/K8 */
-        s->imdct_calc  = ff_imdct_calc_sse;
-        s->imdct_half  = ff_imdct_half_sse;
-        s->fft_permute = ff_fft_permute_sse;
-        s->fft_calc    = ff_fft_calc_sse;
-    } else if (has_vectors & FF_MM_3DNOWEXT && HAVE_AMD3DNOWEXT) {
-        /* 3DNowEx for K7 */
-        s->imdct_calc = ff_imdct_calc_3dn2;
-        s->imdct_half = ff_imdct_half_3dn2;
-        s->fft_calc   = ff_fft_calc_3dn2;
-    } else if (has_vectors & FF_MM_3DNOW && HAVE_AMD3DNOW) {
-        /* 3DNow! for K6-2/3 */
-        s->imdct_calc = ff_imdct_calc_3dn;
-        s->imdct_half = ff_imdct_half_3dn;
-        s->fft_calc   = ff_fft_calc_3dn;
-    }
-#elif HAVE_ALTIVEC
-    has_vectors = mm_support();
-    if (has_vectors & FF_MM_ALTIVEC) {
-        s->fft_calc = ff_fft_calc_altivec;
-        split_radix = 0;
-    }
-#elif HAVE_NEON
-    s->fft_permute = ff_fft_permute_neon;
-    s->fft_calc    = ff_fft_calc_neon;
-    s->imdct_calc  = ff_imdct_calc_neon;
-    s->imdct_half  = ff_imdct_half_neon;
-    s->mdct_calc   = ff_mdct_calc_neon;
-#endif
+    if (ARCH_ARM)     ff_fft_init_arm(s);
+    if (HAVE_ALTIVEC) ff_fft_init_altivec(s);
+    if (HAVE_MMX)     ff_fft_init_mmx(s);
 
-    if (split_radix) {
+    if (s->split_radix) {
         for(j=4; j<=nbits; j++) {
             int m = 1<<j;
             double freq = 2*M_PI/m;