[gmpi] Re: Decision Time: 7.1.1

  • From: Paul Davis <paul@xxxxxxxxxxxxxxxxxxxxx>
  • To: gmpi@xxxxxxxxxxxxx
  • Date: Tue, 10 Jun 2003 10:27:12 -0400

>To render a fade (up to second order) on a mono buffer, we have a 'for' loop
>with the following code in the kernel:
>
>  pfDst[i] = pfSrc[i] * fVolume;
>  fVolume += fDelta1;
>  fDelta1 += fDelta2;
>
>If the dst/src streams are interleaved, they can be processed as vectors,
>using pretty much the same syntax:
>
>  pvDst[i] = pvSrc[i] * vVolume;
>  vVolume += vDelta1;
>  vDelta1 += vDelta2;
>
>If you want to use SIMD on split mono streams, you either need to apply your
>volume in 4-sample increments (or whatever the vector size for the
>CPU); 

i don't see the issue. for interleaved, you've had to stuff vDelta2
with the correct value for each channel/frame, whereas as for mono, you've
had to stuff it with the correct value for each frame. for example, in
the case of a stereo interleaved stream,

    vDelta2[0] => correct delta2 for channel 0, frame 0
    vDelta2[1] => correct delta2 for channel 1, frame 0
    vDelta2[2] => correct delta2 for channel 0, frame 1
    vDelta2[3] => correct delta2 for channel 1, frame 1
    
versus mono:

    vDelta2[0] => correct delta2 for channel 0, frame 0
    vDelta2[1] => correct delta2 for channel 0, frame 1
    vDelta2[2] => correct delta2 for channel 0, frame 2
    vDelta2[3] => correct delta2 for channel 0, frame 3

both cases still require "chunks of 4" processing. the mono case may
or may not have better cache behaviour, most of which can be smoothed
over by prefetching in parallel with the vector multiplication.

i just can't see any difference: in both cases, you've got to do a dot
product between two vectors. i still think i must be missing
something. i don't see how someone with as much experience as you
clearly have with all this would not see these cases as completely
identical.

--p




----------------------------------------------------------------------
Generalized Music Plugin Interface (GMPI) public discussion list
Participation in this list is contingent upon your abiding by the
following rules:  Please stay on topic.  You are responsible for your own
words.  Please respect your fellow subscribers.  Please do not
redistribute anyone else's words without their permission.

Archive: //www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe

Other related posts: