]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
ZSTD_setAdditionalParam
authorinikep <inikep@gmail.com>
Tue, 15 Mar 2016 11:18:44 +0000 (12:18 +0100)
committerinikep <inikep@gmail.com>
Tue, 15 Mar 2016 11:18:44 +0000 (12:18 +0100)
.gitignore
lib/zstd_compress.c
programs/.gitignore
programs/bench.c

index 7e142fcd1f0b5d48a4f392e7bfd07a4bfec64777..6ca7f8a7e24dda63d3700de999a607af69098948 100644 (file)
@@ -47,7 +47,3 @@ ipch/
 .directory
 _codelite
 _zstdbench
-
-lib/zstd_opt_LZ5.c
-lib/zstd_opt_llen.c
-lib/zstd_opt_nollen.c
index fc88eb1689112ecd5543d05c39e410d3e6140d80..2ee25cc934062798d15c39f1b607926e878bc7e5 100644 (file)
@@ -98,6 +98,7 @@ struct ZSTD_CCtx_s
     U32   nextToUpdate3;    /* index from which to continue dictionary update */
     U32   loadedDictEnd;
     U32   stage;
+    U32   additionalParam;
     ZSTD_parameters params;
     void* workSpace;
     size_t workSpaceSize;
@@ -273,6 +274,7 @@ size_t ZSTD_copyCCtx(ZSTD_CCtx* dstCCtx, const ZSTD_CCtx* srcCCtx)
     dstCCtx->dictLimit   = srcCCtx->dictLimit;
     dstCCtx->lowLimit    = srcCCtx->lowLimit;
     dstCCtx->loadedDictEnd = srcCCtx->loadedDictEnd;
+    dstCCtx->additionalParam = srcCCtx->additionalParam;
 
     /* copy entropy tables */
     dstCCtx->flagStaticTables = srcCCtx->flagStaticTables;
@@ -2421,3 +2423,5 @@ ZSTD_parameters ZSTD_getParams(int compressionLevel, U64 srcSizeHint)
     return result;
 }
 
+
+void ZSTD_setAdditionalParam(ZSTD_CCtx* ctx, int additionalParam) { ctx->additionalParam = additionalParam; };
index 525037b942cf49315aa094f677ede360574b650c..20cab859aca5659948aade1421d074c143b719a0 100644 (file)
@@ -34,3 +34,8 @@ paramgrill
 # Default result files
 dictionary
 grillResults.txt
+_*
+
+# Misc files
+*.bat
+fileTests.sh
index 94daa36cbd50e95697e0c8c64d6db2a3141d544d..e0db60e5b6bfbdf1d1988968f2bdeddfd02751e5 100644 (file)
@@ -435,7 +435,7 @@ static void BMK_benchCLevel(void* srcBuffer, size_t benchedSize,
     memset(&result, 0, sizeof(result));
     memset(&total, 0, sizeof(total));
 
-     if (g_displayLevel == 1)
+    if (g_displayLevel == 1 && !additionalParam)
         DISPLAY("bench %s: input %u bytes, %i iterations, %u KB blocks\n", ZSTD_VERSION, (U32)benchedSize, nbIterations, (U32)(g_blockSize>>10));
 
     if (cLevelLast < cLevel) cLevelLast = cLevel;
@@ -446,7 +446,10 @@ static void BMK_benchCLevel(void* srcBuffer, size_t benchedSize,
                      fileSizes, nbFiles,
                      dictBuffer, dictBufferSize, &result);
         if (g_displayLevel == 1) {
-            DISPLAY("%-3i%11i (%5.3f) %6.1f MB/s %6.1f MB/s  %s\n", -l, (int)result.cSize, result.ratio, result.cSpeed, result.dSpeed, displayName);
+            if (additionalParam)
+                DISPLAY("%-3i%11i (%5.3f) %6.1f MB/s %6.1f MB/s  %s (p=%d)\n", -l, (int)result.cSize, result.ratio, result.cSpeed, result.dSpeed, displayName, additionalParam);
+            else
+                DISPLAY("%-3i%11i (%5.3f) %6.1f MB/s %6.1f MB/s  %s\n", -l, (int)result.cSize, result.ratio, result.cSpeed, result.dSpeed, displayName);
             total.cSize += result.cSize;
             total.cSpeed += result.cSpeed;
             total.dSpeed += result.dSpeed;