From: Yann Collet Date: Thu, 11 Feb 2016 03:38:55 +0000 (+0100) Subject: changed : sufficientLength => targetLength X-Git-Tag: v0.5.1^2~3^2~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd828d9cd129d9c4c6c28a1f6f6e0c8d078e6440;p=thirdparty%2Fzstd.git changed : sufficientLength => targetLength --- diff --git a/lib/zstd_compress.c b/lib/zstd_compress.c index 137058b5b..dda6683e6 100644 --- a/lib/zstd_compress.c +++ b/lib/zstd_compress.c @@ -191,7 +191,7 @@ void ZSTD_validateParams(ZSTD_parameters* params) CLAMP(params->hashLog, ZSTD_HASHLOG_MIN, ZSTD_HASHLOG_MAX); CLAMP(params->searchLog, ZSTD_SEARCHLOG_MIN, ZSTD_SEARCHLOG_MAX); CLAMP(params->searchLength, ZSTD_SEARCHLENGTH_MIN, ZSTD_SEARCHLENGTH_MAX); - CLAMP(params->sufficientLength, ZSTD_TARGETLENGTH_MIN, ZSTD_TARGETLENGTH_MAX); + CLAMP(params->targetLength, ZSTD_TARGETLENGTH_MIN, ZSTD_TARGETLENGTH_MAX); if ((U32)params->strategy>(U32)ZSTD_opt_bt) params->strategy = ZSTD_opt_bt; /* correct params, to use less memory */ diff --git a/lib/zstd_opt.h b/lib/zstd_opt.h index 8d9598db3..a936d3131 100644 --- a/lib/zstd_opt.h +++ b/lib/zstd_opt.h @@ -440,7 +440,7 @@ void ZSTD_compressBlock_opt_generic(ZSTD_CCtx* ctx, const BYTE* inr; U32 skip_num, cur, cur2, match_num, last_pos, litlen, price; - const U32 sufficient_len = ctx->params.sufficientLength; + const U32 sufficient_len = ctx->params.targetLength; const U32 faster_get_matches = (ctx->params.strategy == ZSTD_opt); @@ -800,7 +800,7 @@ void ZSTD_compressBlock_opt_extDict_generic(ZSTD_CCtx* ctx, const BYTE* inr; U32 skip_num, cur, cur2, match_num, last_pos, litlen, price; - const U32 sufficient_len = ctx->params.sufficientLength; + const U32 sufficient_len = ctx->params.targetLength; const U32 faster_get_matches = (ctx->params.strategy == ZSTD_opt); diff --git a/lib/zstd_static.h b/lib/zstd_static.h index 8b7d63b23..f31e63a28 100644 --- a/lib/zstd_static.h +++ b/lib/zstd_static.h @@ -27,7 +27,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. You can contact the author at : - - zstd source repository : https://github.com/Cyan4973/zstd + - zstd homepage : http://www.zstd.net */ #ifndef ZSTD_STATIC_H #define ZSTD_STATIC_H @@ -71,7 +71,7 @@ typedef enum { ZSTD_fast, ZSTD_greedy, ZSTD_lazy, ZSTD_lazy2, ZSTD_btlazy2, ZSTD typedef struct { U64 srcSize; /* optional : tells how much bytes are present in the frame. Use 0 if not known. */ - U32 sufficientLength; /* size of matches which is acceptable (used only by the optimal parser): larger == more compression, slower */ + U32 targetLength; /* acceptable match size for optimal parser (only) : larger == more compression, slower */ 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 */ diff --git a/programs/paramgrill.c b/programs/paramgrill.c index e3f421277..b77f7a38c 100644 --- a/programs/paramgrill.c +++ b/programs/paramgrill.c @@ -265,7 +265,7 @@ static size_t BMK_benchParam(BMK_result_t* resultPtr, U32 Hlog = params.hashLog; U32 Slog = params.searchLog; U32 Slength = params.searchLength; - U32 Tlength = params.sufficientLength; + U32 Tlength = params.targetLength; ZSTD_strategy strat = params.strategy; char name[30] = { 0 }; U64 crcOrig; @@ -414,7 +414,7 @@ static void BMK_printWinner(FILE* f, U32 cLevel, BMK_result_t result, ZSTD_param DISPLAY("\r%79s\r", ""); fprintf(f," {%3u,%3u,%3u,%3u,%3u,%3u,%3u, %s }, ", 0, params.windowLog, params.contentLog, params.hashLog, params.searchLog, params.searchLength, - params.sufficientLength, g_stratName[(U32)(params.strategy)]); + params.targetLength, g_stratName[(U32)(params.strategy)]); fprintf(f, "/* level %2u */ /* R:%5.3f at %5.1f MB/s - %5.1f MB/s */\n", cLevel, (double)srcSize / result.cSize, (double)result.cSpeed / 1000., (double)result.dSpeed / 1000.); @@ -550,7 +550,7 @@ static ZSTD_parameters* sanitizeParams(ZSTD_parameters params) if (params.strategy == ZSTD_fast) g_params.contentLog = 0, g_params.searchLog = 0; if ((params.strategy != ZSTD_opt) && (params.strategy != ZSTD_opt_bt)) - g_params.sufficientLength = 0; + g_params.targetLength = 0; return &g_params; } @@ -587,9 +587,9 @@ static void paramVariation(ZSTD_parameters* p) case 11: p->strategy = (ZSTD_strategy)(((U32)p->strategy)-1); break; case 12: - p->sufficientLength *= 1 + ((double)(FUZ_rand(&g_rand)&255)) / 256.; break; + p->targetLength *= 1 + ((double)(FUZ_rand(&g_rand)&255)) / 256.; break; case 13: - p->sufficientLength /= 1 + ((double)(FUZ_rand(&g_rand)&255)) / 256.; break; + p->targetLength /= 1 + ((double)(FUZ_rand(&g_rand)&255)) / 256.; break; } } ZSTD_validateParams(p); @@ -647,7 +647,7 @@ static void potentialRandomParams(ZSTD_parameters* p, U32 inverseChance) p->searchLog = FUZ_rand(&g_rand) % (ZSTD_SEARCHLOG_MAX+1 - ZSTD_SEARCHLOG_MIN) + ZSTD_SEARCHLOG_MIN; p->windowLog = FUZ_rand(&g_rand) % (ZSTD_WINDOWLOG_MAX+1 - ZSTD_WINDOWLOG_MIN) + ZSTD_WINDOWLOG_MIN; p->searchLength=FUZ_rand(&g_rand) % (ZSTD_SEARCHLENGTH_MAX+1 - ZSTD_SEARCHLENGTH_MIN) + ZSTD_SEARCHLENGTH_MIN; - p->sufficientLength=FUZ_rand(&g_rand) % (ZSTD_TARGETLENGTH_MAX+1 - ZSTD_TARGETLENGTH_MIN) + ZSTD_TARGETLENGTH_MIN; + p->targetLength=FUZ_rand(&g_rand) % (ZSTD_TARGETLENGTH_MAX+1 - ZSTD_TARGETLENGTH_MIN) + ZSTD_TARGETLENGTH_MIN; p->strategy = (ZSTD_strategy) (FUZ_rand(&g_rand) % (ZSTD_opt_bt+1)); ZSTD_validateParams(p); }