[Webkit-unassigned] [Bug 74592] Optimize AudioBufferSourceNode process by avoiding interpolation when pitchRate==1

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 19 09:17:12 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=74592





--- Comment #5 from Raymond Toy <rtoy at chromium.org>  2011-12-19 09:17:12 PST ---
(From update of attachment 119391)
View in context: https://bugs.webkit.org/attachment.cgi?id=119391&action=review

>>> Source/WebCore/webaudio/AudioBufferSourceNode.cpp:277
>>> +                for (unsigned k = 0; k < rounds; ++k) {
>> 
>> Why not just use a while loop:
>> 
>> while (framesToProcess > 0) {
>>  ...
>> |
>> 
>> instead of the for loop with rounds?
> 
> if the deltaFrames is small enough. we have to copy them repeatly. it will be more than once.

Agreed.  I missed that case.

>>> Source/WebCore/webaudio/AudioBufferSourceNode.cpp:279
>>> +                    destinationL += deltaFrames;
>> 
>> Is this right?  sourceL and startFrame are not modified in the for loop so we keep copying the same data from sourceL+startFrame to consecutive places in destinationL.
> 
> it is for the case that the deltaFrame is small enough. We have to copy the frames frome startFrame to endFrame more than once. we can not just wrap around once to get enought data. 
> 
> correct me if I misunderstanding the underlying algorithm.

You are right.

>>> Source/WebCore/webaudio/AudioBufferSourceNode.cpp:300
>>> +            virtualReadIndex -= ((virtualReadIndex - endFrame) / deltaFrames + 1) * deltaFrames;
>> 
>> Is this correct?  If virtualReadIndex - endFrame = 1, we get (1/deltaFrames + 1)*deltaFrames = deltaFrames + 1 (because virtualReadIndex is a float and ignoring roundoff).  I think we want to subtract just deltaFrames in this case.
> 
> the reason for using this statement is to resolve the issue that deltaFrame may be very small. Substracting deltaFrames once might still exceed endFrame. 
> 
> I will check the math again for float issue. thanks

I didn't mean that we should always just subtract deltaFrames; just deltaFrames in this example.

Perhaps you meant to truncate (virtualReadIndex - endFrame)/deltaFrames to an integer first before adding one?  This will tell us how many deltaFrames past the endFrame that have been processed.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list