Tuesday, October 16, 2007

Compression #2 - Continued

As a continued part of my previous post, i shall describe the exact details of the universal code that i'm experimenting with to use in this compression.

The Gamma coding, would easily follow this pattern. Bold is ending, ittalic is the 'continued' and normal is the other code.

0 - 0
1 - 10 - 1 already assumed at highest point
2 - 1100
3 - 1110
4 - 110100
5 - 110110

The second encoding uses higher bits per bit reference, higher compression but looses the first bit since it goes in reverse instead. Example, encodeing a 1101, you would do it 1011 and it would reverse it.

0 - 0
1 - 1100
2 - 1010
3 - 1110
4 - 1001100
5 - 1101100

Other codes are considered but would be tested and experimented later with. However, in the tests it does suggest that if i can compress the heading information (ints used) correctly, it could compress the actual data, from a 1024 bytes to 300 bytes, meaning i need to save the header into 700 bytes or less. Real fun.

Era

No comments: