Expand description
16-bit Huffman compression and decompression. Huffman compression and decompression routines written by Christian Rouet for his PIZ image file format.
StructsΒ§
- Short
Code π
EnumsΒ§
- Code π
ConstantsΒ§
- DECODE_
BITS π - DECODE_
MASK π - DECODING_
TABLE_ πSIZE - ENCODE_
BITS π - ENCODING_
TABLE_ πSIZE - INVALID_
BIT_ πCOUNT - INVALID_
CODE π - INVALID_
TABLE_ πENTRY - INVALID_
TABLE_ πSIZE - LONGEST_
LONG_ πRUN - LONG_
ZEROCODE_ πRUN - NOT_
ENOUGH_ πDATA - SHORTEST_
LONG_ πRUN - SHORT_
ZEROCODE_ πRUN - TABLE_
TOO_ πLONG - TOO_
MUCH_ πDATA
FunctionsΒ§
- build_
canonical_ πtable - Build a βcanonicalβ Huffman code table:
- build_
decoding_ πtable - Build a decoding hash table based on the encoding table code:
- build_
encoding_ πtable - Compute Huffman codes (based on frq input) and store them in frq:
- code π
- compress
- count_
frequencies π - decode_
with_ πtables - Decode (uncompress) n bits based on encoding & decoding tables:
- decompress
- encode_
with_ πfrequencies - length π
- pack_
encoding_ πtable - Pack an encoding table:
- read_
bits π - read_
byte π - read_
code_ πinto_ vec - read_
encoding_ πtable - Run-length-decompresses all zero runs from the packed table to the encoding table
- send_
code π - write_
bits π - write_
code π