RESOLVED FIXED 216183
Improve interpolation algorithm in OscillatorNode
https://bugs.webkit.org/show_bug.cgi?id=216183
Summary Improve interpolation algorithm in OscillatorNode
Chris Dumez
Reported 2020-09-04 09:35:44 PDT
Improve interpolation algorithm in OscillatorNode.
Attachments
Patch (30.33 KB, patch)
2020-09-04 09:50 PDT, Chris Dumez
no flags
Patch (37.98 KB, patch)
2020-09-04 10:11 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2020-09-04 09:50:41 PDT
Chris Dumez
Comment 2 2020-09-04 10:11:28 PDT
Geoffrey Garen
Comment 3 2020-09-04 11:21:41 PDT
Comment on attachment 407989 [details] Patch r=me
EWS
Comment 4 2020-09-04 11:54:43 PDT
Committed r266627: <https://trac.webkit.org/changeset/266627> All reviewed patches have been landed. Closing bug and clearing flags on attachment 407989 [details].
Radar WebKit Bug Importer
Comment 5 2020-09-04 11:55:16 PDT
Eric Carlson
Comment 6 2020-09-04 12:08:02 PDT
Comment on attachment 407989 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=407989&action=review > Source/WebCore/Modules/webaudio/OscillatorNode.cpp:210 > + // Consider a typical sample rate of 44100 Hz and max periodic wave > + // size of 4096. The relationship between |incr| and the frequency > + // of the oscillator is |incr| = freq * 4096/44100. Or freq = > + // |incr|*44100/4096 = 10.8*|incr|. > + // > + // For the |incr| thresholds below, this means that we use linear > + // interpolation for all freq >= 3.2 Hz, 3-point Lagrange > + // for freq >= 1.7 Hz and 5-point Lagrange for every thing else. > + // > + // We use Lagrange interpolation because it's relatively simple to > + // implement and fairly inexpensive, and the interpolator always > + // passes through known points. You should note somewhere that this is based on code in Chrome's oscillator_node.cc
Chris Dumez
Comment 7 2020-09-04 12:09:00 PDT
Comment on attachment 407989 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=407989&action=review >> Source/WebCore/Modules/webaudio/OscillatorNode.cpp:210 >> + // passes through known points. > > You should note somewhere that this is based on code in Chrome's oscillator_node.cc I said in the Changelog: "Align our OscillatorNode implementation with Chromium". How to you suggest I do better?
Eric Carlson
Comment 8 2020-09-04 12:15:37 PDT
Comment on attachment 407989 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=407989&action=review >>> Source/WebCore/Modules/webaudio/OscillatorNode.cpp:210 >>> + // passes through known points. >> >> You should note somewhere that this is based on code in Chrome's oscillator_node.cc > > I said in the Changelog: "Align our OscillatorNode implementation with Chromium". How to you suggest I do better? Some of you other patches have said something like "cherry picked from Chrome ...", but the ChangeLog comment is fine too.
Chris Dumez
Comment 9 2020-09-04 12:19:39 PDT
(In reply to Eric Carlson from comment #8) > Comment on attachment 407989 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=407989&action=review > > >>> Source/WebCore/Modules/webaudio/OscillatorNode.cpp:210 > >>> + // passes through known points. > >> > >> You should note somewhere that this is based on code in Chrome's oscillator_node.cc > > > > I said in the Changelog: "Align our OscillatorNode implementation with Chromium". How to you suggest I do better? > > Some of you other patches have said something like "cherry picked from > Chrome ...", but the ChangeLog comment is fine too. Ok, I will try and be clearer.
Note You need to log in before you can comment on or make changes to this bug.