changed : sufficientLength => targetLength
This commit is contained in:
+1
-1
@@ -191,7 +191,7 @@ void ZSTD_validateParams(ZSTD_parameters* params)
|
|||||||
CLAMP(params->hashLog, ZSTD_HASHLOG_MIN, ZSTD_HASHLOG_MAX);
|
CLAMP(params->hashLog, ZSTD_HASHLOG_MIN, ZSTD_HASHLOG_MAX);
|
||||||
CLAMP(params->searchLog, ZSTD_SEARCHLOG_MIN, ZSTD_SEARCHLOG_MAX);
|
CLAMP(params->searchLog, ZSTD_SEARCHLOG_MIN, ZSTD_SEARCHLOG_MAX);
|
||||||
CLAMP(params->searchLength, ZSTD_SEARCHLENGTH_MIN, ZSTD_SEARCHLENGTH_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;
|
if ((U32)params->strategy>(U32)ZSTD_opt_bt) params->strategy = ZSTD_opt_bt;
|
||||||
|
|
||||||
/* correct params, to use less memory */
|
/* correct params, to use less memory */
|
||||||
|
|||||||
+2
-2
@@ -440,7 +440,7 @@ void ZSTD_compressBlock_opt_generic(ZSTD_CCtx* ctx,
|
|||||||
const BYTE* inr;
|
const BYTE* inr;
|
||||||
U32 skip_num, cur, cur2, match_num, last_pos, litlen, price;
|
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);
|
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;
|
const BYTE* inr;
|
||||||
U32 skip_num, cur, cur2, match_num, last_pos, litlen, price;
|
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);
|
const U32 faster_get_matches = (ctx->params.strategy == ZSTD_opt);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -27,7 +27,7 @@
|
|||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
You can contact the author at :
|
You can contact the author at :
|
||||||
- zstd source repository : https://github.com/Cyan4973/zstd
|
- zstd homepage : http://www.zstd.net
|
||||||
*/
|
*/
|
||||||
#ifndef ZSTD_STATIC_H
|
#ifndef ZSTD_STATIC_H
|
||||||
#define 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
|
typedef struct
|
||||||
{
|
{
|
||||||
U64 srcSize; /* optional : tells how much bytes are present in the frame. Use 0 if not known. */
|
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 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 contentLog; /* full search segment : larger == more compression, slower, more memory (useless for fast) */
|
||||||
U32 hashLog; /* dispatch table : larger == faster, more memory */
|
U32 hashLog; /* dispatch table : larger == faster, more memory */
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ static size_t BMK_benchParam(BMK_result_t* resultPtr,
|
|||||||
U32 Hlog = params.hashLog;
|
U32 Hlog = params.hashLog;
|
||||||
U32 Slog = params.searchLog;
|
U32 Slog = params.searchLog;
|
||||||
U32 Slength = params.searchLength;
|
U32 Slength = params.searchLength;
|
||||||
U32 Tlength = params.sufficientLength;
|
U32 Tlength = params.targetLength;
|
||||||
ZSTD_strategy strat = params.strategy;
|
ZSTD_strategy strat = params.strategy;
|
||||||
char name[30] = { 0 };
|
char name[30] = { 0 };
|
||||||
U64 crcOrig;
|
U64 crcOrig;
|
||||||
@@ -414,7 +414,7 @@ static void BMK_printWinner(FILE* f, U32 cLevel, BMK_result_t result, ZSTD_param
|
|||||||
DISPLAY("\r%79s\r", "");
|
DISPLAY("\r%79s\r", "");
|
||||||
fprintf(f," {%3u,%3u,%3u,%3u,%3u,%3u,%3u, %s }, ",
|
fprintf(f," {%3u,%3u,%3u,%3u,%3u,%3u,%3u, %s }, ",
|
||||||
0, params.windowLog, params.contentLog, params.hashLog, params.searchLog, params.searchLength,
|
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,
|
fprintf(f,
|
||||||
"/* level %2u */ /* R:%5.3f at %5.1f MB/s - %5.1f MB/s */\n",
|
"/* 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.);
|
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)
|
if (params.strategy == ZSTD_fast)
|
||||||
g_params.contentLog = 0, g_params.searchLog = 0;
|
g_params.contentLog = 0, g_params.searchLog = 0;
|
||||||
if ((params.strategy != ZSTD_opt) && (params.strategy != ZSTD_opt_bt))
|
if ((params.strategy != ZSTD_opt) && (params.strategy != ZSTD_opt_bt))
|
||||||
g_params.sufficientLength = 0;
|
g_params.targetLength = 0;
|
||||||
return &g_params;
|
return &g_params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -587,9 +587,9 @@ static void paramVariation(ZSTD_parameters* p)
|
|||||||
case 11:
|
case 11:
|
||||||
p->strategy = (ZSTD_strategy)(((U32)p->strategy)-1); break;
|
p->strategy = (ZSTD_strategy)(((U32)p->strategy)-1); break;
|
||||||
case 12:
|
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:
|
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);
|
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->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->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->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));
|
p->strategy = (ZSTD_strategy) (FUZ_rand(&g_rand) % (ZSTD_opt_bt+1));
|
||||||
ZSTD_validateParams(p);
|
ZSTD_validateParams(p);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user