Header-only library lzw.hpp contains implementation of original LZW compression/decompression algorithms.
Features:
-
InputandPackingdictionaries are fully customizable by symbol ranges, can be piecewise.Predefined:
BINARY_256_common,ASCII_128_common,UTF16_pack(output),URI_pack(output). See lzw.hpp tail for definitions examples. -
Specific codec can be instantiated from template:
lzw_codec<InputDict, PackDict>.Predefined:
string_to_string,binary_to_binary,string_to_UTF16,string_to_URI. See lzw.hpp tail for definitions examples. -
Encoding with fixed bit depth (choses by maximum used code).
-
Dense bit packing (library uses as many bits as possible).
-
Header-only and STL-only open source.
-
STL-compatible codec interface: same as
std::copy(first, last, d_first). -
Tests with usage examples and simple performance measurements are included.
-
RELEASEtypical performance:encode = ~200 us/Ksymboldecode = ~30 us/Ksymbolzip_ratio < ~0.3 (dst.length/src.length)
Library initially was designed as native LZW extension to be used with WASM and Emscripten Embind.
To be continued