Difference between revisions of "BEAR4 compression"
From ScienceZero
m (moved BEAR3 compression to BEAR4 compression) |
|||
Line 1: | Line 1: | ||
WORK IN PROGRESS... | WORK IN PROGRESS... | ||
− | + | BEAR4 is designed for microcontrollers that has little RAM. It uses the data decompressed so far as the dictionary, compared to typical LZ compression this decreases efficiency since the index range must be larger and the need for storing the count. Most of the loss is recovered by only reading the number of bits required for the current range. | |
Header | Header | ||
− | + | BEAR4 (used as file ID) | |
ssssss - symbol size (1-64) | ssssss - symbol size (1-64) | ||
iiiii - maximum index size (1-32) | iiiii - maximum index size (1-32) |
Revision as of 03:57, 20 February 2011
WORK IN PROGRESS...
BEAR4 is designed for microcontrollers that has little RAM. It uses the data decompressed so far as the dictionary, compared to typical LZ compression this decreases efficiency since the index range must be larger and the need for storing the count. Most of the loss is recovered by only reading the number of bits required for the current range.
Header
BEAR4 (used as file ID) ssssss - symbol size (1-64) iiiii - maximum index size (1-32) cccc - maximum count size (1-16)
0 <symbol> 1 <index> <count>
do indexSize = min(log2(decompressedSize), maximumIndexSize) countSize = min(indexSize, maximumCountSize) read classBit if classBit = 0 then read symbol output symbol else read index, count for each count read symbolFromDecompressed output symbol next endif loop