Changeset 267453 in webkit
- Timestamp:
- Sep 22, 2020, 6:49:31 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/buffer-resampling-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/sub-sample-buffer-stitching-expected.txt (modified) (1 diff)
-
LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulation-expected.txt (modified) (1 diff)
-
LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-modulation-expected.txt (modified) (1 diff)
-
LayoutTests/webaudio/gain-expected.wav (modified) ( previous)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r267444 r267453 1 2020-09-22 Chris Dumez <cdumez@apple.com> 2 3 Slightly improve AudioBufferSourceNode resampling 4 https://bugs.webkit.org/show_bug.cgi?id=216859 5 6 Reviewed by Eric Carlson. 7 8 * webaudio/AudioBufferSource/audiobuffersource-detune-modulation-expected.txt: 9 * webaudio/AudioBufferSource/audiobuffersource-playbackrate-modulation-expected.txt: 10 * webaudio/gain-expected.wav: 11 Rebaseline tests that have slightly different output. 12 1 13 2020-09-22 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/LayoutTests/TestExpectations
r267413 r267453 327 327 imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audioparam-interface/k-rate-stereo-panner.html [ Pass Failure ] 328 328 329 # This test is passing but the printed SNR value differs from machine to machine. 330 imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/sub-sample-buffer-stitching.html [ Pass Failure ] 331 329 332 # Values in FAIL lines differ from machine to machine, we should be able to unskip them once they pass. 330 imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/buffer-resampling.html [ Pass Failure ]331 imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/sub-sample-buffer-stitching.html [ Pass Failure ]332 333 webaudio/AudioBufferSource/audiobuffersource-detune-modulation.html [ Pass Failure ] 333 334 webaudio/AudioBufferSource/audiobuffersource-playbackrate-modulation.html [ Pass Failure ] -
trunk/LayoutTests/imported/w3c/ChangeLog
r267417 r267453 1 2020-09-22 Chris Dumez <cdumez@apple.com> 2 3 Slightly improve AudioBufferSourceNode resampling 4 https://bugs.webkit.org/show_bug.cgi?id=216859 5 6 Reviewed by Eric Carlson. 7 8 Rebaseline WPT tests that are now passing. 9 10 * web-platform-tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/buffer-resampling-expected.txt: 11 * web-platform-tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/sub-sample-buffer-stitching-expected.txt: 12 1 13 2020-09-22 Sam Sneddon <gsnedders@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/buffer-resampling-expected.txt
r266627 r267453 4 4 PASS Audit report 5 5 PASS > [interpolate] Interpolation of AudioBuffers to context sample rate 6 FAIL X Interpolated sine wave does not equal [0,0.057564035058021545,0.1149371787905693,0.17192906141281128,0.22835084795951843,0.2840152382850647,0.3387378752231598,0.39233696460723877,0.4446350038051605,0.4954586327075958,0.5446387529373169,0.5920131206512451,0.6374238133430481,0.6807207465171814,0.7217600345611572,0.7604058980941772...] with an element-wise tolerance of {"absoluteThreshold":0.090348,"relativeThreshold":0}. 7 Index Actual Expected AbsError RelError Test threshold 8 [176] -5.6208336353302002e-1 -6.5342026948928833e-1 9.1336905956268311e-2 1.3978278639512823e-1 9.0347999999999998e-2 9 [177] -5.6208336353302002e-1 -6.9591242074966431e-1 1.3382905721664429e-1 1.9230732664963551e-1 9.0347999999999998e-2 10 [178] -5.6208336353302002e-1 -7.3609656095504761e-1 1.7401319742202759e-1 2.3639995980453213e-1 9.0347999999999998e-2 11 [179] -5.6208336353302002e-1 -7.7383983135223389e-1 2.1175646781921387e-1 2.7364379454231952e-1 9.0347999999999998e-2 12 Max AbsError of 2.1175646781921387e-1 at index of 179. 13 Max RelError of 2.7364379454231952e-1 at index of 179. 14 assert_true: expected true got false 15 FAIL X SNR (32.76 dB) is not greater than or equal to 37.17. Got 32.76242434165858. assert_true: expected true got false 16 FAIL < [interpolate] 2 out of 2 assertions were failed. assert_true: expected true got false 17 FAIL # AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed. assert_true: expected true got false 6 PASS Interpolated sine wave equals [expected array] with an element-wise tolerance of {"absoluteThreshold":0.090348,"relativeThreshold":0}. 7 PASS SNR (37.18 dB) is greater than or equal to 37.17. 8 PASS < [interpolate] All assertions passed. (total 2 assertions) 9 PASS # AUDIT TASK RUNNER FINISHED: 1 tasks ran successfully. 18 10 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/sub-sample-buffer-stitching-expected.txt
r267167 r267453 11 11 PASS > [buffer-stitching-2] Subsample buffer stitching, different rates 12 12 PASS Test 2: context.sampleRate is equal to 44100. 13 FAIL X Stitched sine-wave buffers at sample rate 43800 does not equal [0,0.06264830380678177,0.12505052983760834,0.1869613528251648,0.2481377273797989,0.308339387178421,0.36732959747314453,0.4248766303062439,0.48075437545776367,0.53474360704422,0.5866317749023438,0.6362154483795166,0.6832994818687439,0.7276992797851562,0.7692402005195618,0.8077590465545654...] with an element-wise tolerance of {"absoluteThreshold":0.0038986,"relativeThreshold":0}. 14 Index Actual Expected AbsError RelError Test threshold 15 [30] 9.6648049354553223e-1 9.5236855745315552e-1 1.4111936092376709e-2 1.4817725744868301e-2 3.8985999999999999e-3 16 [60] -5.5004155635833740e-1 -5.8084774017333984e-1 3.0806183815002441e-2 5.3036590631839402e-2 3.8985999999999999e-3 17 [90] -6.1754375696182251e-1 -5.9811061620712280e-1 1.9433140754699707e-2 3.2490880830595564e-2 3.8985999999999999e-3 18 [151] 2.0081890746951103e-2 -4.1306052356958389e-2 6.1387943103909492e-2 1.4861730812087184e+0 3.8985999999999999e-3 19 [181] -9.5454013347625732e-1 -9.3895959854125977e-1 1.5580534934997559e-2 1.6593402910202976e-2 3.8985999999999999e-3 20 ...and 1222 more errors. 21 Max AbsError of 6.3063371824682690e-2 at index of 6615. 22 [6615] -6.3076853752136230e-2 -1.3481927453540266e-5 6.3063371824682690e-2 4.6776228430247684e+3 3.8985999999999999e-3 23 Max RelError of 4.6776228430247684e+3 at index of 6615. 24 [6615] -6.3076853752136230e-2 -1.3481927453540266e-5 6.3063371824682690e-2 4.6776228430247684e+3 3.8985999999999999e-3 25 assert_true: expected true got false 26 FAIL X SNR (43.58852186686384 dB) is not greater than or equal to 65.737. Got 43.58852186686384. assert_true: expected true got false 27 FAIL < [buffer-stitching-2] 2 out of 3 assertions were failed. assert_true: expected true got false 28 FAIL # AUDIT TASK RUNNER FINISHED: 1 out of 2 tasks were failed. assert_true: expected true got false 13 PASS Stitched sine-wave buffers at sample rate 43800 equals [expected array] with an element-wise tolerance of {"absoluteThreshold":0.0038986,"relativeThreshold":0}. 14 PASS SNR (65.73793928980352 dB) is greater than or equal to 65.737. 15 PASS < [buffer-stitching-2] All assertions passed. (total 3 assertions) 16 PASS # AUDIT TASK RUNNER FINISHED: 2 tasks ran successfully. 29 17 -
trunk/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulation-expected.txt
r267245 r267453 7 7 PASS < [load-reference] All assertions passed. (total 0 assertions) 8 8 PASS > [generate-verify] 9 FAIL X SNR is not greater than or equal to 93.32. Got 90.27890412 800858. assert_true: expected true got false9 FAIL X SNR is not greater than or equal to 93.32. Got 90.27890412768754. assert_true: expected true got false 10 10 PASS : Maximum difference (in ulp units (16-bits)) is less than or equal to 1.0352. 11 11 PASS : Number of differences between results is less than or equal to 0. -
trunk/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-modulation-expected.txt
r267245 r267453 8 8 PASS < [load-reference] All assertions passed. (total 1 assertions) 9 9 PASS > [generate-verify] 10 FAIL X SNR is not greater than or equal to 93.274. Got 90.24757942 295886. assert_true: expected true got false10 FAIL X SNR is not greater than or equal to 93.274. Got 90.24757942510593. assert_true: expected true got false 11 11 PASS Verify: Maximum difference (in ulp units (16-bits)) is less than or equal to 1.0519. 12 12 PASS Verify: Number of differences between results is less than or equal to 0. -
trunk/Source/WebCore/ChangeLog
r267449 r267453 1 2020-09-22 Chris Dumez <cdumez@apple.com> 2 3 Slightly improve AudioBufferSourceNode resampling 4 https://bugs.webkit.org/show_bug.cgi?id=216859 5 6 Reviewed by Eric Carlson. 7 8 Slightly improve AudioBufferSourceNode resampling. Use simple linear extrapolation 9 to resample the data when we reach the end of the buffer. Previously, the last 10 sample would just be repeated enough times. 11 12 This is a merge of the following Blink change by Raymond Toy: 13 - https://chromium-review.googlesource.com/c/chromium/src/+/1211910/ 14 15 No new tests, rebaselined existing tests. 16 17 * Modules/webaudio/AudioBufferSourceNode.cpp: 18 (WebCore::AudioBufferSourceNode::renderFromBuffer): 19 1 20 2020-09-22 Sam Weinig <weinig@apple.com> 2 21 -
trunk/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp
r267443 r267453 53 53 const double MaxRate = 1024; 54 54 55 static float computeSampleUsingLinearInterpolation(const float* source, unsigned readIndex, unsigned readIndex2, float interpolationFactor) 56 { 57 if (readIndex == readIndex2 && readIndex >= 1) { 58 // We're at the end of the buffer, so just linearly extrapolate from the last two samples. 59 float sample1 = source[readIndex - 1]; 60 float sample2 = source[readIndex]; 61 return sample2 + (sample2 - sample1) * interpolationFactor; 62 } 63 float sample1 = source[readIndex]; 64 float sample2 = source[readIndex2]; 65 return sample1 + interpolationFactor * (sample2 - sample1); 66 } 67 55 68 ExceptionOr<Ref<AudioBufferSourceNode>> AudioBufferSourceNode::create(BaseAudioContext& context, AudioBufferSourceOptions&& options) 56 69 { … … 340 353 while (framesToProcess--) { 341 354 unsigned readIndex = static_cast<unsigned>(floorf(virtualReadIndex)); 342 doubleinterpolationFactor = virtualReadIndex - readIndex;355 float interpolationFactor = virtualReadIndex - readIndex; 343 356 344 357 unsigned readIndex2 = readIndex + 1; 345 358 if (readIndex2 >= maxFrame) 346 readIndex2 = loop() ? minFrame : maxFrame - 1;359 readIndex2 = loop() ? minFrame : readIndex; 347 360 348 361 // Linear interpolation. … … 351 364 const float* source = sourceChannels[i]; 352 365 353 double sample1 = source[readIndex]; 354 double sample2 = source[readIndex2]; 355 double sample = (1.0 - interpolationFactor) * sample1 + interpolationFactor * sample2; 356 357 destination[writeIndex] = narrowPrecisionToFloat(sample); 366 destination[writeIndex] = computeSampleUsingLinearInterpolation(source, readIndex, readIndex2, interpolationFactor); 358 367 } 359 368 … … 372 381 while (framesToProcess--) { 373 382 unsigned readIndex = static_cast<unsigned>(virtualReadIndex); 374 doubleinterpolationFactor = virtualReadIndex - readIndex;383 float interpolationFactor = virtualReadIndex - readIndex; 375 384 376 385 // For linear interpolation we need the next sample-frame too. … … 394 403 const float* source = sourceChannels[i]; 395 404 396 double sample1 = source[readIndex]; 397 double sample2 = source[readIndex2]; 398 double sample = (1.0 - interpolationFactor) * sample1 + interpolationFactor * sample2; 399 400 destination[writeIndex] = narrowPrecisionToFloat(sample); 405 destination[writeIndex] = computeSampleUsingLinearInterpolation(source, readIndex, readIndex2, interpolationFactor); 401 406 } 402 407 writeIndex++;
Note:
See TracChangeset
for help on using the changeset viewer.