--- /dev/null
+Zstandard Documentation
+=======================
+
+This directory contains material defining the Zstandard format,
+as well as for help using the `zstd` library.
+
+__`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.
+
+__`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 a Zstandard decoder/encoder.
+
+__`zstd_manual.html`__ : Documentation on the functions found in `zstd.h`.
+See [http://zstd.net/zstd_manual.html](http://zstd.net/zstd_manual.html) for
+the manual released with the latest official `zstd` release.
+
+
case 2:
// "Size_Format uses 1 bit. Regenerated_Size uses 5 bits (0-31)."
IO_rewind_bits(in, 1);
- size = IO_read_bits(in, 2);
+ size = IO_read_bits(in, 5);
break;
case 1:
// "Size_Format uses 2 bits. Regenerated_Size uses 12 bits (0-4095)."
IMPOSSIBLE();
}
if (regenerated_size > MAX_LITERALS_SIZE ||
- compressed_size > regenerated_size) {
+ compressed_size >= regenerated_size) {
CORRUPTION();
}
/// Returns a pointer to write `len` bytes to, and advances the internal state
static inline u8 *IO_write_bytes(ostream_t *const out, size_t len) {
if (len > out->len) {
- INP_SIZE();
+ OUT_SIZE();
}
u8 *const ptr = out->ptr;
out->ptr += len;