kfr

Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
Log | Files | Refs | README

commit fd3d19ce754b08cc221541320c2690c4ba97bf89
parent d096043b2b1edcd0beffbc2460bc07f67762d92c
Author: Roland Rabien <[email protected]>
Date:   Fri,  1 Dec 2023 11:03:14 -0800

Fix ARM build

Diffstat:
Mcapi/capi.cpp | 32++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+), 0 deletions(-)

diff --git a/capi/capi.cpp b/capi/capi.cpp @@ -290,41 +290,73 @@ extern "C" KFR_FILTER_F32* kfr_filter_create_fir_plan_f32(const kfr_f32* taps, size_t size) { +#ifndef CMT_MULTI + return reinterpret_cast<KFR_FILTER_F32*>( + make_fir_filter<float>(make_univector(taps, size))); +#else return reinterpret_cast<KFR_FILTER_F32*>( make_fir_filter<float>(cpu_t::runtime, make_univector(taps, size))); +#endif } KFR_FILTER_F64* kfr_filter_create_fir_plan_f64(const kfr_f64* taps, size_t size) { +#ifndef CMT_MULTI + return reinterpret_cast<KFR_FILTER_F64*>( + make_fir_filter<double>(make_univector(taps, size))); +#else return reinterpret_cast<KFR_FILTER_F64*>( make_fir_filter<double>(cpu_t::runtime, make_univector(taps, size))); +#endif } KFR_FILTER_F32* kfr_filter_create_convolution_plan_f32(const kfr_f32* taps, size_t size, size_t block_size) { +#ifndef CMT_MULTI + return reinterpret_cast<KFR_FILTER_F32*>(make_convolve_filter<float>( + make_univector(taps, size), block_size ? block_size : 1024)); +#else return reinterpret_cast<KFR_FILTER_F32*>(make_convolve_filter<float>( cpu_t::runtime, make_univector(taps, size), block_size ? block_size : 1024)); +#endif } KFR_FILTER_F64* kfr_filter_create_convolution_plan_f64(const kfr_f64* taps, size_t size, size_t block_size) { +#ifndef CMT_MULTI + return reinterpret_cast<KFR_FILTER_F64*>(make_convolve_filter<double>( + make_univector(taps, size), block_size ? block_size : 1024)); +#else return reinterpret_cast<KFR_FILTER_F64*>(make_convolve_filter<double>( cpu_t::runtime, make_univector(taps, size), block_size ? block_size : 1024)); +#endif } KFR_FILTER_F32* kfr_filter_create_iir_plan_f32(const kfr_f32* sos, size_t sos_count) { if (sos_count < 1 || sos_count > 64) return nullptr; + +#ifndef CMT_MULTI + return reinterpret_cast<KFR_FILTER_F32*>(make_biquad_filter<float, 64>( + reinterpret_cast<const biquad_params<float>*>(sos), sos_count)); +#else return reinterpret_cast<KFR_FILTER_F32*>(make_biquad_filter<float, 64>( cpu_t::runtime, reinterpret_cast<const biquad_params<float>*>(sos), sos_count)); +#endif } KFR_FILTER_F64* kfr_filter_create_iir_plan_f64(const kfr_f64* sos, size_t sos_count) { if (sos_count < 1 || sos_count > 64) return nullptr; + +#ifndef CMT_MULTI + return reinterpret_cast<KFR_FILTER_F64*>(make_biquad_filter<double, 64>( + reinterpret_cast<const biquad_params<double>*>(sos), sos_count)); +#else return reinterpret_cast<KFR_FILTER_F64*>(make_biquad_filter<double, 64>( cpu_t::runtime, reinterpret_cast<const biquad_params<double>*>(sos), sos_count)); +#endif } void kfr_filter_process_f32(KFR_FILTER_F32* plan, kfr_f32* output, const kfr_f32* input, size_t size)