Re: [AD] Allegro's mixer

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Ben Davis wrote:

DUMB manages to combine 24-bit samples with a 16-bit volume:

#define MULSC(a, b) ((int)((LONG_LONG)((a) << 4) * ((b) << 12) >> 32))

Wouldn't ((int)((LONG_LONG)(a) * (b) >> 16)) be faster? And that code uses LONG_LONG, which is 64-bit. Those are dangerous to use in interrupts/timers. DUMB is fine since it's poll-driven, but Allegro's mixer runs in a timer or interrupt, depending on the driver. Unless I'm missing something, we need to stick with 32-bit integer arithmetic in the mixer.

- Kitty Cat




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/