From 54ece22efbb1bcb9784e30021c71d4749d8bd3a7 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 8 Mar 2021 22:19:01 +0100 Subject: [PATCH] Prevent denormals in Lua DSP state (LPF, Biquad) --- libs/ardour/dsp_filter.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/ardour/dsp_filter.cc b/libs/ardour/dsp_filter.cc index 8fb572729f..8ff5a35033 100644 --- a/libs/ardour/dsp_filter.cc +++ b/libs/ardour/dsp_filter.cc @@ -20,6 +20,8 @@ #include #include #include +#include + #include "ardour/dB.h" #include "ardour/buffer.h" #include "ardour/dsp_filter.h" @@ -125,6 +127,7 @@ LowPass::proc (float *data, const uint32_t n_samples) } _z = z; if (!isfinite_local (_z)) { _z = 0; } + else if (!boost::math::isnormal (_z)) { _z = 0; } } void @@ -178,7 +181,9 @@ Biquad::run (float *data, const uint32_t n_samples) } if (!isfinite_local (_z1)) { _z1 = 0; } + else if (!boost::math::isnormal (_z1)) { _z1 = 0; } if (!isfinite_local (_z2)) { _z2 = 0; } + else if (!boost::math::isnormal (_z2)) { _z2 = 0; } } void