[webkit-reviews] review granted: [Bug 216859] Slightly improve AudioBufferSourceNode resampling : [Attachment 409424] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 22 17:03:35 PDT 2020


Eric Carlson <eric.carlson at apple.com> has granted Chris Dumez
<cdumez at apple.com>'s request for review:
Bug 216859: Slightly improve AudioBufferSourceNode resampling
https://bugs.webkit.org/show_bug.cgi?id=216859

Attachment 409424: Patch

https://bugs.webkit.org/attachment.cgi?id=409424&action=review




--- Comment #3 from Eric Carlson <eric.carlson at apple.com> ---
Comment on attachment 409424
  --> https://bugs.webkit.org/attachment.cgi?id=409424
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?


More information about the webkit-reviews mailing list