Page 1 of 1

AY Crudentials: 2 Bit Samples

Posted: Sun Jan 22, 2006 11:47 am
by Twilighte
2 Bit Samples refer to the source rather than the output.
2Bit samples have the clear advantage of being very memory efficient, since 4 sample values can be stored in every byte.
However, 2 bit samples suffer from low resolution having only 4 possible values.
The classic Rambo and Madonna samples used 2 Bit to great effect.

a 2 Bit sample is either stored in a byte as 0123 or 3210 format whereby the lower 2 bits of the byte store the first value, the next 2 bits hold the second and so forth.

Once the 2 bit entity has been extracted, it is then transformed into a 4 bit value (either through shifting (0,1,2,3 to 0,4,8,12) or used to index a table that holds better values) and finally sent to the AY Volume register.

Posted: Mon Jan 23, 2006 12:04 pm
by Euphoric
What about using some sort of ADPCM coding to keep a higher resolution of samples, and still use only 2 bits per sample ?

Cheers,

Fabrice

Posted: Sat Jan 28, 2006 9:09 pm
by Twilighte
What you say may be possible, but at 2 bit, one bit would be tied up as a polarity so effectively giving one bit step value, which is a bit small ;)
Also, playing 2 bit samples is slow because of the additional extract code (to get 2 bits from the 8 bit source) and the conversion code(to get 0-15 from 0-3), so further ADPCM stuff will reduce the speed even more.
However, it would be very interesting to do something like this, but i think it should come under a separate Topic.

Posted: Sat Feb 04, 2006 4:11 pm
by Euphoric
at 2 bit, one bit would be tied up as a polarity so effectively giving one bit step value, which is a bit small
Not necessarily... Of course, it's not a lossless compression, so some differences between two successive samples cannot be coded, especially large differences...
So, suppose you use a small step and a bigger step in each direction, you have four values (e.g -2, -1, +1, +2) that you can code with two bits...

Cheers,

Fabrice