From: Yann Collet Date: Tue, 17 May 2016 10:01:55 +0000 (+0200) Subject: added `ZSTDv05_getFrameParams()` to "zstd_v05.h" X-Git-Tag: v0.7.0^2~76 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea4daa308d5478a8fc11e9e77c66e822624a280b;p=thirdparty%2Fzstd.git added `ZSTDv05_getFrameParams()` to "zstd_v05.h" --- diff --git a/lib/legacy/zstd_v05.c b/lib/legacy/zstd_v05.c index 42e925c42..9c57d18fc 100644 --- a/lib/legacy/zstd_v05.c +++ b/lib/legacy/zstd_v05.c @@ -436,21 +436,6 @@ extern "C" { ***************************************/ #define ZSTDv05_WINDOWLOG_ABSOLUTEMIN 11 -/* from faster to stronger */ -typedef enum { ZSTDv05_fast, ZSTDv05_greedy, ZSTDv05_lazy, ZSTDv05_lazy2, ZSTDv05_btlazy2, ZSTDv05_opt, ZSTDv05_btopt } ZSTDv05_strategy; - -typedef struct -{ - U64 srcSize; /* optional : tells how much bytes are present in the frame. Use 0 if not known. */ - U32 windowLog; /* largest match distance : larger == more compression, more memory needed during decompression */ - U32 contentLog; /* full search segment : larger == more compression, slower, more memory (useless for fast) */ - U32 hashLog; /* dispatch table : larger == faster, more memory */ - U32 searchLog; /* nb of searches : larger == more compression, slower */ - U32 searchLength; /* match length searched : larger == faster decompression, sometimes less compression */ - U32 targetLength; /* acceptable match size for optimal parser (only) : larger == more compression, slower */ - ZSTDv05_strategy strategy; -} ZSTDv05_parameters; - /*-************************************* * Advanced functions diff --git a/lib/legacy/zstd_v05.h b/lib/legacy/zstd_v05.h index 8ef6bb25a..6dc17a647 100644 --- a/lib/legacy/zstd_v05.h +++ b/lib/legacy/zstd_v05.h @@ -40,7 +40,7 @@ extern "C" { * Dependencies ***************************************/ #include /* size_t */ - +#include "mem.h" /* U64, U32 */ /* ************************************* @@ -91,6 +91,14 @@ size_t ZSTDv05_decompress_usingDict(ZSTDv05_DCtx* dctx, /*-************************ * Advanced Streaming API ***************************/ +typedef enum { ZSTDv05_fast, ZSTDv05_greedy, ZSTDv05_lazy, ZSTDv05_lazy2, ZSTDv05_btlazy2, ZSTDv05_opt, ZSTDv05_btopt } ZSTDv05_strategy; +typedef struct { + U64 srcSize; + U32 windowLog; /* the only useful information to retrieve */ + U32 contentLog; U32 hashLog; U32 searchLog; U32 searchLength; U32 targetLength; ZSTDv05_strategy strategy; +} ZSTDv05_parameters; +size_t ZSTDv05_getFrameParams(ZSTDv05_parameters* params, const void* src, size_t srcSize); + size_t ZSTDv05_decompressBegin_usingDict(ZSTDv05_DCtx* dctx, const void* dict, size_t dictSize); void ZSTDv05_copyDCtx(ZSTDv05_DCtx* dstDCtx, const ZSTDv05_DCtx* srcDCtx); size_t ZSTDv05_nextSrcSizeToDecompress(ZSTDv05_DCtx* dctx);