[Webkit-unassigned] [Bug 74054] fast path to accelerate processing in AudioBus::processWithGainFromMonoStereo

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 12 03:56:08 PST 2011


--- Comment #11 from Wei James <james.wei at intel.com>  2011-12-12 03:56:08 PST ---
(In reply to comment #5)
> (In reply to comment #3)
> I'd recommend not going so far as doing this optimization.  This code is very soon going to get a lot more complicated when we
> add upmixing paths for 5.1, etc., so I'd prefer to avoid this extra complexity.
> > A side note on a different optimization.  It's not necessary to implement this instead of the proposed patch.
> > With the current patch, we still do (slightly) extra work if needDezipper is true.  During the loop, we may get close enough to the target that we don't need to dezipper anymore.
> > Since the dezippering is just an exponential filter, we can figure exactly how many steps will be needed to get with epsilon of the target value.  So compute this value, nConv, and have two loops:
> > N = min(nConv, framesToProcess);
> > for (k = 0; k < N; ++k) {
> >    <loop with dezippering>
> > }
> > for (k < framesToProcess; ++k) {
> >    <loop without dezippering>
> > }
> > Assuming I did the math correctly, 
> > nConv = log(eps/abs(g0 - totalDesiredGain))/log(1 - DezipperRate)
> >       = log(eps)/log(1-DezipperRate) 
> >          - log(abs(g0-totalDesiredGain))/log(1-DezipperRate)
> > where g0 is the starting gain value at the beginning of the routine.  All of the logs are constants except for log(abs(g0-totalDesiredGain)), so the computation of nConv is not too bad.  log, however, is not cheap, so it's hard to tell if we would get a net win or not since the processing in the loops is fairly simple.  A quick and dirty log approximation might be good enough.

with some MACROs to avoid code duplication, I think the new patch with Raymond's solution makes the code clearer and readable. It will be easier to add more pathes with this solution. please help to review. thanks

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