shithub: aacenc

Download patch

ref: 56714d3ea63818bbad3aaa1cd711e291d06a93c0
parent: 72c4ab226a1260e7a076a9779212286fd33017c5
author: oxygene2000 <oxygene2000>
date: Wed Feb 9 15:47:17 EST 2000

Added fixed fftw-stuff. Use rdft_spectrum2.c instead of rdft_spectrum.c
and set -DUSE_FFTW in Makefile to enable it..
Be sure that you have libfftw installed
fftw_init() and fftw_destroy() have to be placed elsewhere
(should only be run once in the program -> speed)

--- a/rdft.h
+++ b/rdft.h
@@ -1,6 +1,8 @@
-//#include "rfftw.h"
-//rfftw_plan rdft_plan11;
-//rfftw_plan rdft_plan8;
+#ifdef USE_FFTW
+#include <rfftw.h>
+rfftw_plan rdft_plan11;
+rfftw_plan rdft_plan8;
+#endif
 
 void fftw_init();
 void fftw_destroy();
--- a/rdft_spectrum2.c
+++ b/rdft_spectrum2.c
@@ -39,6 +39,8 @@
 void rdft( double *fr, unsigned lg2n ) 
 /* real discrete Fourier transform; not recursive */
 {
+fftw_init();
+/*FIXME: has to be placed elsewhere*/
 rfftw_plan rdft_plan;
 double fo[lg2n];
 switch(lg2n) {
@@ -53,6 +55,8 @@
 	printf("ERROR: rdft with size %i",lg2n);
 }
 	memcpy(fr,fo,sizeof(fr));
+fftw_destroy();
+/*FIXME: has to be placed elsewhere*/
 }
 
 void spectrum( double *f, unsigned lg2n )