From e2bcb3fe9b64388f39248af9aefc515c875540d9 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Sun, 22 Dec 2013 02:17:24 -0500 Subject: [PATCH] Reverse the ordering of the FFT stage to optimize a degenerate radix-4 case. This also happens to increase the accuracy since it appears that the new ordering is optimal (at least for 20 ms frames), whereas the previous ordering was pessimal. --- celt/dump_modes/Makefile | 4 +- celt/kiss_fft.c | 100 ++++++++++++++++++++--------- celt/static_modes_fixed.h | 128 +++++++++++++++++++------------------- celt/static_modes_float.h | 128 +++++++++++++++++++------------------- 4 files changed, 201 insertions(+), 159 deletions(-) diff --git a/celt/dump_modes/Makefile b/celt/dump_modes/Makefile index 371a7d4c..c2de3181 100644 --- a/celt/dump_modes/Makefile +++ b/celt/dump_modes/Makefile @@ -1,10 +1,10 @@ CFLAGS=-O2 -Wall -Wextra -DHAVE_CONFIG_H -INCLUDES=-I../ -I../.. -I../../include +INCLUDES=-I. -I../ -I../.. -I../../include all: dump_modes dump_modes: - $(CC) $(CFLAGS) $(INCLUDES) -DCUSTOM_MODES dump_modes.c ../modes.c ../cwrs.c ../rate.c ../entenc.c ../entdec.c ../mathops.c ../mdct.c ../kiss_fft.c -o dump_modes -lm + $(CC) $(CFLAGS) $(INCLUDES) -DCUSTOM_MODES_ONLY -DCUSTOM_MODES dump_modes.c ../modes.c ../cwrs.c ../rate.c ../entenc.c ../entdec.c ../mathops.c ../mdct.c ../kiss_fft.c -o dump_modes -lm clean: rm -f dump_modes diff --git a/celt/kiss_fft.c b/celt/kiss_fft.c index 8d97b446..9869e9eb 100644 --- a/celt/kiss_fft.c +++ b/celt/kiss_fft.c @@ -85,38 +85,61 @@ static void kf_bfly4( int mm ) { - const kiss_twiddle_cpx *tw1,*tw2,*tw3; - kiss_fft_cpx scratch[6]; - const size_t m2=2*m; - const size_t m3=3*m; - int i, j; + int i; - kiss_fft_cpx * Fout_beg = Fout; - for (i=0;itwiddles; - for (j=0;jtwiddles; + for (j=0;j 1); + n = nbak; + /* Reverse the order to get the radix 4 at the end, so we can use the + fast degenerate case. It turns out that reversing the order also + improves the noise behaviour. */ + for (i=0;i