diff --git a/.gitignore b/.gitignore index 7e142fcd..6ca7f8a7 100644 --- a/.gitignore +++ b/.gitignore @@ -47,7 +47,3 @@ ipch/ .directory _codelite _zstdbench - -lib/zstd_opt_LZ5.c -lib/zstd_opt_llen.c -lib/zstd_opt_nollen.c diff --git a/lib/zstd_compress.c b/lib/zstd_compress.c index fc88eb16..2ee25cc9 100644 --- a/lib/zstd_compress.c +++ b/lib/zstd_compress.c @@ -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; }; diff --git a/programs/.gitignore b/programs/.gitignore index 525037b9..20cab859 100644 --- a/programs/.gitignore +++ b/programs/.gitignore @@ -34,3 +34,8 @@ paramgrill # Default result files dictionary grillResults.txt +_* + +# Misc files +*.bat +fileTests.sh diff --git a/programs/bench.c b/programs/bench.c index 94daa36c..e0db60e5 100644 --- a/programs/bench.c +++ b/programs/bench.c @@ -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;