shithub: soundpipe

Download patch

ref: 775d674bf2fea68eb44212ba9ee3ca82d93de451
parent: 0f9bc249e79a9181613b46effd008f15d9bc7904
parent: e5528584fe155e46b70be19894dc82849f36be06
author: Paul Batchelor <thisispaulbatchelor@gmail.com>
date: Sun Feb 7 15:55:05 EST 2021

Merge pull request #2 from grz0zrg/master

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);
 }