mirror of
https://github.com/facebook/zstd.git
synced 2025-08-08 17:22:10 +03:00
added documentation for LDM + dictionary compatibility
This commit is contained in:
15
lib/zstd.h
15
lib/zstd.h
@@ -1020,9 +1020,11 @@ ZSTDLIB_API unsigned ZSTD_getDictID_fromFrame(const void* src, size_t srcSize);
|
||||
* Advanced dictionary and prefix API (Requires v1.4.0+)
|
||||
*
|
||||
* This API allows dictionaries to be used with ZSTD_compress2(),
|
||||
* ZSTD_compressStream2(), and ZSTD_decompressDCtx(). Dictionaries are sticky, and
|
||||
* only reset with the context is reset with ZSTD_reset_parameters or
|
||||
* ZSTD_reset_session_and_parameters. Prefixes are single-use.
|
||||
* ZSTD_compressStream2(), and ZSTD_decompressDCtx().
|
||||
* Dictionaries are sticky, they remain valid when same context is re-used,
|
||||
* they only reset when the context is reset
|
||||
* with ZSTD_reset_parameters or ZSTD_reset_session_and_parameters.
|
||||
* In contrast, Prefixes are single-use.
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
@@ -1043,7 +1045,11 @@ ZSTDLIB_API unsigned ZSTD_getDictID_fromFrame(const void* src, size_t srcSize);
|
||||
* Use experimental ZSTD_CCtx_loadDictionary_byReference() to reference content instead.
|
||||
* In such a case, dictionary buffer must outlive its users.
|
||||
* Note 4 : Use ZSTD_CCtx_loadDictionary_advanced()
|
||||
* to precisely select how dictionary content must be interpreted. */
|
||||
* to precisely select how dictionary content must be interpreted.
|
||||
* Note 5 : This method does not benefit from LDM (long distance mode).
|
||||
* If you want to employ LDM on some large dictionary content,
|
||||
* prefer employing ZSTD_CCtx_refPrefix() described below.
|
||||
*/
|
||||
ZSTDLIB_API size_t ZSTD_CCtx_loadDictionary(ZSTD_CCtx* cctx, const void* dict, size_t dictSize);
|
||||
|
||||
/*! ZSTD_CCtx_refCDict() : Requires v1.4.0+
|
||||
@@ -1066,6 +1072,7 @@ ZSTDLIB_API size_t ZSTD_CCtx_refCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict);
|
||||
* Decompression will need same prefix to properly regenerate data.
|
||||
* Compressing with a prefix is similar in outcome as performing a diff and compressing it,
|
||||
* but performs much faster, especially during decompression (compression speed is tunable with compression level).
|
||||
* This method is compatible with LDM (long distance mode).
|
||||
* @result : 0, or an error code (which can be tested with ZSTD_isError()).
|
||||
* Special: Adding any prefix (including NULL) invalidates any previous prefix or dictionary
|
||||
* Note 1 : Prefix buffer is referenced. It **must** outlive compression.
|
||||
|
Reference in New Issue
Block a user