Files
wuffs/std/lzw
Nigel Tao cae1bfbc7d Remove LZW "cyclical prefix chain" internal error
name                             old speed     new speed     delta

wuffs_gif_decode_1k_bw/clang     289MB/s ± 1%  309MB/s ± 0%   +6.94%  (p=0.000 n=50+5)
wuffs_gif_decode_1k_color/clang  159MB/s ± 1%  160MB/s ± 0%     ~     (p=0.080 n=48+5)
wuffs_gif_decode_10k/clang       145MB/s ± 1%  145MB/s ± 0%     ~     (p=0.371 n=49+5)
wuffs_gif_decode_100k/clang      125MB/s ± 0%  131MB/s ± 1%   +4.84%  (p=0.000 n=46+5)
wuffs_gif_decode_1000k/clang     128MB/s ± 1%  134MB/s ± 0%   +5.22%  (p=0.000 n=47+5)

wuffs_gif_decode_1k_bw/gcc       341MB/s ± 1%  339MB/s ± 0%   -0.48%  (p=0.001 n=49+5)
wuffs_gif_decode_1k_color/gcc    184MB/s ± 1%  186MB/s ± 0%   +1.10%  (p=0.000 n=50+5)
wuffs_gif_decode_10k/gcc         162MB/s ± 0%  164MB/s ± 0%   +1.76%  (p=0.000 n=50+5)
wuffs_gif_decode_100k/gcc        139MB/s ± 0%  143MB/s ± 0%   +3.49%  (p=0.000 n=49+5)
wuffs_gif_decode_1000k/gcc       142MB/s ± 0%  146MB/s ± 0%   +3.08%  (p=0.000 n=49+5)

wuffs_lzw_decode_20k/clang       132MB/s ± 0%  142MB/s ± 0%   +7.91%  (p=0.000 n=46+5)
wuffs_lzw_decode_100k/clang      170MB/s ± 0%  186MB/s ± 1%   +9.18%  (p=0.000 n=46+5)

wuffs_lzw_decode_20k/gcc         156MB/s ± 0%  162MB/s ± 0%   +3.74%  (p=0.000 n=47+5)
wuffs_lzw_decode_100k/gcc        214MB/s ± 0%  235MB/s ± 1%  +10.03%  (p=0.000 n=47+5)
2018-10-14 11:06:38 +11:00
..
2018-06-02 14:15:09 +10:00

LZW (Lempel Ziv Welch) Compression

LZW is a general purpose compression algorithm, not specific to GIF, PDF, TIFF or even to graphics. In practice, there are two incompatible implementations, LSB (Least Significant Bits) and MSB (Most Significant Bits) first.

The GIF format uses LSB first. The literal width can vary between 2 and 8 bits, inclusive. There is no EarlyChange option.

The PDF and TIFF formats use MSB first. The literal width is fixed at 8 bits. There is an EarlyChange option that PDF sometimes uses (see Table 3.7 in the PDF 1.4 spec) and TIFF always uses.

TODO: refactor this README.md file and std/gif's one.