zstd/lib/compress
Nick Terrell 9d31c704d5 Don't shrink window log when streaming with a dictionary
Fixes #2442.

1. When creating a dictionary keep the same behavior as before.
   Assume the source size is 513 bytes when adjusting parameters.
2. When calling ZSTD_getCParams() or ZSTD_adjustCParams() keep
   the same behavior as before.
3. When attaching a dictionary keep the same behavior of ignoring
   the dictionary size. When streaming this will select the
   largest parameters and not adjust them down. But, the CDict
   will use the correctly sized parameters, which seems like the
   right tradeoff.
4. When not attaching a dictionary (either forced not to, or
   using a prefix dictionary) we select parameters based on the
   dictionary size + source size, and assume the source size is
   small, which is the same behavior as before. But, now we don't
   adjust the window log (and hash and chain log) down when the
   source size is unknown.

When the source size is unknown all cdicts should attach, except
when the user disables attaching, or `forceWindow` is used. This
means that when streaming with a CDict we end up in the good case
where we get small CDict parameters, and large source parameters.

TODO: Add a streaming + dictionary regression test case.
2021-01-04 15:54:09 -08:00
..
2021-01-04 17:53:52 -05:00
2021-01-04 17:53:52 -05:00
2021-01-04 17:53:52 -05:00
2021-01-04 17:53:52 -05:00
2021-01-04 17:53:52 -05:00
2021-01-04 17:53:52 -05:00
2021-01-04 17:53:52 -05:00
2021-01-04 17:53:52 -05:00
2021-01-04 17:53:52 -05:00
2021-01-04 17:53:52 -05:00
2021-01-04 17:53:52 -05:00
2021-01-04 17:53:52 -05:00
2021-01-04 17:53:52 -05:00