ZSTD_setAdditionalParam

This commit is contained in:
inikep 2016-03-15 12:18:44 +01:00
parent 5fdd0b46d3
commit d700a1a8b9
4 changed files with 14 additions and 6 deletions

4
.gitignore vendored
View File

@ -47,7 +47,3 @@ ipch/
.directory
_codelite
_zstdbench
lib/zstd_opt_LZ5.c
lib/zstd_opt_llen.c
lib/zstd_opt_nollen.c

View 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; };

5
programs/.gitignore vendored
View File

@ -34,3 +34,8 @@ paramgrill
# Default result files
dictionary
grillResults.txt
_*
# Misc files
*.bat
fileTests.sh

View 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;