Skip to content

cam900/6_bit_RLE_compressed_PCM_format

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

6 bit RLE compressed PCM format

This format is RLE compressible 6 bit DPCM, it's encoded to single byte for ease to use.

Each output is expanded to 16 bit signed PCM.

Data format (single byte):

Byte format
Bit Description
7 6 5 4 3 2 1 0
x - - - - - - - Delta bit
- 0 x x x x x x Sound output
- 0 x - - - - - Negative bit
- 0 - x x x x x Output bit
- 1 x x x x x x Repeat previous output update x - 1 time (RLE)
Delta bit
Bit Description
0 Replace output
1 Add to previous output
Negative bit
Bit Description
0 Positive
1 Negative
Output bit
Bit Description
4 3 2 1 0
e e e e m Output = (2 + m) << (e - 1)
0 0 0 x x Output = x

Decode routine

X = (X-1 * D) + (Y * 1 - (Neg * 2))
X = -32767 < X < 32767

X = Current output
X-1 = Previous output
D = Delta bit
Y = Next output
Neg = Negative bit

About

6 bit RLE compressed PCM format

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published