filter-chain: Fix build error without FFTW

And some style changes while on it.

Fixes: c67232718 ("filter-chain: move fft mem function to dsp_ops")
This commit is contained in:
Robert Mader 2024-11-05 18:24:01 +01:00
parent c672327181
commit 2ab11d0f6c

View file

@ -258,21 +258,22 @@ void dsp_fft_free_c(struct dsp_ops *ops, void *fft)
pffft_destroy_setup(fft); pffft_destroy_setup(fft);
#endif #endif
} }
void *dsp_fft_memalloc_c(struct dsp_ops *ops, uint32_t size, bool real) void *dsp_fft_memalloc_c(struct dsp_ops *ops, uint32_t size, bool real)
{ {
#ifdef HAVE_FFTW #ifdef HAVE_FFTW
if (real) if (real)
return fftwf_alloc_real(size); return fftwf_alloc_real(size);
else { else
return fftwf_alloc_complex(size); return fftwf_alloc_complex(size);
}
#else #else
if (real) if (real)
pffft_aligned_malloc(size * sizeof(float)); return pffft_aligned_malloc(size * sizeof(float));
else else
pffft_aligned_malloc(size * 2 * sizeof(float)); return pffft_aligned_malloc(size * 2 * sizeof(float));
#endif #endif
} }
void dsp_fft_memfree_c(struct dsp_ops *ops, void *data) void dsp_fft_memfree_c(struct dsp_ops *ops, void *data)
{ {
#ifdef HAVE_FFTW #ifdef HAVE_FFTW