opnsense-src/sys/contrib/zstd/doc/educational_decoder
Conrad Meyer 9cbefe25d4 Update to Zstandard 1.4.4
The full release notes can be found on Github:

  https://github.com/facebook/zstd/releases/tag/v1.4.4

Notable changes in this release include improved decompression speed (about
10%).  See the Github release notes for more details.

MFC after:	I'm not going to, but feel free
Relnotes:	yes
2019-11-16 16:39:08 +00:00
..
harness.c Update to Zstandard 1.4.4 2019-11-16 16:39:08 +00:00
Makefile Update to Zstandard 1.4.4 2019-11-16 16:39:08 +00:00
README.md
zstd_decompress.c Update to Zstandard 1.4.4 2019-11-16 16:39:08 +00:00
zstd_decompress.h Update to Zstandard 1.4.4 2019-11-16 16:39:08 +00:00

Educational Decoder

zstd_decompress.c is a self-contained implementation in C99 of a decoder, according to the Zstandard format specification. While it does not implement as many features as the reference decoder, such as the streaming API or content checksums, it is written to be easy to follow and understand, to help understand how the Zstandard format works. It's laid out to match the format specification, so it can be used to understand how complex segments could be implemented. It also contains implementations of Huffman and FSE table decoding.

harness.c provides a simple test harness around the decoder:

harness <input-file> <output-file> [dictionary]

As an additional resource to be used with this decoder, see the decodecorpus tool in the tests directory. It generates valid Zstandard frames that can be used to verify a Zstandard decoder implementation. Note that to use the tool to verify this decoder implementation, the --content-size flag should be set, as this decoder does not handle streaming decoding, and so it must know the decompressed size in advance.