]> git.ipfire.org Git - thirdparty/zstd.git/commit
spec update : require minimum nb of literals for 4-streams mode 3398/head
authorYann Collet <cyan@fb.com>
Thu, 22 Dec 2022 19:30:15 +0000 (11:30 -0800)
committerYann Collet <cyan@fb.com>
Fri, 23 Dec 2022 00:14:34 +0000 (16:14 -0800)
commit6a9c525903ca65aad61b50381b5781c1187143d1
treef02045efdde78523c60d0bdfc43a228bc549df8e
parent40a718813070e23c3c7a437477a9e984d4de3f8b
spec update : require minimum nb of literals for 4-streams mode

Reported by @shulib :
the specification for 4-streams mode
doesn't work when the amount of literals to compress is 5 bytes.
Extending it, it also doesn't work for sizes 1 or 2.

This patch updates the specification and the implementation
to require a minimum of 6 literals to trigger or accept the 4-streams mode.

The impact is expected to be a no-op :
the 4-streams mode is never triggered for such small quantity of literals anyway,
since it would be wasteful (it costs ~7.3 bytes more than single-stream mode).
An informal lower limit is set at ~256 bytes,
so the technical minimum is very far from this limit.

This is just meant for completeness of the specification.
doc/zstd_compression_format.md
lib/common/error_private.c
lib/common/huf.h
lib/common/zstd_internal.h
lib/compress/zstd_compress_literals.c
lib/decompress/huf_decompress.c
lib/decompress/zstd_decompress_block.c
lib/zstd_errors.h