]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/contrib/zstd/doc/educational_decoder/README.md
Merge bmake-20200517
[FreeBSD/FreeBSD.git] / sys / contrib / zstd / doc / educational_decoder / README.md
1 Educational Decoder
2 ===================
3
4 `zstd_decompress.c` is a self-contained implementation in C99 of a decoder,
5 according to the [Zstandard format specification].
6 While it does not implement as many features as the reference decoder,
7 such as the streaming API or content checksums, it is written to be easy to
8 follow and understand, to help understand how the Zstandard format works.
9 It's laid out to match the [format specification],
10 so it can be used to understand how complex segments could be implemented.
11 It also contains implementations of Huffman and FSE table decoding.
12
13 [Zstandard format specification]: https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md
14 [format specification]: https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md
15
16 `harness.c` provides a simple test harness around the decoder:
17
18     harness <input-file> <output-file> [dictionary]
19
20 As an additional resource to be used with this decoder,
21 see the `decodecorpus` tool in the [tests] directory.
22 It generates valid Zstandard frames that can be used to verify
23 a Zstandard decoder implementation.
24 Note that to use the tool to verify this decoder implementation,
25 the --content-size flag should be set,
26 as this decoder does not handle streaming decoding,
27 and so it must know the decompressed size in advance.
28
29 [tests]: https://github.com/facebook/zstd/blob/dev/tests/