commit 68c2f63a7dcf28f9148fa759cce6d5b4232c2833
parent 5efa7b408628f83764e0678378c5bd0888e36907
Author: [email protected] <[email protected]>
Date: Wed, 17 Jan 2024 07:40:18 +0000
Merge branch 'dev' of https://github.com/kfrlib/kfr into dev
Diffstat:
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)