]> git.ipfire.org Git - thirdparty/zstd.git/commit
Fix ZSTD_adjustCParams_internal() to handle dictionary logic
authorNick Terrell <terrelln@fb.com>
Thu, 1 Oct 2020 20:12:23 +0000 (13:12 -0700)
committerNick Terrell <terrelln@fb.com>
Mon, 12 Oct 2020 19:50:04 +0000 (12:50 -0700)
commitd5c688e8ae8959e1740fe3833251c88fca3e5e10
treeef1581f3824d19a5fcf4fde4e8e43b097c8746d3
parentfadaab8c7c00f6b1589c207e1623ffee7a21e9e7
Fix ZSTD_adjustCParams_internal() to handle dictionary logic

Pass in the `ZSTD_cParamMode_e` to select how we define our cparams.
Based on the mode we either take the `dictSize` into account or we set
it to `0`. See the documentation for `ZSTD_cParamMode_e`.

Some of the modes currently share the same behavior. But they have
distinct modes because they are drastically different cases. E.g.
compression + reprocessing the dictionary and creating a cdict.

Additionally, when downsizing the hashLog and chainLog take the
(adjusted) dictionary size into account, since the size of the
dictionary gets added onto the window size.

Adds a simple test to ensure that we aren't downsizing too far.
lib/compress/zstd_compress.c
lib/compress/zstd_compress_internal.h
lib/compress/zstdmt_compress.c
tests/fuzzer.c