haikuwebkit/LayoutTests/webaudio/OfflineAudioContext/offlineaudiocontext-promise...

10 lines
345 B
Plaintext
Raw Permalink Normal View History

Don't modify the response when creating a ConvolverNode https://bugs.webkit.org/show_bug.cgi?id=216093 Reviewed by Eric Carlson. Source/WebCore: When creating a ConvolverNode with normalization (the default), the ConvolverNode was modifying the supplied AudioBuffer containing the desired impulse response. This happens because the normalization factor was applied to the buffer, convolver stages were computed, and then the normalization was undone. Due to floating-point roundoff, this can (and does) modify the buffer. Instead, compute the scale factor and pass it into the various routines so that the scaling can be done there. For stages using an FFT, the resulting FFT is scaled by the factor. For the direct convolver, the response is modified there. (The direct convolver makes a copy of the reponse, so this is safe.) This is a cherry-pick of the following Blink change by Raymond Toy: - https://chromium-review.googlesource.com/c/chromium/src/+/1623457 Test: webaudio/convolvernode-unmodified-buffer.html * platform/audio/FFTFrame.cpp: (WebCore::FFTFrame::scaleFFT): * platform/audio/FFTFrame.h: * platform/audio/Reverb.cpp: (WebCore::Reverb::Reverb): (WebCore::Reverb::initialize): * platform/audio/Reverb.h: * platform/audio/ReverbConvolver.cpp: (WebCore::ReverbConvolver::ReverbConvolver): * platform/audio/ReverbConvolver.h: * platform/audio/ReverbConvolverStage.cpp: (WebCore::ReverbConvolverStage::ReverbConvolverStage): * platform/audio/ReverbConvolverStage.h: LayoutTests: Import layout test from Blink. * webaudio/convolvernode-unmodified-buffer-expected.txt: Added. * webaudio/convolvernode-unmodified-buffer.html: Added. Canonical link: https://commits.webkit.org/228894@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266492 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-02 22:11:59 +00:00
PASS # AUDIT TASK RUNNER STARTED.
PASS Executing "test"
PASS Audit report
PASS > [test] OfflineAudioContext.startRendering Promise with oncomplete
PASS AudioBuffer returned by oncomplete and promise are identical is true.
PASS < [test] All assertions passed. (total 1 assertions)
PASS # AUDIT TASK RUNNER FINISHED: 1 tasks ran successfully.
Don't modify the response when creating a ConvolverNode https://bugs.webkit.org/show_bug.cgi?id=216093 Reviewed by Eric Carlson. Source/WebCore: When creating a ConvolverNode with normalization (the default), the ConvolverNode was modifying the supplied AudioBuffer containing the desired impulse response. This happens because the normalization factor was applied to the buffer, convolver stages were computed, and then the normalization was undone. Due to floating-point roundoff, this can (and does) modify the buffer. Instead, compute the scale factor and pass it into the various routines so that the scaling can be done there. For stages using an FFT, the resulting FFT is scaled by the factor. For the direct convolver, the response is modified there. (The direct convolver makes a copy of the reponse, so this is safe.) This is a cherry-pick of the following Blink change by Raymond Toy: - https://chromium-review.googlesource.com/c/chromium/src/+/1623457 Test: webaudio/convolvernode-unmodified-buffer.html * platform/audio/FFTFrame.cpp: (WebCore::FFTFrame::scaleFFT): * platform/audio/FFTFrame.h: * platform/audio/Reverb.cpp: (WebCore::Reverb::Reverb): (WebCore::Reverb::initialize): * platform/audio/Reverb.h: * platform/audio/ReverbConvolver.cpp: (WebCore::ReverbConvolver::ReverbConvolver): * platform/audio/ReverbConvolver.h: * platform/audio/ReverbConvolverStage.cpp: (WebCore::ReverbConvolverStage::ReverbConvolverStage): * platform/audio/ReverbConvolverStage.h: LayoutTests: Import layout test from Blink. * webaudio/convolvernode-unmodified-buffer-expected.txt: Added. * webaudio/convolvernode-unmodified-buffer.html: Added. Canonical link: https://commits.webkit.org/228894@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266492 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-02 22:11:59 +00:00