[Openal-devel] mixaudio question

Adam D. Moss adam at gimp.org
Sat Sep 24 05:11:29 PDT 2005


Prakash Punnoor wrote:
> Hi,
> 
> I removed the old (broken) MMX support from mixaudio16.c. I want to
> clean it up slightly. But I noticed something strange in my eyes:
> 
> On mixing c sources into dst, why is dst also (sometimes) added to the
> sources? Ie:
> 
> sample = *dst + *src;
> 
> Isn't dst supposed to be overwritten? Is dst (before mixing) supposed to
> hold valid data or is it zeroed before mixing? Oh wait, I see in
> al_mixer.c in async_mixer_iterate() that the buffer is actually zeroed.
> So can I think it is safe to get rid of mixing dst into dst again?

I'm guessing that once upon a time, there was an optimized
16-source mixer, an 8-source mixer, a 4-source mixer, etc.
So if, say, there were 12 sources to be mixed, the 8-source
mixer would be run and then the 4-source mixer would accumulate
its results on top.

Now there are just optimized mixers for 1..64(?) channels and
a general-purpose mixer - so I don't think we ever accumulate,
but I'm not sure.

I actually like the 2^n-optimized mixer idea somewhat more, if
indeed things ever did (or were going to) work that way - the
compiled results of mixaudio.c are huge.

--Adam
-- 
Adam D. Moss   -   adam at gimp.org



More information about the Openal-devel mailing list