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 231 of file kiss_fft.cpp.

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

References 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: