ZSTD_estimateCStreamSize_advanced()

This commit is contained in:
Yann Collet
2017-06-26 16:02:25 -07:00
parent 31af8290d1
commit 0c9a915a28
5 changed files with 21 additions and 9 deletions
+7 -3
View File
@@ -414,14 +414,18 @@ size_t ZSTD_estimateDCtxSize(void);
of a future {D,C}Ctx, before its creation.
The objective is to guide decision before allocation.
ZSTD_estimateCCtxSize() will consider src size to be arbitrarily "large".
If srcSize is known to be small, ZSTD_estimateCCtxSize_advanced() will provide a better (smaller) estimation.
If srcSize is known to be small, ZSTD_estimateCCtxSize_advanced() can provide a tighter estimation.
ZSTD_estimateCCtxSize_advanced() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel.
Note : CCtx estimation is only correct for single-threaded compression
</p></pre><BR>
<pre><b>size_t ZSTD_estimateCStreamSize(ZSTD_compressionParameters cParams);
<pre><b>size_t ZSTD_estimateCStreamSize(int compressionLevel);
size_t ZSTD_estimateCStreamSize_advanced(ZSTD_compressionParameters cParams);
size_t ZSTD_estimateDStreamSize(ZSTD_frameHeader fHeader);
</b><p> Note : if streaming is init with function ZSTD_init?Stream_usingDict(),
</b><p> ZSTD_estimateCStreamSize() will consider src size to be arbitrarily "large".
If srcSize is known to be small, ZSTD_estimateCStreamSize_advanced() can provide a tighter estimation.
ZSTD_estimateCStreamSize_advanced() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel.
Note : if streaming is init with function ZSTD_init?Stream_usingDict(),
an internal ?Dict will be created, which size is not estimated here.
In this case, get total size by adding ZSTD_estimate?DictSize
</p></pre><BR>