The sequence section starts with a number, which tells how sequences are present in the section. If this number if 0, the section automatically ends. The number 0 can be represented using the 1 byte or the 2 bytes formats. That's because the 2-bytes formats fully overlaps the 1 byte format. However, when 0 is represented using the 2-bytes format, the decoder was expecting the sequence section to continue, and was looking for FSE tables, which is incorrect. Fixed this behavior, in both the reference decoder and the educational behavior. In practice, this behavior never happens, because the encoder will always select the 1-byte format to represent 0, since this is more efficient. Completed the fix with a new golden sample for tests, a clarification of the specification, and a decoder errata paragraph.
Zstandard Documentation
This directory contains material defining the Zstandard format,
as well as detailed instructions to use zstd
library.
zstd_manual.html
: Documentation of zstd.h
API, in html format.
Unfortunately, Github doesn't display html
files in parsed format, just as source code.
For a readable display of html API documentation of latest release,
use this link: https://raw.githack.com/facebook/zstd/release/doc/zstd_manual.html .
zstd_compression_format.md
: This document defines the Zstandard compression format.
Compliant decoders must adhere to this document,
and compliant encoders must generate data that follows it.
Should you look for resources to develop your own port of Zstandard algorithm, you may find the following resources useful :
educational_decoder
: This directory contains an implementation of a Zstandard decoder,
compliant with the Zstandard compression format.
It can be used, for example, to better understand the format,
or as the basis for a separate implementation of Zstandard decoder.
decode_corpus
:
This tool, stored in /tests
directory, is able to generate random valid frames,
which is useful if you wish to test your decoder and verify it fully supports the specification.