Check parameters to biquad filters
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Feb 2012 04:08:50 +0000 (04:08 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Feb 2012 04:08:50 +0000 (04:08 +0000)
commitd2d8210944b66280965b4fd64dc494fb0e22d2ce
treef67262b0876616a6757389a63bbf0b8d0f92021e
parentc08da986ac0e33604b9a9625428008e198bfebf1
Check parameters to biquad filters
https://bugs.webkit.org/show_bug.cgi?id=71413

Source/WebCore:

Patch by Raymond Toy <rtoy@google.com> on 2012-02-02
Reviewed by Kenneth Russell.

Tests added for each filter type and for the limiting cases for
each filter type.

* platform/audio/Biquad.cpp:
(WebCore::Biquad::setLowpassParams):
(WebCore::Biquad::setHighpassParams):
(WebCore::Biquad::setLowShelfParams):
(WebCore::Biquad::setHighShelfParams):
(WebCore::Biquad::setPeakingParams):
(WebCore::Biquad::setAllpassParams):
(WebCore::Biquad::setNotchParams):
(WebCore::Biquad::setBandpassParams):
Check for invalid parameters and clip them to something sensible.
Also check for the limiting cases and try to use the limiting form
of the z-transform for the biquad.  Some issues cannot be
consistently handled because the z-transform is not continuous as
the parameters approach the limit.

LayoutTests:

Patch by Raymond Toy <rtoy@chromium.org> on 2012-02-02
Reviewed by Kenneth Russell.

* webaudio/biquad-allpass-expected.txt: Added
* webaudio/biquad-allpass.html: Added
* webaudio/biquad-bandpass-expected.txt: Added
* webaudio/biquad-bandpass.html: Added
* webaudio/biquad-highpass-expected.txt: Added
* webaudio/biquad-highpass.html: Added
* webaudio/biquad-highshelf-expected.txt: Added
* webaudio/biquad-highshelf.html: Added
* webaudio/biquad-lowpass-expected.txt: Added
* webaudio/biquad-lowpass.html: Added
* webaudio/biquad-lowshelf-expected.txt: Added
* webaudio/biquad-lowshelf.html: Added
* webaudio/biquad-notch-expected.txt: Added
* webaudio/biquad-notch.html: Added
* webaudio/biquad-peaking-expected.txt: Added
* webaudio/biquad-peaking.html: Added
* webaudio/resources/biquad-testing.js: Added

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106621 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
LayoutTests/ChangeLog
LayoutTests/webaudio/biquad-allpass-expected.txt [new file with mode: 0644]
LayoutTests/webaudio/biquad-allpass.html [new file with mode: 0644]
LayoutTests/webaudio/biquad-bandpass-expected.txt [new file with mode: 0644]
LayoutTests/webaudio/biquad-bandpass.html [new file with mode: 0644]
LayoutTests/webaudio/biquad-highpass-expected.txt [new file with mode: 0644]
LayoutTests/webaudio/biquad-highpass.html [new file with mode: 0644]
LayoutTests/webaudio/biquad-highshelf-expected.txt [new file with mode: 0644]
LayoutTests/webaudio/biquad-highshelf.html [new file with mode: 0644]
LayoutTests/webaudio/biquad-lowpass-expected.txt [new file with mode: 0644]
LayoutTests/webaudio/biquad-lowpass.html [new file with mode: 0644]
LayoutTests/webaudio/biquad-lowshelf-expected.txt [new file with mode: 0644]
LayoutTests/webaudio/biquad-lowshelf.html [new file with mode: 0644]
LayoutTests/webaudio/biquad-notch-expected.txt [new file with mode: 0644]
LayoutTests/webaudio/biquad-notch.html [new file with mode: 0644]
LayoutTests/webaudio/biquad-peaking-expected.txt [new file with mode: 0644]
LayoutTests/webaudio/biquad-peaking.html [new file with mode: 0644]
LayoutTests/webaudio/resources/biquad-testing.js [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/audio/Biquad.cpp