Bug 1587244 - Allow NaN in IIR filter output. r=karlt
authorPaul Adenot <paul@paul.cx>
Sun, 20 Oct 2019 21:52:31 +0000
changeset 498316 9705aa1abff2ca780090165b1e6fb7e8b776c325
parent 498315 99b184e791f9717ae0cef21aecc4dc02dd9938b6
child 498317 c8a702f3b356da1219c4318f0abadb63ede25c7e
push id36717
push usernbeleuzu@mozilla.com
push dateMon, 21 Oct 2019 21:51:55 +0000
treeherdermozilla-central@563f437f24b9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs1587244
milestone71.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1587244 - Allow NaN in IIR filter output. r=karlt It's perfectly possible to create unstable filter, that can easily go to infinity, so this assert is not valid. Differential Revision: https://phabricator.services.mozilla.com/D49608
dom/media/webaudio/blink/IIRFilter.cpp
--- a/dom/media/webaudio/blink/IIRFilter.cpp
+++ b/dom/media/webaudio/blink/IIRFilter.cpp
@@ -101,18 +101,18 @@ void IIRFilter::process(const float* sou
     // next output.
     m_xBuffer[m_bufferIndex] = sourceP[n];
     m_yBuffer[m_bufferIndex] = yn;
 
     m_bufferIndex = (m_bufferIndex + 1) & (kBufferLength - 1);
 
     // Avoid introducing a stream of subnormals
     destP[n] = WebCore::DenormalDisabler::flushDenormalFloatToZero(yn);
-    MOZ_ASSERT(destP[n] == 0.0 || fabs(destP[n]) > FLT_MIN,
-               "output should not be subnormal");
+    MOZ_ASSERT(destP[n] == 0.0 || fabs(destP[n]) > FLT_MIN || IsNaN(destP[n]),
+               "output should not be subnormal, but can be NaN");
   }
 }
 
 void IIRFilter::getFrequencyResponse(int nFrequencies, const float* frequency,
                                      float* magResponse, float* phaseResponse) {
   // Evaluate the z-transform of the filter at the given normalized frequencies
   // from 0 to 1. (One corresponds to the Nyquist frequency.)
   //