]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
added `ZSTDv05_getFrameParams()` to "zstd_v05.h"
authorYann Collet <yann.collet.73@gmail.com>
Tue, 17 May 2016 10:01:55 +0000 (12:01 +0200)
committerYann Collet <yann.collet.73@gmail.com>
Tue, 17 May 2016 10:01:55 +0000 (12:01 +0200)
lib/legacy/zstd_v05.c
lib/legacy/zstd_v05.h

index 42e925c4280bbb0880697b12d294b7e524cf8bdc..9c57d18fc98b11f83d101c7a25e6b789c4944db2 100644 (file)
@@ -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
index 8ef6bb25a21bf950c1906125a770370211d3f46e..6dc17a6471b22ae20522512cd4e2b6bd69d3a61e 100644 (file)
@@ -40,7 +40,7 @@ extern "C" {
 *  Dependencies
 ***************************************/
 #include <stddef.h>   /* 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);