From fa6bae879c219038544c836e88e0b0e4d867c563 Mon Sep 17 00:00:00 2001 From: Paul Fd Date: Mon, 3 Feb 2020 01:14:36 +0100 Subject: [PATCH] Use a SIMD helper for copying --- src/sfizz/SfzFilter.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/sfizz/SfzFilter.cpp b/src/sfizz/SfzFilter.cpp index 1d936e02..3a16bc31 100644 --- a/src/sfizz/SfzFilter.cpp +++ b/src/sfizz/SfzFilter.cpp @@ -9,6 +9,7 @@ #include "SfzFilterImpls.cxx" #include #include +#include "SIMDHelpers.h" namespace sfz { @@ -128,12 +129,8 @@ template void Filter::process(const float *const in[NCh], float *const out[NCh], float cutoff, float q, float pksh, unsigned nframes) { if (P->fType == kFilterNone) { - for (unsigned c = 0; c < NCh; ++c) { - const float *ch_in = in[c]; - float *ch_out = out[c]; - if (ch_in != ch_out) - std::memcpy(ch_out, ch_in, nframes * sizeof(float)); - } + for (unsigned c = 0; c < NCh; ++c) + copy({ in[c], nframes }, { out[c], nframes }); return; } @@ -198,12 +195,8 @@ template void Filter::processModulated(const float *const in[NCh], float *const out[NCh], const float *cutoff, const float *q, const float *pksh, unsigned nframes) { if (P->fType == kFilterNone) { - for (unsigned c = 0; c < NCh; ++c) { - const float *ch_in = in[c]; - float *ch_out = out[c]; - if (ch_in != ch_out) - std::memcpy(ch_out, ch_in, nframes * sizeof(float)); - } + for (unsigned c = 0; c < NCh; ++c) + copy({ in[c], nframes }, { out[c], nframes }); return; }