shithub: soundpipe

Download patch

ref: e5528584fe155e46b70be19894dc82849f36be06
parent: 0f9bc249e79a9181613b46effd008f15d9bc7904
author: grz0zrg <[email protected]>
date: Sun Feb 7 12:41:20 EST 2021

sp_fft: undeclared log2 fixes


--- a/lib/fft/fftlib.c
+++ b/lib/fft/fftlib.c
@@ -9,6 +9,8 @@
 #define M_PI 3.14159265358979323846
 #endif
 
+#define LOG2(n) (log(n) / log(2))
+
 #define POW2(m) ((uint32_t) 1 << (m))       /* integer power of 2 for m<32 */
 
 /* fft's with M bigger than this bust primary cache */
--- a/lib/fft/sp_fft.c
+++ b/lib/fft/sp_fft.c
@@ -26,13 +26,13 @@
 
 void sp_fftr(sp_fft *fft, SPFLOAT *buf, int FFTsize)
 {
-    int M = log2(FFTsize);
+    int M = LOG2(FFTsize);
     rffts1(buf, M, fft->utbl, fft->BRLow);
 }
 
 void sp_fft_cpx(sp_fft *fft, SPFLOAT *buf, int FFTsize)
 {
-    int M = log2(FFTsize);
+    int M = LOG2(FFTsize);
     ffts1(buf, M, fft->utbl, fft->BRLowCpx);
 }
 
@@ -40,7 +40,7 @@
 
 void sp_ifftr(sp_fft *fft, SPFLOAT *buf, int FFTsize)
 {
-    int M = log2(FFTsize);
+    int M = LOG2(FFTsize);
     riffts1(buf, M, fft->utbl, fft->BRLow);
 }