FastLED 3.9.15
Loading...
Searching...
No Matches

◆ kf_work()

static void kf_work ( kiss_fft_cpx * Fout,
const kiss_fft_cpx * f,
const size_t fstride,
int in_stride,
int * factors,
const kiss_fft_cfg st )
static

Definition at line 240 of file kiss_fft.cpp.hpp.

248{
249 kiss_fft_cpx * Fout_beg=Fout;
250 const int p=*factors++; /* the radix */
251 const int m=*factors++; /* stage's fft length/p */
252 const kiss_fft_cpx * Fout_end = Fout + p*m;
253
254#ifdef _OPENMP
255 // use openmp extensions at the
256 // top-level (not recursive)
257 if (fstride==1 && p<=5)
258 {
259 int k;
260
261 // execute the p different work units in different threads
262# pragma omp parallel for
263 for (k=0;k<p;++k)
264 kf_work( Fout +k*m, f+ fstride*in_stride*k,fstride*p,in_stride,factors,st);
265 // all threads have joined by this point
266
267 switch (p) {
268 case 2: kf_bfly2(Fout,fstride,st,m); break;
269 case 3: kf_bfly3(Fout,fstride,st,m); break;
270 case 4: kf_bfly4(Fout,fstride,st,m); break;
271 case 5: kf_bfly5(Fout,fstride,st,m); break;
272 default: kf_bfly_generic(Fout,fstride,st,m,p); break;
273 }
274 return;
275 }
276#endif
277
278 if (m==1) {
279 do{
280 *Fout = *f;
281 f += fstride*in_stride;
282 }while(++Fout != Fout_end );
283 }else{
284 do{
285 // recursive call:
286 // DFT of size m*p performed by doing
287 // p instances of smaller DFTs of size m,
288 // each one takes every mth sample
289 // so0, s1, s2 become
290 // so, sm, s2m, s3m, ...
291 // s1, s(1+m), s(1+2m), ...
292 // s2, s(2+m), s(2+2m), ...
293 // etc.
294 kf_work( Fout , f, fstride*p, in_stride, factors,st);
295 f += fstride*in_stride;
296 }while( (Fout += m) != Fout_end );
297 }
298
299 Fout=Fout_beg;
300
301 // recombine the p smaller DFTs
302 switch (p) {
303 case 2: kf_bfly2(Fout,fstride,st,m); break;
304 case 3: kf_bfly3(Fout,fstride,st,m); break;
305 case 4: kf_bfly4(Fout,fstride,st,m); break;
306 case 5: kf_bfly5(Fout,fstride,st,m); break;
307 default: kf_bfly_generic(Fout,fstride,st,m,p); break;
308 }
309}
static void kf_bfly4(kiss_fft_cpx *Fout, const size_t fstride, const kiss_fft_cfg st, const size_t m) FL_NOEXCEPT
static void kf_bfly5(kiss_fft_cpx *Fout, const size_t fstride, const kiss_fft_cfg st, int m) FL_NOEXCEPT
static void kf_bfly3(kiss_fft_cpx *Fout, const size_t fstride, const kiss_fft_cfg st, size_t m) FL_NOEXCEPT
static void kf_bfly2(kiss_fft_cpx *Fout, const size_t fstride, const kiss_fft_cfg st, int m) FL_NOEXCEPT
static void kf_work(kiss_fft_cpx *Fout, const kiss_fft_cpx *f, const size_t fstride, int in_stride, int *factors, const kiss_fft_cfg st) FL_NOEXCEPT
static void kf_bfly_generic(kiss_fft_cpx *Fout, const size_t fstride, const kiss_fft_cfg st, int m, int p) FL_NOEXCEPT

References FL_NOEXCEPT, kf_bfly2(), kf_bfly3(), kf_bfly4(), kf_bfly5(), kf_bfly_generic(), and kf_work().

Referenced by kf_work(), and kiss_fft_stride().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: