Subject: PCM8 vs. PCM16/LINEAR?
To: None <firstname.lastname@example.org.AU>
From: Ignatios Souvatzis <email@example.com>
Date: 08/02/1995 10:21:05
If you are really serious about the performance the best you could do
is use a lookup table. Pre-calculate the values, whack them into a
table and use the incoming value as a lookup. Costs you an extra
memory operation, 'tis all. For 16 bit a lookup table may be a bit
excessive ;-) in this case you could make a smaller table and use a
linear interpolation (or quadratic if you want to get really fancy) -
the trade off being the size of the table vs accuracy of the
interpolation vs the time to do the calculation.
I don't know the audio stuff by heart (hope s.b. beats me to it on the
Amiga while I'm occupated with the A2410 X server), but the
ulaw-to-linear conversion is usually done this way... only 8 bit
Hm... one could even generate the lower 8 bits as u_int8_t and the
upper 6 bits as u_int16_t, this way, to do 14bit output on the Amiga
But the unsigned-signed conversion MUST be done by the CPU... you
don't want another memory access instead of a 1-clock-instruction, no?
At least on the Amiga, you have to copy the stuff to a chipmem buffer,
anyway, and can do the conversion while copying.