Diff
Modified: releases/WebKitGTK/webkit-2.30/LayoutTests/ChangeLog (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/ChangeLog 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/ChangeLog 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,3 +1,42 @@
+2020-08-12 Lauro Moura <[email protected]>
+
+ Highpass Biquads use old formulas
+ https://bugs.webkit.org/show_bug.cgi?id=181191
+
+ Reviewed by Darin Adler.
+
+ Gardening r265517 (lowpass) showed our test failing for GStreamer due
+ to a different threshold than used by the imported WPT biquad tests.
+
+ As they test the same functionality, remove the old webaudio/biquad
+ tests and keep using the imported WPT ones with the detailed
+ thresholds.
+
+ * platform/glib/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-highpass-expected.txt: Removed.
+ * platform/mac-wk2/TestExpectations: Removed expectation regarding
+ deleted file.
+ * webaudio/biquad-allpass-expected.txt: Removed.
+ * webaudio/biquad-allpass.html: Removed.
+ * webaudio/biquad-bandpass-expected.txt: Removed.
+ * webaudio/biquad-bandpass.html: Removed.
+ * webaudio/biquad-getFrequencyResponse-expected.txt: Removed.
+ * webaudio/biquad-getFrequencyResponse.html: Removed.
+ * webaudio/biquad-highpass-expected.txt: Removed.
+ * webaudio/biquad-highpass.html: Removed.
+ * webaudio/biquad-highshelf-expected.txt: Removed.
+ * webaudio/biquad-highshelf.html: Removed.
+ * webaudio/biquad-lowpass-expected.txt: Removed.
+ * webaudio/biquad-lowpass.html: Removed.
+ * webaudio/biquad-lowshelf-expected.txt: Removed.
+ * webaudio/biquad-lowshelf.html: Removed.
+ * webaudio/biquad-notch-expected.txt: Removed.
+ * webaudio/biquad-notch.html: Removed.
+ * webaudio/biquad-peaking-expected.txt: Removed.
+ * webaudio/biquad-peaking.html: Removed.
+ * webaudio/biquadfilternode-basic-expected.txt: Removed.
+ * webaudio/biquadfilternode-basic.html: Removed.
+ * webaudio/resources/biquad-testing.js: Removed.
+
2020-08-11 Lauro Moura <[email protected]>
[GTK] Garden accessibility failures after r265514
Modified: releases/WebKitGTK/webkit-2.30/LayoutTests/imported/w3c/ChangeLog (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/imported/w3c/ChangeLog 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/imported/w3c/ChangeLog 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,3 +1,14 @@
+2020-08-12 Lauro Moura <[email protected]>
+
+ Highpass Biquads use old formulas
+ https://bugs.webkit.org/show_bug.cgi?id=181191
+
+ Reviewed by Darin Adler.
+
+ *
+ web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-highpass-expected.txt:
+ Rebaselined
+
2020-08-11 Chris Dumez <[email protected]>
Fix WaveShapperNode's waveshaping curve implementation
Modified: releases/WebKitGTK/webkit-2.30/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-highpass-expected.txt (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-highpass-expected.txt 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-highpass-expected.txt 2020-08-14 06:39:16 UTC (rev 265656)
@@ -5,7 +5,7 @@
PASS > [test] Biquad highpass filter
PASS Number of filters tested is equal to 3.
PASS Number of non-finite values in the rendered output is equal to 0.
-FAIL X Max error in Highpass filter response is not less than or equal to 1.5487e-8. Got 0.04815642594182673. assert_true: expected true got false
-FAIL < [test] 1 out of 3 assertions were failed. assert_true: expected true got false
-FAIL # AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed. assert_true: expected true got false
+PASS Max error in Highpass filter response is less than or equal to 1.5487e-8.
+PASS < [test] All assertions passed. (total 3 assertions)
+PASS # AUDIT TASK RUNNER FINISHED: 1 tasks ran successfully.
Deleted: releases/WebKitGTK/webkit-2.30/LayoutTests/platform/glib/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-highpass-expected.txt (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/platform/glib/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-highpass-expected.txt 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/platform/glib/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-highpass-expected.txt 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,11 +0,0 @@
-
-PASS # AUDIT TASK RUNNER STARTED.
-PASS Executing "test"
-PASS Audit report
-PASS > [test] Biquad highpass filter
-PASS Number of filters tested is equal to 3.
-PASS Number of non-finite values in the rendered output is equal to 0.
-FAIL X Max error in Highpass filter response is not less than or equal to 1.5487e-8. Got 0.04815645574414912. assert_true: expected true got false
-FAIL < [test] 1 out of 3 assertions were failed. assert_true: expected true got false
-FAIL # AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed. assert_true: expected true got false
-
Modified: releases/WebKitGTK/webkit-2.30/LayoutTests/platform/mac-wk2/TestExpectations (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/platform/mac-wk2/TestExpectations 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/platform/mac-wk2/TestExpectations 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1056,8 +1056,6 @@
webkit.org/b/213292 [ Catalina Release ] http/tests/IndexedDB/storage-limit-1.https.html [ Pass Failure ]
-webkit.org/b/213375 [ Debug ] webaudio/biquad-bandpass.html [ Pass Crash ]
-
webkit.org/b/213461 fast/mediastream/mediastreamtrack-video-frameRate-clone-increasing.html [ Pass Failure ]
webkit.org/b/213553 http/tests/resourceLoadStatistics/grandfathering-database.html [ Pass Timeout ]
Deleted: releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-allpass-expected.txt (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-allpass-expected.txt 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-allpass-expected.txt 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,11 +0,0 @@
-Tests Biquad allpass filter.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-PASS Rendered output did not have infinities or NaNs.
-PASS Allpass filter response is correct.
-PASS Test signal was correctly filtered.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Deleted: releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-allpass.html (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-allpass.html 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-allpass.html 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,39 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-<head>
-<script src=""
-<script src=""
-<script src=""
-</head>
-
-<body>
-
-<div id="description"></div>
-<div id="console"></div>
-
-<script>
-description("Tests Biquad allpass filter.");
-
-function runTest() {
- window.jsTestIsAsync = true;
-
- // Create offline audio context.
- var context = new webkitOfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate);
-
- // Dummy filter to get filter type constant
- var f = context.createBiquadFilter();
-
- var filterParameters = [{cutoff : 0, q : 10, gain : 1 },
- {cutoff : 1, q : 10, gain : 1 },
- {cutoff : .5, q : 0, gain : 1 },
- {cutoff : 0.25, q : 10, gain : 1 },
- ];
- createTestAndRun(context, "allpass", filterParameters);
-}
-
-runTest();
-
-</script>
-</body>
-</html>
Deleted: releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-bandpass-expected.txt (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-bandpass-expected.txt 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-bandpass-expected.txt 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,11 +0,0 @@
-Tests Biquad bandpass filter.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-PASS Rendered output did not have infinities or NaNs.
-PASS Bandpass filter response is correct.
-PASS Test signal was correctly filtered.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Deleted: releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-bandpass.html (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-bandpass.html 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-bandpass.html 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,41 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-<head>
-<script src=""
-<script src=""
-<script src=""
-</head>
-
-<body>
-
-<div id="description"></div>
-<div id="console"></div>
-
-<script>
-description("Tests Biquad bandpass filter.");
-
-function runTest() {
- window.jsTestIsAsync = true;
-
- // Create offline audio context.
- var context = new webkitOfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate);
-
- // Dummy filter to get filter type constant
- var f = context.createBiquadFilter();
-
- // The filters we want to test.
- var filterParameters = [{cutoff : 0, q : 0, gain : 1 },
- {cutoff : 1, q : 0, gain : 1 },
- {cutoff : 0.5, q : 0, gain : 1 },
- {cutoff : 0.25, q : 1, gain : 1 },
- ];
-
- createTestAndRun(context, "bandpass", filterParameters);
-}
-
-runTest();
-
-</script>
-</body>
-</html>
Deleted: releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-getFrequencyResponse-expected.txt (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-getFrequencyResponse-expected.txt 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-getFrequencyResponse-expected.txt 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,11 +0,0 @@
-Test Biquad getFrequencyResponse() functionality.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-PASS Magnitude response within acceptable threshold.
-PASS Phase response within acceptable threshold.
-PASS Frequency response was correct.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Deleted: releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-getFrequencyResponse.html (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-getFrequencyResponse.html 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-getFrequencyResponse.html 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,306 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<script src=""
-<script src=""
-<script src=""
-</head>
-
-<body>
-<div id="description"></div>
-<div id="console"></div>
-
-<script>
-description("Test Biquad getFrequencyResponse() functionality.");
-
-// Test the frequency response of a biquad filter. We compute the frequency response for a simple
-// peaking biquad filter and compare it with the expected frequency response. The actual filter
-// used doesn't matter since we're testing getFrequencyResponse and not the actual filter output.
-// The filters are extensively tested in other biquad tests.
-
-var context;
-
-// The biquad filter node.
-var filter;
-
-// The magnitude response of the biquad filter.
-var magResponse;
-
-// The phase response of the biquad filter.
-var phaseResponse;
-
-// Number of frequency samples to take.
-var numberOfFrequencies = 1000;
-
-// The filter parameters.
-var filterCutoff = 1000; // Hz.
-var filterQ = 1;
-var filterGain = 5; // Decibels.
-
-// The maximum allowed error in the magnitude response.
-var maxAllowedMagError = 5.7e-7;
-
-// The maximum allowed error in the phase response.
-var maxAllowedPhaseError = 4.7e-8;
-
-// The magnitudes and phases of the reference frequency response.
-var magResponse;
-var phaseResponse;
-
-// The magnitudes and phases of the reference frequency response.
-var expectedMagnitudes;
-var expectedPhases;
-
-// Convert frequency in Hz to a normalized frequency between 0 to 1 with 1 corresponding to the
-// Nyquist frequency.
-function normalizedFrequency(freqHz, sampleRate)
-{
- var nyquist = sampleRate / 2;
- return freqHz / nyquist;
-}
-
-// Get the filter response at a (normalized) frequency |f| for the filter with coefficients |coef|.
-function getResponseAt(coef, f)
-{
- var b0 = coef.b0;
- var b1 = coef.b1;
- var b2 = coef.b2;
- var a1 = coef.a1;
- var a2 = coef.a2;
-
- // H(z) = (b0 + b1 / z + b2 / z^2) / (1 + a1 / z + a2 / z^2)
- //
- // Compute H(exp(i * pi * f)). No native complex numbers in _javascript_, so break H(exp(i * pi * // f))
- // in to the real and imaginary parts of the numerator and denominator. Let omega = pi * f.
- // Then the numerator is
- //
- // b0 + b1 * cos(omega) + b2 * cos(2 * omega) - i * (b1 * sin(omega) + b2 * sin(2 * omega))
- //
- // and the denominator is
- //
- // 1 + a1 * cos(omega) + a2 * cos(2 * omega) - i * (a1 * sin(omega) + a2 * sin(2 * omega))
- //
- // Compute the magnitude and phase from the real and imaginary parts.
-
- var omega = Math.PI * f;
- var numeratorReal = b0 + b1 * Math.cos(omega) + b2 * Math.cos(2 * omega);
- var numeratorImag = -(b1 * Math.sin(omega) + b2 * Math.sin(2 * omega));
- var denominatorReal = 1 + a1 * Math.cos(omega) + a2 * Math.cos(2 * omega);
- var denominatorImag = -(a1 * Math.sin(omega) + a2 * Math.sin(2 * omega));
-
- var magnitude = Math.sqrt((numeratorReal * numeratorReal + numeratorImag * numeratorImag)
- / (denominatorReal * denominatorReal + denominatorImag * denominatorImag));
- var phase = Math.atan2(numeratorImag, numeratorReal) - Math.atan2(denominatorImag, denominatorReal);
-
- if (phase >= Math.PI) {
- phase -= 2 * Math.PI;
- } else if (phase <= -Math.PI) {
- phase += 2 * Math.PI;
- }
-
- return {magnitude : magnitude, phase : phase};
-}
-
-// Compute the reference frequency response for the biquad filter |filter| at the frequency samples
-// given by |frequencies|.
-function frequencyResponseReference(filter, frequencies)
-{
- var sampleRate = filter.context.sampleRate;
- var normalizedFreq = normalizedFrequency(filter.frequency.value, sampleRate);
- var filterCoefficients = createFilter(filter.type, normalizedFreq, filter.Q.value, filter.gain.value);
-
- var magnitudes = [];
- var phases = [];
-
- for (var k = 0; k < frequencies.length; ++k) {
- var response = getResponseAt(filterCoefficients, normalizedFrequency(frequencies[k], sampleRate));
- magnitudes.push(response.magnitude);
- phases.push(response.phase);
- }
-
- return {magnitudes : magnitudes, phases : phases};
-}
-
-// Compute a set of linearly spaced frequencies.
-function createFrequencies(nFrequencies, sampleRate)
-{
- var frequencies = new Float32Array(nFrequencies);
- var nyquist = sampleRate / 2;
- var freqDelta = nyquist / nFrequencies;
-
- for (var k = 0; k < nFrequencies; ++k) {
- frequencies[k] = k * freqDelta;
- }
-
- return frequencies;
-}
-
-function linearToDecibels(x)
-{
- if (x) {
- return 20 * Math.log(x) / Math.LN10;
- } else {
- return -1000;
- }
-}
-
-// Look through the array and find any NaN or infinity. Returns the index of the first occurence or
-// -1 if none.
-function findBadNumber(signal)
-{
- for (var k = 0; k < signal.length; ++k) {
- if (!isValidNumber(signal[k])) {
- return k;
- }
- }
- return -1;
-}
-
-// Compute absolute value of the difference between phase angles, taking into account the wrapping
-// of phases.
-function absolutePhaseDifference(x, y)
-{
- var diff = Math.abs(x - y);
-
- if (diff > Math.PI) {
- diff = 2 * Math.PI - diff;
- }
- return diff;
-}
-
-// Compare the frequency response with our expected response.
-function compareResponses(filter, frequencies, magResponse, phaseResponse)
-{
- var expectedResponse = frequencyResponseReference(filter, frequencies);
-
- expectedMagnitudes = expectedResponse.magnitudes;
- expectedPhases = expectedResponse.phases;
-
- var n = magResponse.length;
- var success = true;
- var badResponse = false;
-
- var maxMagError = -1;
- var maxMagErrorIndex = -1;
-
- var k;
- var hasBadNumber;
-
- hasBadNumber = findBadNumber(magResponse);
- if (hasBadNumber >= 0) {
- testFailed("Magnitude response has NaN or infinity at " + hasBadNumber);
- success = false;
- badResponse = true;
- }
-
- hasBadNumber = findBadNumber(phaseResponse);
- if (hasBadNumber >= 0) {
- testFailed("Phase response has NaN or infinity at " + hasBadNumber);
- success = false;
- badResponse = true;
- }
-
- // These aren't testing the implementation itself. Instead, these are sanity checks on the
- // reference. Failure here does not imply an error in the implementation.
- hasBadNumber = findBadNumber(expectedMagnitudes);
- if (hasBadNumber >= 0) {
- testFailed("Expected magnitude response has NaN or infinity at " + hasBadNumber);
- success = false;
- badResponse = true;
- }
-
- hasBadNumber = findBadNumber(expectedPhases);
- if (hasBadNumber >= 0) {
- testFailed("Expected phase response has NaN or infinity at " + hasBadNumber);
- success = false;
- badResponse = true;
- }
-
- // If we found a NaN or infinity, the following tests aren't very helpful, especially for NaN.
- // We run them anyway, after printing a warning message.
-
- if (badResponse) {
- testFailed("NaN or infinity in the actual or expected results makes the following test results suspect.");
- success = false;
- }
-
- for (k = 0; k < n; ++k) {
- var error = Math.abs(linearToDecibels(magResponse[k]) - linearToDecibels(expectedMagnitudes[k]));
- if (error > maxMagError) {
- maxMagError = error;
- maxMagErrorIndex = k;
- }
- }
-
- if (maxMagError > maxAllowedMagError) {
- var message = "Magnitude error (" + maxMagError + " dB)";
- message += " exceeded threshold at " + frequencies[maxMagErrorIndex];
- message += " Hz. Actual: " + linearToDecibels(magResponse[maxMagErrorIndex]);
- message += " dB, expected: " + linearToDecibels(expectedMagnitudes[maxMagErrorIndex]) + " dB.";
- testFailed(message);
- success = false;
- } else {
- testPassed("Magnitude response within acceptable threshold.");
- }
-
- var maxPhaseError = -1;
- var maxPhaseErrorIndex = -1;
-
- for (k = 0; k < n; ++k) {
- var error = absolutePhaseDifference(phaseResponse[k], expectedPhases[k]);
- if (error > maxPhaseError) {
- maxPhaseError = error;
- maxPhaseErrorIndex = k;
- }
- }
-
- if (maxPhaseError > maxAllowedPhaseError) {
- var message = "Phase error (radians) (" + maxPhaseError;
- message += ") exceeded threshold at " + frequencies[maxPhaseErrorIndex];
- message += " Hz. Actual: " + phaseResponse[maxPhaseErrorIndex];
- message += " expected: " + expectedPhases[maxPhaseErrorIndex];
- testFailed(message);
- success = false;
- } else {
- testPassed("Phase response within acceptable threshold.");
- }
-
-
- return success;
-}
-
-function runTest()
-{
- window.jsTestIsAsync = true;
-
- context = new webkitAudioContext();
-
- filter = context.createBiquadFilter();
-
- // Arbitrarily test a peaking filter, but any kind of filter can be tested.
- filter.type = "peaking";
- filter.frequency.value = filterCutoff;
- filter.Q.value = filterQ;
- filter.gain.value = filterGain;
-
- var frequencies = createFrequencies(numberOfFrequencies, context.sampleRate);
- magResponse = new Float32Array(numberOfFrequencies);
- phaseResponse = new Float32Array(numberOfFrequencies);
-
- filter.getFrequencyResponse(frequencies, magResponse, phaseResponse);
- var success = compareResponses(filter, frequencies, magResponse, phaseResponse);
-
- if (success) {
- testPassed("Frequency response was correct.");
- } else {
- testFailed("Frequency response was incorrect.");
- }
-
- finishJSTest();
-}
-
-runTest();
-
-</script>
-</body>
-</html>
Deleted: releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-highpass-expected.txt (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-highpass-expected.txt 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-highpass-expected.txt 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,11 +0,0 @@
-Tests Biquad highpass filter.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-PASS Rendered output did not have infinities or NaNs.
-PASS Highpass filter response is correct.
-PASS Test signal was correctly filtered.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Deleted: releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-highpass.html (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-highpass.html 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-highpass.html 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,39 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-<head>
-<script src=""
-<script src=""
-<script src=""
-</head>
-
-<body>
-
-<div id="description"></div>
-<div id="console"></div>
-
-<script>
-description("Tests Biquad highpass filter.");
-
-function runTest() {
- window.jsTestIsAsync = true;
-
- // Create offline audio context.
- var context = new webkitOfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate);
-
- // Dummy filter to get filter type constant
- var f = context.createBiquadFilter();
-
- // The filters we want to test.
- var filterParameters = [{cutoff : 0, q : 1, gain : 1 },
- {cutoff : 1, q : 1, gain : 1 },
- {cutoff : 0.25, q : 1, gain : 1 },
- ];
-
- createTestAndRun(context, "highpass", filterParameters);
-}
-
-runTest();
-</script>
-</body>
-</html>
Deleted: releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-highshelf-expected.txt (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-highshelf-expected.txt 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-highshelf-expected.txt 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,11 +0,0 @@
-Tests Biquad highshelf filter.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-PASS Rendered output did not have infinities or NaNs.
-PASS Highshelf filter response is correct.
-PASS Test signal was correctly filtered.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Deleted: releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-highshelf.html (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-highshelf.html 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-highshelf.html 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,40 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-<head>
-<script src=""
-<script src=""
-<script src=""
-</head>
-
-<body>
-
-<div id="description"></div>
-<div id="console"></div>
-
-<script>
-description("Tests Biquad highshelf filter.");
-
-function runTest() {
- window.jsTestIsAsync = true;
-
- // Create offline audio context.
- var context = new webkitOfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate);
-
- // Dummy filter to get filter type constant
- var f = context.createBiquadFilter();
-
- // The filters we want to test.
- var filterParameters = [{cutoff : 0, q : 10, gain : 10 },
- {cutoff : 1, q : 10, gain : 10 },
- {cutoff : 0.25, q : 10, gain : 10 },
- ];
-
- createTestAndRun(context, "highshelf", filterParameters);
-}
-
-runTest();
-
-</script>
-</body>
-</html>
Deleted: releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-lowpass-expected.txt (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-lowpass-expected.txt 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-lowpass-expected.txt 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,11 +0,0 @@
-Tests Biquad lowpass filter.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-PASS Rendered output did not have infinities or NaNs.
-PASS Lowpass filter response is correct.
-PASS Test signal was correctly filtered.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Deleted: releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-lowpass.html (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-lowpass.html 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-lowpass.html 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,43 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-<head>
-<script src=""
-<script src=""
-<script src=""
-</head>
-
-<body>
-
-<div id="description"></div>
-<div id="console"></div>
-
-<script>
-description("Tests Biquad lowpass filter.");
-
-window.OfflineAudioContext = window.OfflineAudioContext || window.webkitOfflineAudioContext;
-
-function runTest() {
- window.jsTestIsAsync = true;
-
- // Create offline audio context.
- var context = new OfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate);
-
- // Dummy filter to get filter type constant
- var f = context.createBiquadFilter();
-
- // The filters we want to test.
- var filterParameters = [{cutoff : 0, q : 1, gain : 1 },
- {cutoff : 1, q : 1, gain : 1 },
- {cutoff : 0.25, q : 1, gain : 1 },
- {cutoff : 0.25, q : 1, gain : 1, detune : 100 },
- {cutoff : 0.01, q : 1, gain : 1, detune : -200 },
- ];
- createTestAndRun(context, "lowpass", filterParameters);
-}
-
-runTest();
-
-</script>
-</body>
-</html>
Deleted: releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-lowshelf-expected.txt (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-lowshelf-expected.txt 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-lowshelf-expected.txt 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,11 +0,0 @@
-Tests Biquad lowshelf filter.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-PASS Rendered output did not have infinities or NaNs.
-PASS Lowshelf filter response is correct.
-PASS Test signal was correctly filtered.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Deleted: releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-lowshelf.html (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-lowshelf.html 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-lowshelf.html 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,40 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-<head>
-<script src=""
-<script src=""
-<script src=""
-</head>
-
-<body>
-
-<div id="description"></div>
-<div id="console"></div>
-
-<script>
-description("Tests Biquad lowshelf filter.");
-
-function runTest() {
- window.jsTestIsAsync = true;
-
- // Create offline audio context.
- var context = new webkitOfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate);
-
- // Dummy filter to get filter type constant
- var f = context.createBiquadFilter();
-
- // The filters we want to test.
- var filterParameters = [{cutoff : 0, q : 10, gain : 10 },
- {cutoff : 1, q : 10, gain : 10 },
- {cutoff : 0.25, q : 10, gain : 10 },
- ];
-
- createTestAndRun(context, "lowshelf", filterParameters);
-}
-
-runTest();
-
-</script>
-</body>
-</html>
Deleted: releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-notch-expected.txt (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-notch-expected.txt 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-notch-expected.txt 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,11 +0,0 @@
-Tests Biquad notch filter.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-PASS Rendered output did not have infinities or NaNs.
-PASS Notch filter response is correct.
-PASS Test signal was correctly filtered.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Deleted: releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-notch.html (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-notch.html 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-notch.html 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,40 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-<head>
-<script src=""
-<script src=""
-<script src=""
-</head>
-
-<body>
-
-<div id="description"></div>
-<div id="console"></div>
-
-<script>
-description("Tests Biquad notch filter.");
-
-function runTest() {
- window.jsTestIsAsync = true;
-
- // Create offline audio context.
- var context = new webkitOfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate);
-
- // Dummy filter to get filter type constant
- var f = context.createBiquadFilter();
-
- var filterParameters = [{cutoff : 0, q : 10, gain : 1 },
- {cutoff : 1, q : 10, gain : 1 },
- {cutoff : .5, q : 0, gain : 1 },
- {cutoff : 0.25, q : 10, gain : 1 },
- ];
-
- createTestAndRun(context, "notch", filterParameters);
-}
-
-runTest();
-
-</script>
-</body>
-</html>
Deleted: releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-peaking-expected.txt (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-peaking-expected.txt 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-peaking-expected.txt 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,11 +0,0 @@
-Tests Biquad peaking filter.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-PASS Rendered output did not have infinities or NaNs.
-PASS Peaking filter response is correct.
-PASS Test signal was correctly filtered.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Deleted: releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-peaking.html (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-peaking.html 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquad-peaking.html 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,41 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-<head>
-<script src=""
-<script src=""
-<script src=""
-</head>
-
-<body>
-
-<div id="description"></div>
-<div id="console"></div>
-
-<script>
-description("Tests Biquad peaking filter.");
-
-function runTest() {
- window.jsTestIsAsync = true;
-
- // Create offline audio context.
- var context = new webkitOfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate);
-
- // Dummy filter to get filter type constant
- var f = context.createBiquadFilter();
-
- // The filters we want to test.
- var filterParameters = [{cutoff : 0, q : 10, gain : 10 },
- {cutoff : 1, q : 10, gain : 10 },
- {cutoff : .5, q : 0, gain : 10 },
- {cutoff : 0.25, q : 10, gain : 10 },
- ];
-
- createTestAndRun(context, "peaking", filterParameters);
-}
-
-runTest();
-
-</script>
-</body>
-</html>
Deleted: releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquadfilternode-basic-expected.txt (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquadfilternode-basic-expected.txt 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquadfilternode-basic-expected.txt 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,24 +0,0 @@
-Basic tests for BiquadFilterNode.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-PASS BiquadFilterNode has one input.
-PASS BiquadFilterNode has one output.
-PASS Biquad filter defaults to low-pass filter.
-PASS The default value of frequency is 350.
-PASS The default value of Q is 1.
-PASS The default value of gain is 0.
-PASS Biquad filter type 'lowpass' is settable.
-PASS Biquad filter type 'highpass' is settable.
-PASS Biquad filter type 'bandpass' is settable.
-PASS Biquad filter type 'lowshelf' is settable.
-PASS Biquad filter type 'highshelf' is settable.
-PASS Biquad filter type 'peaking' is settable.
-PASS Biquad filter type 'notch' is settable.
-PASS Biquad filter type 'allpass' is settable.
-PASS Setting .type to illegal string value did not throw an exception.
-PASS Setting .type to illegal type did not throw an exception.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Deleted: releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquadfilternode-basic.html (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquadfilternode-basic.html 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/biquadfilternode-basic.html 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,86 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src=""
-<script src=""
-</head>
-
-<body>
-<div id="description"></div>
-<div id="console"></div>
-
-<script>
-description("Basic tests for BiquadFilterNode.");
-
-var context = 0;
-
-function runTest() {
- context = new webkitAudioContext();
- var filter = context.createBiquadFilter();
-
- if (filter.numberOfInputs === 1)
- testPassed("BiquadFilterNode has one input.");
- else
- testFailed("BiquadFilterNode should have one input.");
-
- if (filter.numberOfOutputs === 1)
- testPassed("BiquadFilterNode has one output.");
- else
- testFailed("BiquadFilterNode should have one output.");
-
- if (filter.type === "lowpass")
- testPassed("Biquad filter defaults to low-pass filter.");
- else
- testFailed("Biquad filter should default to low-pass filter.");
-
- if (filter.frequency.value === 350)
- testPassed("The default value of frequency is 350.");
- else
- testFailed("The default value of frequency should be 350.");
-
- if (filter.Q.value === 1)
- testPassed("The default value of Q is 1.");
- else
- testFailed("The default value of Q should be 1.");
-
- if (filter.gain.value === 0)
- testPassed("The default value of gain is 0.");
- else
- testFailed("The default value of gain should be 0.");
-
- // Check that all legal filter types can be set.
- var filterTypeArray = [{type: "lowpass"},
- {type: "highpass"},
- {type: "bandpass"},
- {type: "lowshelf"},
- {type: "highshelf"},
- {type: "peaking"},
- {type: "notch"},
- {type: "allpass"}];
-
- for (var i = 0; i < filterTypeArray.length; ++i) {
- try {
- filter.type = filterTypeArray[i].type;
- if (filter.type === filterTypeArray[i].type) {
- var message = "Biquad filter type '" + filterTypeArray[i].type + "' is settable.";
- testPassed(message);
- } else {
- var message = "Biquad filter type '" + filterTypeArray[i].type + "' was not correctly set.";
- testFailed(message);
- }
- } catch(e) {
- var message = "Biquad filter type " + i + " should not throw exception.";
- testFailed(message);
- }
- }
-
- // Check that we don't throw an exception for illegal .type values as per WebIDL.
- shouldNotThrowException(function() { filter.type = "xyz12349jfksd"; }, "Setting .type to illegal string value");
- shouldNotThrowException(function() { filter.type = new Float32Array(1); }, "Setting .type to illegal type");
-}
-
-runTest();
-
-</script>
-</body>
-</html>
Deleted: releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/resources/biquad-testing.js (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/resources/biquad-testing.js 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/webaudio/resources/biquad-testing.js 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,544 +0,0 @@
-// Globals, to make testing and debugging easier.
-var context;
-var filter;
-var signal;
-var renderedBuffer;
-var renderedData;
-
-var sampleRate = 44100.0;
-var pulseLengthFrames = .1 * sampleRate;
-
-// Maximum allowed error for the test to succeed. Experimentally determined.
-var maxAllowedError = 5.9e-8;
-
-// This must be large enough so that the filtered result is
-// essentially zero. See comments for createTestAndRun.
-var timeStep = .1;
-
-// Maximum number of filters we can process (mostly for setting the
-// render length correctly.)
-var maxFilters = 5;
-
-// How long to render. Must be long enough for all of the filters we
-// want to test.
-var renderLengthSeconds = timeStep * (maxFilters + 1) ;
-
-var renderLengthSamples = Math.round(renderLengthSeconds * sampleRate);
-
-// Number of filters that will be processed.
-var nFilters;
-
-// A biquad filter has a z-transform of
-// H(z) = (b0 + b1 / z + b2 / z^2) / (1 + a1 / z + a2 / z^2)
-//
-// The formulas for the various filters were taken from
-// http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt.
-
-
-// Lowpass filter.
-function createLowpassFilter(freq, q, gain) {
- var b0;
- var b1;
- var b2;
- var a1;
- var a2;
-
- if (freq == 1) {
- // The formula below works, except for roundoff. When freq = 1,
- // the filter is just a wire, so hardwire the coefficients.
- return {b0: 1, b1: 0, b2: 0, a1: 0, a2: 0};
- } else {
- var resonance = Math.pow(10, q / 20);
- var theta = Math.PI * freq;
- var alpha = Math.sin(theta) / (2 * resonance);
- var cosw = Math.cos(theta);
- var beta = (1 - cosw) / 2;
-
- b0 = beta;
- b1 = 2 * beta;
- b2 = beta;
-
- a0 = 1 + alpha;
- a1 = -2 * cosw;
- a2 = 1 - alpha;
-
- return normalizeFilterCoefficients(b0, b1, b2, a0, a1, a2);
- }
-}
-
-function createHighpassFilter(freq, q, gain) {
- var b0;
- var b1;
- var b2;
- var a1;
- var a2;
-
- if (freq == 1) {
- // The filter is 0
- b0 = 0;
- b1 = 0;
- b2 = 0;
- a1 = 0;
- a2 = 0;
- } else if (freq == 0) {
- // The filter is 1. Computation of coefficients below is ok, but
- // there's a pole at 1 and a zero at 1, so round-off could make
- // the filter unstable.
- b0 = 1;
- b1 = 0;
- b2 = 0;
- a1 = 0;
- a2 = 0;
- } else {
- var g = Math.pow(10, q / 20);
- var d = Math.sqrt((4 - Math.sqrt(16 - 16 / (g * g))) / 2);
- var theta = Math.PI * freq;
- var sn = d * Math.sin(theta) / 2;
- var beta = 0.5 * (1 - sn) / (1 + sn);
- var gamma = (0.5 + beta) * Math.cos(theta);
- var alpha = 0.25 * (0.5 + beta + gamma);
-
- b0 = 2 * alpha;
- b1 = -4 * alpha;
- b2 = 2 * alpha;
- a1 = 2 * (-gamma);
- a2 = 2 * beta;
- }
-
- return {b0 : b0, b1 : b1, b2 : b2, a1 : a1, a2 : a2};
-}
-
-function normalizeFilterCoefficients(b0, b1, b2, a0, a1, a2) {
- var scale = 1 / a0;
-
- return {b0 : b0 * scale,
- b1 : b1 * scale,
- b2 : b2 * scale,
- a1 : a1 * scale,
- a2 : a2 * scale};
-}
-
-function createBandpassFilter(freq, q, gain) {
- var b0;
- var b1;
- var b2;
- var a0;
- var a1;
- var a2;
- var coef;
-
- if (freq > 0 && freq < 1) {
- var w0 = Math.PI * freq;
- if (q > 0) {
- var alpha = Math.sin(w0) / (2 * q);
- var k = Math.cos(w0);
-
- b0 = alpha;
- b1 = 0;
- b2 = -alpha;
- a0 = 1 + alpha;
- a1 = -2 * k;
- a2 = 1 - alpha;
-
- coef = normalizeFilterCoefficients(b0, b1, b2, a0, a1, a2);
- } else {
- // q = 0, and frequency is not 0 or 1. The above formula has a
- // divide by zero problem. The limit of the z-transform as q
- // approaches 0 is 1, so set the filter that way.
- coef = {b0 : 1, b1 : 0, b2 : 0, a1 : 0, a2 : 0};
- }
- } else {
- // When freq = 0 or 1, the z-transform is identically 0,
- // independent of q.
- coef = {b0 : 0, b1 : 0, b2 : 0, a1 : 0, a2 : 0}
- }
-
- return coef;
-}
-
-function createLowShelfFilter(freq, q, gain) {
- // q not used
- var b0;
- var b1;
- var b2;
- var a0;
- var a1;
- var a2;
- var coef;
-
- var S = 1;
- var A = Math.pow(10, gain / 40);
-
- if (freq == 1) {
- // The filter is just a constant gain
- coef = {b0 : A * A, b1 : 0, b2 : 0, a1 : 0, a2 : 0};
- } else if (freq == 0) {
- // The filter is 1
- coef = {b0 : 1, b1 : 0, b2 : 0, a1 : 0, a2 : 0};
- } else {
- var w0 = Math.PI * freq;
- var alpha = 1 / 2 * Math.sin(w0) * Math.sqrt((A + 1 / A) * (1 / S - 1) + 2);
- var k = Math.cos(w0);
- var k2 = 2 * Math.sqrt(A) * alpha;
- var Ap1 = A + 1;
- var Am1 = A - 1;
-
- b0 = A * (Ap1 - Am1 * k + k2);
- b1 = 2 * A * (Am1 - Ap1 * k);
- b2 = A * (Ap1 - Am1 * k - k2);
- a0 = Ap1 + Am1 * k + k2;
- a1 = -2 * (Am1 + Ap1 * k);
- a2 = Ap1 + Am1 * k - k2;
- coef = normalizeFilterCoefficients(b0, b1, b2, a0, a1, a2);
- }
-
- return coef;
-}
-
-function createHighShelfFilter(freq, q, gain) {
- // q not used
- var b0;
- var b1;
- var b2;
- var a0;
- var a1;
- var a2;
- var coef;
-
- var A = Math.pow(10, gain / 40);
-
- if (freq == 1) {
- // When freq = 1, the z-transform is 1
- coef = {b0 : 1, b1 : 0, b2 : 0, a1 : 0, a2 : 0};
- } else if (freq > 0) {
- var w0 = Math.PI * freq;
- var S = 1;
- var alpha = 0.5 * Math.sin(w0) * Math.sqrt((A + 1 / A) * (1 / S - 1) + 2);
- var k = Math.cos(w0);
- var k2 = 2 * Math.sqrt(A) * alpha;
- var Ap1 = A + 1;
- var Am1 = A - 1;
-
- b0 = A * (Ap1 + Am1 * k + k2);
- b1 = -2 * A * (Am1 + Ap1 * k);
- b2 = A * (Ap1 + Am1 * k - k2);
- a0 = Ap1 - Am1 * k + k2;
- a1 = 2 * (Am1 - Ap1*k);
- a2 = Ap1 - Am1 * k-k2;
-
- coef = normalizeFilterCoefficients(b0, b1, b2, a0, a1, a2);
- } else {
- // When freq = 0, the filter is just a gain
- coef = {b0 : A * A, b1 : 0, b2 : 0, a1 : 0, a2 : 0};
- }
-
- return coef;
-}
-
-function createPeakingFilter(freq, q, gain) {
- var b0;
- var b1;
- var b2;
- var a0;
- var a1;
- var a2;
- var coef;
-
- var A = Math.pow(10, gain / 40);
-
- if (freq > 0 && freq < 1) {
- if (q > 0) {
- var w0 = Math.PI * freq;
- var alpha = Math.sin(w0) / (2 * q);
- var k = Math.cos(w0);
-
- b0 = 1 + alpha * A;
- b1 = -2 * k;
- b2 = 1 - alpha * A;
- a0 = 1 + alpha / A;
- a1 = -2 * k;
- a2 = 1 - alpha / A;
-
- coef = normalizeFilterCoefficients(b0, b1, b2, a0, a1, a2);
- } else {
- // q = 0, we have a divide by zero problem in the formulas
- // above. But if we look at the z-transform, we see that the
- // limit as q approaches 0 is A^2.
- coef = {b0 : A * A, b1 : 0, b2 : 0, a1 : 0, a2 : 0};
- }
- } else {
- // freq = 0 or 1, the z-transform is 1
- coef = {b0 : 1, b1 : 0, b2 : 0, a1 : 0, a2 : 0};
- }
-
- return coef;
-}
-
-function createNotchFilter(freq, q, gain) {
- var b0;
- var b1;
- var b2;
- var a0;
- var a1;
- var a2;
- var coef;
-
- if (freq > 0 && freq < 1) {
- if (q > 0) {
- var w0 = Math.PI * freq;
- var alpha = Math.sin(w0) / (2 * q);
- var k = Math.cos(w0);
-
- b0 = 1;
- b1 = -2 * k;
- b2 = 1;
- a0 = 1 + alpha;
- a1 = -2 * k;
- a2 = 1 - alpha;
- coef = normalizeFilterCoefficients(b0, b1, b2, a0, a1, a2);
- } else {
- // When q = 0, we get a divide by zero above. The limit of the
- // z-transform as q approaches 0 is 0, so set the coefficients
- // appropriately.
- coef = {b0 : 0, b1 : 0, b2 : 0, a1 : 0, a2 : 0};
- }
- } else {
- // When freq = 0 or 1, the z-transform is 1
- coef = {b0 : 1, b1 : 0, b2 : 0, a1 : 0, a2 : 0};
- }
-
- return coef;
-}
-
-function createAllpassFilter(freq, q, gain) {
- var b0;
- var b1;
- var b2;
- var a0;
- var a1;
- var a2;
- var coef;
-
- if (freq > 0 && freq < 1) {
- if (q > 0) {
- var w0 = Math.PI * freq;
- var alpha = Math.sin(w0) / (2 * q);
- var k = Math.cos(w0);
-
- b0 = 1 - alpha;
- b1 = -2 * k;
- b2 = 1 + alpha;
- a0 = 1 + alpha;
- a1 = -2 * k;
- a2 = 1 - alpha;
- coef = normalizeFilterCoefficients(b0, b1, b2, a0, a1, a2);
- } else {
- // q = 0
- coef = {b0 : -1, b1 : 0, b2 : 0, a1 : 0, a2 : 0};
- }
- } else {
- coef = {b0 : 1, b1 : 0, b2 : 0, a1 : 0, a2 : 0};
- }
-
- return coef;
-}
-
-// Array of functions to compute the filter coefficients. This must
-// be arraned in the same order as the filter types in the idl file.
-var filterCreatorFunction = {"lowpass": createLowpassFilter,
- "highpass": createHighpassFilter,
- "bandpass": createBandpassFilter,
- "lowshelf": createLowShelfFilter,
- "highshelf": createHighShelfFilter,
- "peaking": createPeakingFilter,
- "notch": createNotchFilter,
- "allpass": createAllpassFilter};
-
-var filterTypeName = {"lowpass": "Lowpass filter",
- "highpass": "Highpass filter",
- "bandpass": "Bandpass filter",
- "lowshelf": "Lowshelf filter",
- "highshelf": "Highshelf filter",
- "peaking": "Peaking filter",
- "notch": "Notch filter",
- "allpass": "Allpass filter"};
-
-function createFilter(filterType, freq, q, gain) {
- return filterCreatorFunction[filterType](freq, q, gain);
-}
-
-function filterData(filterCoef, signal, len) {
- var y = new Array(len);
- var b0 = filterCoef.b0;
- var b1 = filterCoef.b1;
- var b2 = filterCoef.b2;
- var a1 = filterCoef.a1;
- var a2 = filterCoef.a2;
-
- // Prime the pump. (Assumes the signal has length >= 2!)
- y[0] = b0 * signal[0];
- y[1] = b0 * signal[1] + b1 * signal[0] - a1 * y[0];
-
- // Filter all of the signal that we have.
- for (var k = 2; k < Math.min(signal.length, len); ++k) {
- y[k] = b0 * signal[k] + b1 * signal[k-1] + b2 * signal[k-2] - a1 * y[k-1] - a2 * y[k-2];
- }
-
- // If we need to filter more, but don't have any signal left,
- // assume the signal is zero.
- for (var k = signal.length; k < len; ++k) {
- y[k] = - a1 * y[k-1] - a2 * y[k-2];
- }
-
- return y;
-}
-
-function createImpulseBuffer(context, length) {
- var impulse = context.createBuffer(1, length, context.sampleRate);
- var data = ""
- for (var k = 1; k < data.length; ++k) {
- data[k] = 0;
- }
- data[0] = 1;
-
- return impulse;
-}
-
-
-function createTestAndRun(context, filterType, filterParameters) {
- // To test the filters, we apply a signal (an impulse) to each of
- // the specified filters, with each signal starting at a different
- // time. The output of the filters is summed together at the
- // output. Thus for filter k, the signal input to the filter
- // starts at time k * timeStep. For this to work well, timeStep
- // must be large enough for the output of each filter to have
- // decayed to zero with timeStep seconds. That way the filter
- // outputs don't interfere with each other.
-
- nFilters = Math.min(filterParameters.length, maxFilters);
-
- signal = new Array(nFilters);
- filter = new Array(nFilters);
-
- impulse = createImpulseBuffer(context, pulseLengthFrames);
-
- // Create all of the signal sources and filters that we need.
- for (var k = 0; k < nFilters; ++k) {
- signal[k] = context.createBufferSource();
- signal[k].buffer = impulse;
-
- filter[k] = context.createBiquadFilter();
- filter[k].type = filterType;
- filter[k].frequency.value = context.sampleRate / 2 * filterParameters[k].cutoff;
- filter[k].detune.value = (filterParameters[k].detune === undefined) ? 0 : filterParameters[k].detune;
- filter[k].Q.value = filterParameters[k].q;
- filter[k].gain.value = filterParameters[k].gain;
-
- signal[k].connect(filter[k]);
- filter[k].connect(context.destination);
-
- signal[k].start(timeStep * k);
- }
-
- context._oncomplete_ = checkFilterResponse(filterType, filterParameters);
- context.startRendering();
-}
-
-function addSignal(dest, src, destOffset) {
- // Add src to dest at the given dest offset.
- for (var k = destOffset, j = 0; k < dest.length, j < src.length; ++k, ++j) {
- dest[k] += src[j];
- }
-}
-
-function generateReference(filterType, filterParameters) {
- var result = new Array(renderLengthSamples);
- var data = "" Array(renderLengthSamples);
- // Initialize the result array and data.
- for (var k = 0; k < result.length; ++k) {
- result[k] = 0;
- data[k] = 0;
- }
- // Make data an impulse.
- data[0] = 1;
-
- for (var k = 0; k < nFilters; ++k) {
- // Filter an impulse
- var detune = (filterParameters[k].detune === undefined) ? 0 : filterParameters[k].detune;
- var frequency = filterParameters[k].cutoff * Math.pow(2, detune / 1200); // Apply detune, converting from Cents.
-
- var filterCoef = createFilter(filterType,
- frequency,
- filterParameters[k].q,
- filterParameters[k].gain);
- var y = filterData(filterCoef, data, renderLengthSamples);
-
- // Accumulate this filtered data into the final output at the desired offset.
- addSignal(result, y, timeToSampleFrame(timeStep * k, sampleRate));
- }
-
- return result;
-}
-
-function checkFilterResponse(filterType, filterParameters) {
- return function(event) {
- renderedBuffer = event.renderedBuffer;
- renderedData = renderedBuffer.getChannelData(0);
-
- reference = generateReference(filterType, filterParameters);
-
- var len = Math.min(renderedData.length, reference.length);
-
- var success = true;
-
- // Maximum error between rendered data and expected data
- var maxError = 0;
-
- // Sample offset where the maximum error occurred.
- var maxPosition = 0;
-
- // Number of infinities or NaNs that occurred in the rendered data.
- var invalidNumberCount = 0;
-
- if (nFilters != filterParameters.length) {
- testFailed("Test wanted " + filterParameters.length + " filters but only " + maxFilters + " allowed.");
- success = false;
- }
-
- // Compare the rendered signal with our reference, keeping
- // track of the maximum difference (and the offset of the max
- // difference.) Check for bad numbers in the rendered output
- // too. There shouldn't be any.
- for (var k = 0; k < len; ++k) {
- var err = Math.abs(renderedData[k] - reference[k]);
- if (err > maxError) {
- maxError = err;
- maxPosition = k;
- }
- if (!isValidNumber(renderedData[k])) {
- ++invalidNumberCount;
- }
- }
-
- if (invalidNumberCount > 0) {
- testFailed("Rendered output has " + invalidNumberCount + " infinities or NaNs.");
- success = false;
- } else {
- testPassed("Rendered output did not have infinities or NaNs.");
- }
-
- if (maxError <= maxAllowedError) {
- testPassed(filterTypeName[filterType] + " response is correct.");
- } else {
- testFailed(filterTypeName[filterType] + " response is incorrect. Max err = " + maxError + " at " + maxPosition + ". Threshold = " + maxAllowedError);
- success = false;
- }
-
- if (success) {
- testPassed("Test signal was correctly filtered.");
- } else {
- testFailed("Test signal was not correctly filtered.");
- }
- finishJSTest();
- }
-}
Modified: releases/WebKitGTK/webkit-2.30/Source/WebCore/ChangeLog (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/Source/WebCore/ChangeLog 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/Source/WebCore/ChangeLog 2020-08-14 06:39:16 UTC (rev 265656)
@@ -1,3 +1,19 @@
+2020-08-12 Lauro Moura <[email protected]>
+
+ Highpass Biquads use old formulas
+ https://bugs.webkit.org/show_bug.cgi?id=181191
+
+ Reviewed by Darin Adler.
+
+ Like r265517, but for the highpass filter.
+
+ Spec: https://www.w3.org/TR/webaudio/#dom-biquadfiltertype-highpass
+
+ Covered by existing tests
+
+ * platform/audio/Biquad.cpp:
+ (WebCore::Biquad::setHighpassParams):
+
2020-08-12 Stephan Szabo <[email protected]>
[PlayStation] Build fix for !ENABLE(ACCESSIBILITY) after r265514
Modified: releases/WebKitGTK/webkit-2.30/Source/WebCore/platform/audio/Biquad.cpp (265655 => 265656)
--- releases/WebKitGTK/webkit-2.30/Source/WebCore/platform/audio/Biquad.cpp 2020-08-14 06:39:01 UTC (rev 265655)
+++ releases/WebKitGTK/webkit-2.30/Source/WebCore/platform/audio/Biquad.cpp 2020-08-14 06:39:16 UTC (rev 265656)
@@ -238,22 +238,22 @@
} else if (cutoff > 0) {
// Compute biquad coefficients for highpass filter
resonance = std::max(0.0, resonance); // can't go negative
- double g = pow(10.0, 0.05 * resonance);
- double d = sqrt((4 - sqrt(16 - 16 / (g * g))) / 2);
+ resonance = pow(10.0, 0.05 * resonance);
double theta = piDouble * cutoff;
- double sn = 0.5 * d * sin(theta);
- double beta = 0.5 * (1 - sn) / (1 + sn);
- double gamma = (0.5 + beta) * cos(theta);
- double alpha = 0.25 * (0.5 + beta + gamma);
+ double alpha = sin(theta) / (2 * resonance);
+ double cosw = cos(theta);
+ double beta = (1 + cosw) / 2;
- double b0 = 2 * alpha;
- double b1 = 2 * -2 * alpha;
- double b2 = 2 * alpha;
- double a1 = 2 * -gamma;
- double a2 = 2 * beta;
+ double b0 = beta;
+ double b1 = -(2 * beta);
+ double b2 = beta;
- setNormalizedCoefficients(b0, b1, b2, 1, a1, a2);
+ double a0 = 1 + alpha;
+ double a1 = -2 * cosw;
+ double a2 = 1 - alpha;
+
+ setNormalizedCoefficients(b0, b1, b2, a0, a1, a2);
} else {
// When cutoff is zero, we need to be careful because the above
// gives a quadratic divided by the same quadratic, with poles