Covox ADPCM
Jump to navigation
Jump to search
- Company: Covox
- Samples: http://samples.mplayerhq.hu/A-codecs/CovoxFormats/
This is a family of ADPCM formats used for compressing 8-bit unsigned PCM for Covox Sound Master. There are 2-,3- and 4-bit ADPCM formats.
Header
File header consists of 16 bytes:
FF 55 FF AA FF 55 FF AA <type> - 1 byte unknown/unused - 7 bytes
Type may be one of the following:
- 0x08 - raw 8-bit unsigned PCM
- 0x82 - 2-bit ADPCM
- 0x83 - 3-bit ADPCM
- 0x84 - 4-bit ADPCM
Markers
There are two types of markers known:
- FF 55 55 55 - silence block, next 16-bit little-endian value specifies number of silence samples - 27
- FF AA AA AA - end of sound
4-bit ADPCM
Decoding procedure:
- read 4 bytes
- if they make a marker, do action for this marker
- decode 8 deltas from it by taking high bits from 4 values and shifting them
- apply these deltas to get decoded values
Update procedure:
mul = step_table[step] * mult_table[delta & 7]; if(delta & 8) val -= mul; else val += mul; val = clip(val, 0, 0xFFFF); step = clip(step + step_update_table[delta & 7], 0, 71);
Step table:
0x0080, 0x008C, 0x0098, 0x00A6, 0x00B5, 0x00C5, 0x00D7, 0x00EB, 0x0100, 0x0117, 0x0130, 0x014C, 0x016A, 0x018B, 0x01AF, 0x01D6, 0x0200, 0x022E, 0x0261, 0x0298, 0x02D4, 0x0316, 0x035D, 0x03AB, 0x0400, 0x045D, 0x04C2, 0x0530, 0x05A8, 0x062B, 0x06BA, 0x0756, 0x0800, 0x08B9, 0x0983, 0x0A60, 0x0B50, 0x0C56, 0x0D74, 0x0EAC, 0x1000, 0x1173, 0x1307, 0x14C0, 0x16A1, 0x18AD, 0x1AE9, 0x1D58, 0x2000, 0x22E5, 0x260E, 0x2980, 0x2D41, 0x315A, 0x35D1, 0x3AB0, 0x4000, 0x45CB, 0x4C1C, 0x52FF, 0x5A82, 0x62B4, 0x6BA2, 0x7560, 0x8000, 0x8B96, 0x9838, 0xA5FF, 0xB505, 0xC567, 0xD745, 0xEAC1
Step update table:
-8, -6, -4, -2, 2, 4, 8, 16};
Multiplication table:
0.5, 1.0, 2.0, 3.0, 4.5, 5.0, 9.0, 12.0};