From 572d428b5964bcae17d303f2c941cced1167c4c6 Mon Sep 17 00:00:00 2001 From: inikep Date: Tue, 27 Sep 2016 15:25:20 +0200 Subject: [PATCH] updated description of ZWRAP_setPledgedSrcSize --- zlibWrapper/README.md | 2 +- zlibWrapper/zstd_zlibwrapper.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/zlibWrapper/README.md b/zlibWrapper/README.md index 163009a8b..427cdbe09 100644 --- a/zlibWrapper/README.md +++ b/zlibWrapper/README.md @@ -85,7 +85,7 @@ During streaming compression the compressor never knows how big is data to compr Zstandard compression can be improved by providing size of source data to the compressor. By default streaming compressor assumes that data is bigger than 256 KB but it can hurt compression speed on smaller data. The zstd wrapper provides the `ZWRAP_setPledgedSrcSize()` function that allows to change a pledged source size for a given compression stream. The function will change zstd compression parameters what may improve compression speed and/or ratio. -It should be called just after `deflateInit()`. The function is only helpful when data is compressed in blocks. There will be no change in case of `deflateInit()` immediately followed by `deflate(strm, Z_FINISH)` +It should be called just after `deflateInit()`or `deflateReset()` and before `deflate()` or `deflateSetDictionary()`. The function is only helpful when data is compressed in blocks. There will be no change in case of `deflateInit()` or `deflateReset()` immediately followed by `deflate(strm, Z_FINISH)` as this case is automatically detected. diff --git a/zlibWrapper/zstd_zlibwrapper.h b/zlibWrapper/zstd_zlibwrapper.h index 5447b3a91..6a9cddc22 100644 --- a/zlibWrapper/zstd_zlibwrapper.h +++ b/zlibWrapper/zstd_zlibwrapper.h @@ -39,8 +39,9 @@ int ZWRAP_isUsingZSTDcompression(void); /* Changes a pledged source size for a given compression stream. It will change ZSTD compression parameters what may improve compression speed and/or ratio. - The function should be called just after deflateInit(). It's only helpful when data is compressed in blocks. - There will be no change in case of deflateInit() immediately followed by deflate(strm, Z_FINISH) + The function should be called just after deflateInit() or deflateReset() and before deflate() or deflateSetDictionary(). + It's only helpful when data is compressed in blocks. + There will be no change in case of deflateInit() or deflateReset() immediately followed by deflate(strm, Z_FINISH) as this case is automatically detected. */ int ZWRAP_setPledgedSrcSize(z_streamp strm, unsigned long long pledgedSrcSize);