summaryrefslogtreecommitdiff
path: root/libavcodec/fft.c
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2009-09-10 08:50:03 +0000
committerMåns Rullgård <mans@mansr.com>2009-09-10 08:50:03 +0000
commit648d792042cb6d58d032f3ae2518169d91a87274 (patch)
treea934b90c65f30fede4e46a1e314d7690b354c30b /libavcodec/fft.c
parent6d9d289e7671df94caba0a1ca1a93c0b12052d32 (diff)
ARM: NEON optimised FFT and MDCT
Vorbis and AC3 ~3x faster. Parts by Naotoshi Nojiri, naonoj gmail Originally committed as revision 19806 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/fft.c')
-rw-r--r--libavcodec/fft.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libavcodec/fft.c b/libavcodec/fft.c
index ad8d8812d1..c030534e2d 100644
--- a/libavcodec/fft.c
+++ b/libavcodec/fft.c
@@ -64,6 +64,7 @@ av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse)
float alpha, c1, s1, s2;
int split_radix = 1;
int av_unused has_vectors;
+ int revtab_shift = 0;
if (nbits < 2 || nbits > 16)
goto fail;
@@ -112,6 +113,12 @@ av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse)
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;
+ revtab_shift = 3;
#endif
if (split_radix) {
@@ -125,7 +132,8 @@ av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse)
tab[m/2-i] = tab[i];
}
for(i=0; i<n; i++)
- s->revtab[-split_radix_permutation(i, n, s->inverse) & (n-1)] = i;
+ s->revtab[-split_radix_permutation(i, n, s->inverse) & (n-1)] =
+ i << revtab_shift;
s->tmp_buf = av_malloc(n * sizeof(FFTComplex));
} else {
int np, nblocks, np2, l;