[sldev] Wind Sound CPU usage. (patch-4)

Callum Lerwick seg at haxxed.com
Mon Mar 10 01:05:53 PDT 2008


On Thu, 2008-03-06 at 21:20 -0500, Jason Giglio wrote:
> Callum Lerwick wrote:
>   > Bleh. You still shouldn't need to interpolate every sample. What is the
> > block size? Limit the inner loop to N samples, where N is a suitable
> > "control rate", then put another loop around it that recalculates the
> > filter coefficients and loops until the buffer is full.
> 
> We don't anymore.  We only interpolate frequency if the delta is more 
> than 200 hertz now.  Interpolation of the gains isn't as expensive 
> computationally, since the frequency interpolation is what requires 
> recalculating the filter coefficients in the inner loop.

But then you have a branch inside the inner loop to avoid it.
Interpolating every N samples, and you can still do the delta check,
would bring the branch out of the innermost loop. Its something to try,
at any rate.

Note that your compiler may or may not decide to perform a loop
unswitch, which is another option for optimizing out the branch. The
only way to know for sure is look at the assembly output.

http://en.wikipedia.org/wiki/Loop_unswitching
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.secondlife.com/pipermail/sldev/attachments/20080310/56f95a44/attachment.pgp


More information about the SLDev mailing list