From e750cab915535345ed903c787ee3c4c1f9a5952c Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 6 Dec 2020 02:06:48 +0100 Subject: [PATCH] LuaDSP use vectorized peak-finding --- libs/ardour/dsp_filter.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libs/ardour/dsp_filter.cc b/libs/ardour/dsp_filter.cc index f2bcbc800e..8fb572729f 100644 --- a/libs/ardour/dsp_filter.cc +++ b/libs/ardour/dsp_filter.cc @@ -23,6 +23,7 @@ #include "ardour/dB.h" #include "ardour/buffer.h" #include "ardour/dsp_filter.h" +#include "ardour/runtime_functions.h" #ifdef COMPILER_MSVC #include @@ -68,10 +69,7 @@ ARDOUR::DSP::log_meter_coeff (float coeff) { void ARDOUR::DSP::peaks (const float *data, float &min, float &max, uint32_t n_samples) { - for (uint32_t i = 0; i < n_samples; ++i) { - if (data[i] < min) min = data[i]; - if (data[i] > max) max = data[i]; - } + ARDOUR::find_peaks (data, n_samples, &min, &max); } void