Summary: | Slightly improve AudioBufferSourceNode resampling | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||||||
Component: | Web Audio | Assignee: | Chris Dumez <cdumez> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | darin, eric.carlson, ews-watchlist, ggaren, glenn, jer.noble, philipj, sergio, webkit-bug-importer | ||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||
Version: | WebKit Nightly Build | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
Bug Depends on: | |||||||||||||
Bug Blocks: | 212611 | ||||||||||||
Attachments: |
|
Description
Chris Dumez
2020-09-22 16:54:10 PDT
Created attachment 409423 [details]
Patch
Created attachment 409424 [details]
Patch
Comment on attachment 409424 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=409424&action=review > Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp:416 > + float sample; > + if (readIndex == readIndex2 && readIndex >= 1) { > + // We're at the end of the buffer, so just linearly extrapolate from the last two samples. > + float sample1 = source[readIndex - 1]; > + float sample2 = source[readIndex]; > + sample = sample2 + (sample2 - sample1) * interpolationFactor; > + } else { > + float sample1 = source[readIndex]; > + float sample2 = source[readIndex2]; > + sample = sample1 + interpolationFactor * (sample2 - sample1); > + } > > - destination[writeIndex] = narrowPrecisionToFloat(sample); > + destination[writeIndex] = sample; It looks like this is an identical copy of the code above. Can it be moved to a shared function? Created attachment 409428 [details]
Patch
Created attachment 409432 [details]
Patch
Committed r267453: <https://trac.webkit.org/changeset/267453> All reviewed patches have been landed. Closing bug and clearing flags on attachment 409432 [details]. |