Don't shrink window log in ZSTD_getCParams()
Treat ZSTD_getCParams() and ZSTD_adjustCParams() in the same way we treat streaming compression. Choose parameters based on the dictionary size + source size, and assume the source size is small if unkown. But, don't shrink the window log down in ZSTD_adjustCParams_internal().
This commit is contained in:
@@ -1189,17 +1189,13 @@ ZSTD_adjustCParams_internal(ZSTD_compressionParameters cPar,
|
||||
assert(ZSTD_checkCParams(cPar)==0);
|
||||
|
||||
switch (mode) {
|
||||
case ZSTD_cpm_unknown:
|
||||
case ZSTD_cpm_noAttachDict:
|
||||
/* If we don't know the source size, don't make any
|
||||
* assumptions about it. We will already have selected
|
||||
* smaller parameters if a dictionary is in use.
|
||||
*/
|
||||
break;
|
||||
case ZSTD_cpm_unknown:
|
||||
/* Keep the legacy behavior of assuming small source
|
||||
* sizes when the cparam mode is unkown.
|
||||
*/
|
||||
/* fall-through */
|
||||
case ZSTD_cpm_createCDict:
|
||||
/* Assume a small source size when creating a dictionary
|
||||
* with an unkown source size.
|
||||
|
||||
Reference in New Issue
Block a user