mirror of
https://github.com/facebook/zstd.git
synced 2024-11-24 17:06:43 +08:00
changed hashEveryLog into hashRateLog
This commit is contained in:
parent
5d3592398d
commit
41c7d0b1e1
@ -461,12 +461,12 @@ size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
|
|||||||
* Larger values improve collision resolution but decrease compression speed.
|
* Larger values improve collision resolution but decrease compression speed.
|
||||||
* The maximum value is ZSTD_LDM_BUCKETSIZELOG_MAX.
|
* The maximum value is ZSTD_LDM_BUCKETSIZELOG_MAX.
|
||||||
* Special: value 0 means "use default value" (default: 3). */
|
* Special: value 0 means "use default value" (default: 3). */
|
||||||
ZSTD_p_ldmHashEveryLog=164, </b>/* Frequency of inserting/looking up entries into the LDM hash table.<b>
|
ZSTD_p_ldmHashRateLog=164, </b>/* Frequency of inserting/looking up entries into the LDM hash table.<b>
|
||||||
* Must be clamped between 0 and (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN).
|
* Must be clamped between 0 and (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN).
|
||||||
* Default is MAX(0, (windowLog - ldmHashLog)), optimizing hash table usage.
|
* Default is MAX(0, (windowLog - ldmHashLog)), optimizing hash table usage.
|
||||||
* Larger values improve compression speed.
|
* Larger values improve compression speed.
|
||||||
* Deviating far from default value will likely result in a compression ratio decrease.
|
* Deviating far from default value will likely result in a compression ratio decrease.
|
||||||
* Special: value 0 means "automatically determine hashEveryLog". */
|
* Special: value 0 means "automatically determine hashRateLog". */
|
||||||
|
|
||||||
</b>/* frame parameters */<b>
|
</b>/* frame parameters */<b>
|
||||||
ZSTD_p_contentSizeFlag=200, </b>/* Content size will be written into frame header _whenever known_ (default:1)<b>
|
ZSTD_p_contentSizeFlag=200, </b>/* Content size will be written into frame header _whenever known_ (default:1)<b>
|
||||||
|
@ -330,9 +330,9 @@ ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter param)
|
|||||||
bounds.upperBound = ZSTD_LDM_BUCKETSIZELOG_MAX;
|
bounds.upperBound = ZSTD_LDM_BUCKETSIZELOG_MAX;
|
||||||
return bounds;
|
return bounds;
|
||||||
|
|
||||||
case ZSTD_p_ldmHashEveryLog:
|
case ZSTD_p_ldmHashRateLog:
|
||||||
bounds.lowerBound = ZSTD_LDM_HASHEVERYLOG_MIN;
|
bounds.lowerBound = ZSTD_LDM_HASHRATELOG_MIN;
|
||||||
bounds.upperBound = ZSTD_LDM_HASHEVERYLOG_MAX;
|
bounds.upperBound = ZSTD_LDM_HASHRATELOG_MAX;
|
||||||
return bounds;
|
return bounds;
|
||||||
|
|
||||||
/* experimental parameters */
|
/* experimental parameters */
|
||||||
@ -397,7 +397,7 @@ static int ZSTD_isUpdateAuthorized(ZSTD_cParameter param)
|
|||||||
case ZSTD_p_ldmHashLog:
|
case ZSTD_p_ldmHashLog:
|
||||||
case ZSTD_p_ldmMinMatch:
|
case ZSTD_p_ldmMinMatch:
|
||||||
case ZSTD_p_ldmBucketSizeLog:
|
case ZSTD_p_ldmBucketSizeLog:
|
||||||
case ZSTD_p_ldmHashEveryLog:
|
case ZSTD_p_ldmHashRateLog:
|
||||||
case ZSTD_p_forceAttachDict:
|
case ZSTD_p_forceAttachDict:
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
@ -461,7 +461,7 @@ size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int value)
|
|||||||
case ZSTD_p_ldmHashLog:
|
case ZSTD_p_ldmHashLog:
|
||||||
case ZSTD_p_ldmMinMatch:
|
case ZSTD_p_ldmMinMatch:
|
||||||
case ZSTD_p_ldmBucketSizeLog:
|
case ZSTD_p_ldmBucketSizeLog:
|
||||||
case ZSTD_p_ldmHashEveryLog:
|
case ZSTD_p_ldmHashRateLog:
|
||||||
if (cctx->cdict) return ERROR(stage_wrong);
|
if (cctx->cdict) return ERROR(stage_wrong);
|
||||||
return ZSTD_CCtxParam_setParameter(&cctx->requestedParams, param, value);
|
return ZSTD_CCtxParam_setParameter(&cctx->requestedParams, param, value);
|
||||||
|
|
||||||
@ -610,11 +610,11 @@ size_t ZSTD_CCtxParam_setParameter(ZSTD_CCtx_params* CCtxParams,
|
|||||||
CCtxParams->ldmParams.bucketSizeLog = value;
|
CCtxParams->ldmParams.bucketSizeLog = value;
|
||||||
return CCtxParams->ldmParams.bucketSizeLog;
|
return CCtxParams->ldmParams.bucketSizeLog;
|
||||||
|
|
||||||
case ZSTD_p_ldmHashEveryLog :
|
case ZSTD_p_ldmHashRateLog :
|
||||||
if (value > ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN)
|
if (value > ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN)
|
||||||
return ERROR(parameter_outOfBound);
|
return ERROR(parameter_outOfBound);
|
||||||
CCtxParams->ldmParams.hashEveryLog = value;
|
CCtxParams->ldmParams.hashRateLog = value;
|
||||||
return CCtxParams->ldmParams.hashEveryLog;
|
return CCtxParams->ldmParams.hashRateLog;
|
||||||
|
|
||||||
default: return ERROR(parameter_unsupported);
|
default: return ERROR(parameter_unsupported);
|
||||||
}
|
}
|
||||||
@ -711,8 +711,8 @@ size_t ZSTD_CCtxParam_getParameter(
|
|||||||
case ZSTD_p_ldmBucketSizeLog :
|
case ZSTD_p_ldmBucketSizeLog :
|
||||||
*value = CCtxParams->ldmParams.bucketSizeLog;
|
*value = CCtxParams->ldmParams.bucketSizeLog;
|
||||||
break;
|
break;
|
||||||
case ZSTD_p_ldmHashEveryLog :
|
case ZSTD_p_ldmHashRateLog :
|
||||||
*value = CCtxParams->ldmParams.hashEveryLog;
|
*value = CCtxParams->ldmParams.hashRateLog;
|
||||||
break;
|
break;
|
||||||
default: return ERROR(parameter_unsupported);
|
default: return ERROR(parameter_unsupported);
|
||||||
}
|
}
|
||||||
@ -1119,7 +1119,7 @@ static U32 ZSTD_equivalentLdmParams(ldmParams_t ldmParams1,
|
|||||||
ldmParams1.hashLog == ldmParams2.hashLog &&
|
ldmParams1.hashLog == ldmParams2.hashLog &&
|
||||||
ldmParams1.bucketSizeLog == ldmParams2.bucketSizeLog &&
|
ldmParams1.bucketSizeLog == ldmParams2.bucketSizeLog &&
|
||||||
ldmParams1.minMatchLength == ldmParams2.minMatchLength &&
|
ldmParams1.minMatchLength == ldmParams2.minMatchLength &&
|
||||||
ldmParams1.hashEveryLog == ldmParams2.hashEveryLog);
|
ldmParams1.hashRateLog == ldmParams2.hashRateLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef enum { ZSTDb_not_buffered, ZSTDb_buffered } ZSTD_buffered_policy_e;
|
typedef enum { ZSTDb_not_buffered, ZSTDb_buffered } ZSTD_buffered_policy_e;
|
||||||
@ -1317,7 +1317,7 @@ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc,
|
|||||||
/* Adjust long distance matching parameters */
|
/* Adjust long distance matching parameters */
|
||||||
ZSTD_ldm_adjustParameters(¶ms.ldmParams, ¶ms.cParams);
|
ZSTD_ldm_adjustParameters(¶ms.ldmParams, ¶ms.cParams);
|
||||||
assert(params.ldmParams.hashLog >= params.ldmParams.bucketSizeLog);
|
assert(params.ldmParams.hashLog >= params.ldmParams.bucketSizeLog);
|
||||||
assert(params.ldmParams.hashEveryLog < 32);
|
assert(params.ldmParams.hashRateLog < 32);
|
||||||
zc->ldmState.hashPower = ZSTD_rollingHash_primePower(params.ldmParams.minMatchLength);
|
zc->ldmState.hashPower = ZSTD_rollingHash_primePower(params.ldmParams.minMatchLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ typedef struct {
|
|||||||
U32 hashLog; /* Log size of hashTable */
|
U32 hashLog; /* Log size of hashTable */
|
||||||
U32 bucketSizeLog; /* Log bucket size for collision resolution, at most 8 */
|
U32 bucketSizeLog; /* Log bucket size for collision resolution, at most 8 */
|
||||||
U32 minMatchLength; /* Minimum match length */
|
U32 minMatchLength; /* Minimum match length */
|
||||||
U32 hashEveryLog; /* Log number of entries to skip */
|
U32 hashRateLog; /* Log number of entries to skip */
|
||||||
U32 windowLog; /* Window log for the LDM */
|
U32 windowLog; /* Window log for the LDM */
|
||||||
} ldmParams_t;
|
} ldmParams_t;
|
||||||
|
|
||||||
|
@ -37,8 +37,8 @@ void ZSTD_ldm_adjustParameters(ldmParams_t* params,
|
|||||||
params->hashLog = MAX(ZSTD_HASHLOG_MIN, params->windowLog - LDM_HASH_RLOG);
|
params->hashLog = MAX(ZSTD_HASHLOG_MIN, params->windowLog - LDM_HASH_RLOG);
|
||||||
assert(params->hashLog <= ZSTD_HASHLOG_MAX);
|
assert(params->hashLog <= ZSTD_HASHLOG_MAX);
|
||||||
}
|
}
|
||||||
if (params->hashEveryLog == 0) {
|
if (params->hashRateLog == 0) {
|
||||||
params->hashEveryLog = params->windowLog < params->hashLog
|
params->hashRateLog = params->windowLog < params->hashLog
|
||||||
? 0
|
? 0
|
||||||
: params->windowLog - params->hashLog;
|
: params->windowLog - params->hashLog;
|
||||||
}
|
}
|
||||||
@ -119,20 +119,20 @@ static void ZSTD_ldm_insertEntry(ldmState_t* ldmState,
|
|||||||
*
|
*
|
||||||
* Gets the small hash, checksum, and tag from the rollingHash.
|
* Gets the small hash, checksum, and tag from the rollingHash.
|
||||||
*
|
*
|
||||||
* If the tag matches (1 << ldmParams.hashEveryLog)-1, then
|
* If the tag matches (1 << ldmParams.hashRateLog)-1, then
|
||||||
* creates an ldmEntry from the offset, and inserts it into the hash table.
|
* creates an ldmEntry from the offset, and inserts it into the hash table.
|
||||||
*
|
*
|
||||||
* hBits is the length of the small hash, which is the most significant hBits
|
* hBits is the length of the small hash, which is the most significant hBits
|
||||||
* of rollingHash. The checksum is the next 32 most significant bits, followed
|
* of rollingHash. The checksum is the next 32 most significant bits, followed
|
||||||
* by ldmParams.hashEveryLog bits that make up the tag. */
|
* by ldmParams.hashRateLog bits that make up the tag. */
|
||||||
static void ZSTD_ldm_makeEntryAndInsertByTag(ldmState_t* ldmState,
|
static void ZSTD_ldm_makeEntryAndInsertByTag(ldmState_t* ldmState,
|
||||||
U64 const rollingHash,
|
U64 const rollingHash,
|
||||||
U32 const hBits,
|
U32 const hBits,
|
||||||
U32 const offset,
|
U32 const offset,
|
||||||
ldmParams_t const ldmParams)
|
ldmParams_t const ldmParams)
|
||||||
{
|
{
|
||||||
U32 const tag = ZSTD_ldm_getTag(rollingHash, hBits, ldmParams.hashEveryLog);
|
U32 const tag = ZSTD_ldm_getTag(rollingHash, hBits, ldmParams.hashRateLog);
|
||||||
U32 const tagMask = ((U32)1 << ldmParams.hashEveryLog) - 1;
|
U32 const tagMask = ((U32)1 << ldmParams.hashRateLog) - 1;
|
||||||
if (tag == tagMask) {
|
if (tag == tagMask) {
|
||||||
U32 const hash = ZSTD_ldm_getSmallHash(rollingHash, hBits);
|
U32 const hash = ZSTD_ldm_getSmallHash(rollingHash, hBits);
|
||||||
U32 const checksum = ZSTD_ldm_getChecksum(rollingHash, hBits);
|
U32 const checksum = ZSTD_ldm_getChecksum(rollingHash, hBits);
|
||||||
@ -247,8 +247,8 @@ static size_t ZSTD_ldm_generateSequences_internal(
|
|||||||
U64 const hashPower = ldmState->hashPower;
|
U64 const hashPower = ldmState->hashPower;
|
||||||
U32 const hBits = params->hashLog - params->bucketSizeLog;
|
U32 const hBits = params->hashLog - params->bucketSizeLog;
|
||||||
U32 const ldmBucketSize = 1U << params->bucketSizeLog;
|
U32 const ldmBucketSize = 1U << params->bucketSizeLog;
|
||||||
U32 const hashEveryLog = params->hashEveryLog;
|
U32 const hashRateLog = params->hashRateLog;
|
||||||
U32 const ldmTagMask = (1U << params->hashEveryLog) - 1;
|
U32 const ldmTagMask = (1U << params->hashRateLog) - 1;
|
||||||
/* Prefix and extDict parameters */
|
/* Prefix and extDict parameters */
|
||||||
U32 const dictLimit = ldmState->window.dictLimit;
|
U32 const dictLimit = ldmState->window.dictLimit;
|
||||||
U32 const lowestIndex = extDict ? ldmState->window.lowLimit : dictLimit;
|
U32 const lowestIndex = extDict ? ldmState->window.lowLimit : dictLimit;
|
||||||
@ -283,7 +283,7 @@ static size_t ZSTD_ldm_generateSequences_internal(
|
|||||||
lastHashed = ip;
|
lastHashed = ip;
|
||||||
|
|
||||||
/* Do not insert and do not look for a match */
|
/* Do not insert and do not look for a match */
|
||||||
if (ZSTD_ldm_getTag(rollingHash, hBits, hashEveryLog) != ldmTagMask) {
|
if (ZSTD_ldm_getTag(rollingHash, hBits, hashRateLog) != ldmTagMask) {
|
||||||
ip++;
|
ip++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ size_t ZSTD_ldm_getTableSize(ldmParams_t params);
|
|||||||
size_t ZSTD_ldm_getMaxNbSeq(ldmParams_t params, size_t maxChunkSize);
|
size_t ZSTD_ldm_getMaxNbSeq(ldmParams_t params, size_t maxChunkSize);
|
||||||
|
|
||||||
/** ZSTD_ldm_adjustParameters() :
|
/** ZSTD_ldm_adjustParameters() :
|
||||||
* If the params->hashEveryLog is not set, set it to its default value based on
|
* If the params->hashRateLog is not set, set it to its default value based on
|
||||||
* windowLog and params->hashLog.
|
* windowLog and params->hashLog.
|
||||||
*
|
*
|
||||||
* Ensures that params->bucketSizeLog is <= params->hashLog (setting it to
|
* Ensures that params->bucketSizeLog is <= params->hashLog (setting it to
|
||||||
|
@ -467,7 +467,7 @@ static int ZSTDMT_serialState_reset(serialState_t* serialState, ZSTDMT_seqPool*
|
|||||||
DEBUGLOG(4, "LDM window size = %u KB", (1U << params.cParams.windowLog) >> 10);
|
DEBUGLOG(4, "LDM window size = %u KB", (1U << params.cParams.windowLog) >> 10);
|
||||||
ZSTD_ldm_adjustParameters(¶ms.ldmParams, ¶ms.cParams);
|
ZSTD_ldm_adjustParameters(¶ms.ldmParams, ¶ms.cParams);
|
||||||
assert(params.ldmParams.hashLog >= params.ldmParams.bucketSizeLog);
|
assert(params.ldmParams.hashLog >= params.ldmParams.bucketSizeLog);
|
||||||
assert(params.ldmParams.hashEveryLog < 32);
|
assert(params.ldmParams.hashRateLog < 32);
|
||||||
serialState->ldmState.hashPower =
|
serialState->ldmState.hashPower =
|
||||||
ZSTD_rollingHash_primePower(params.ldmParams.minMatchLength);
|
ZSTD_rollingHash_primePower(params.ldmParams.minMatchLength);
|
||||||
} else {
|
} else {
|
||||||
|
@ -555,12 +555,12 @@ typedef enum {
|
|||||||
* Larger values improve collision resolution but decrease compression speed.
|
* Larger values improve collision resolution but decrease compression speed.
|
||||||
* The maximum value is ZSTD_LDM_BUCKETSIZELOG_MAX.
|
* The maximum value is ZSTD_LDM_BUCKETSIZELOG_MAX.
|
||||||
* Special: value 0 means "use default value" (default: 3). */
|
* Special: value 0 means "use default value" (default: 3). */
|
||||||
ZSTD_p_ldmHashEveryLog=164, /* Frequency of inserting/looking up entries into the LDM hash table.
|
ZSTD_p_ldmHashRateLog=164, /* Frequency of inserting/looking up entries into the LDM hash table.
|
||||||
* Must be clamped between 0 and (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN).
|
* Must be clamped between 0 and (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN).
|
||||||
* Default is MAX(0, (windowLog - ldmHashLog)), optimizing hash table usage.
|
* Default is MAX(0, (windowLog - ldmHashLog)), optimizing hash table usage.
|
||||||
* Larger values improve compression speed.
|
* Larger values improve compression speed.
|
||||||
* Deviating far from default value will likely result in a compression ratio decrease.
|
* Deviating far from default value will likely result in a compression ratio decrease.
|
||||||
* Special: value 0 means "automatically determine hashEveryLog". */
|
* Special: value 0 means "automatically determine hashRateLog". */
|
||||||
|
|
||||||
/* frame parameters */
|
/* frame parameters */
|
||||||
ZSTD_p_contentSizeFlag=200, /* Content size will be written into frame header _whenever known_ (default:1)
|
ZSTD_p_contentSizeFlag=200, /* Content size will be written into frame header _whenever known_ (default:1)
|
||||||
@ -926,8 +926,8 @@ ZSTDLIB_API size_t ZSTD_decompress_generic(ZSTD_DCtx* dctx,
|
|||||||
#define ZSTD_LDM_MINMATCH_MAX 4096
|
#define ZSTD_LDM_MINMATCH_MAX 4096
|
||||||
#define ZSTD_LDM_BUCKETSIZELOG_MIN 1
|
#define ZSTD_LDM_BUCKETSIZELOG_MIN 1
|
||||||
#define ZSTD_LDM_BUCKETSIZELOG_MAX 8
|
#define ZSTD_LDM_BUCKETSIZELOG_MAX 8
|
||||||
#define ZSTD_LDM_HASHEVERYLOG_MIN 0
|
#define ZSTD_LDM_HASHRATELOG_MIN 0
|
||||||
#define ZSTD_LDM_HASHEVERYLOG_MAX (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN)
|
#define ZSTD_LDM_HASHRATELOG_MAX (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN)
|
||||||
|
|
||||||
/* internal */
|
/* internal */
|
||||||
#define ZSTD_HASHLOG3_MAX 17
|
#define ZSTD_HASHLOG3_MAX 17
|
||||||
|
@ -133,7 +133,7 @@ BMK_advancedParams_t BMK_initAdvancedParams(void) {
|
|||||||
0, /* ldmMinMatch */
|
0, /* ldmMinMatch */
|
||||||
0, /* ldmHashLog */
|
0, /* ldmHashLog */
|
||||||
0, /* ldmBuckSizeLog */
|
0, /* ldmBuckSizeLog */
|
||||||
0 /* ldmHashEveryLog */
|
0 /* ldmHashRateLog */
|
||||||
};
|
};
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -171,7 +171,7 @@ static void BMK_initCCtx(ZSTD_CCtx* ctx,
|
|||||||
ZSTD_CCtx_setParameter(ctx, ZSTD_p_ldmMinMatch, adv->ldmMinMatch);
|
ZSTD_CCtx_setParameter(ctx, ZSTD_p_ldmMinMatch, adv->ldmMinMatch);
|
||||||
ZSTD_CCtx_setParameter(ctx, ZSTD_p_ldmHashLog, adv->ldmHashLog);
|
ZSTD_CCtx_setParameter(ctx, ZSTD_p_ldmHashLog, adv->ldmHashLog);
|
||||||
ZSTD_CCtx_setParameter(ctx, ZSTD_p_ldmBucketSizeLog, adv->ldmBucketSizeLog);
|
ZSTD_CCtx_setParameter(ctx, ZSTD_p_ldmBucketSizeLog, adv->ldmBucketSizeLog);
|
||||||
ZSTD_CCtx_setParameter(ctx, ZSTD_p_ldmHashEveryLog, adv->ldmHashEveryLog);
|
ZSTD_CCtx_setParameter(ctx, ZSTD_p_ldmHashRateLog, adv->ldmHashRateLog);
|
||||||
ZSTD_CCtx_setParameter(ctx, ZSTD_p_windowLog, comprParams->windowLog);
|
ZSTD_CCtx_setParameter(ctx, ZSTD_p_windowLog, comprParams->windowLog);
|
||||||
ZSTD_CCtx_setParameter(ctx, ZSTD_p_hashLog, comprParams->hashLog);
|
ZSTD_CCtx_setParameter(ctx, ZSTD_p_hashLog, comprParams->hashLog);
|
||||||
ZSTD_CCtx_setParameter(ctx, ZSTD_p_chainLog, comprParams->chainLog);
|
ZSTD_CCtx_setParameter(ctx, ZSTD_p_chainLog, comprParams->chainLog);
|
||||||
|
@ -115,7 +115,7 @@ typedef struct {
|
|||||||
unsigned ldmMinMatch; /* below: parameters for long distance matching, see zstd.1.md */
|
unsigned ldmMinMatch; /* below: parameters for long distance matching, see zstd.1.md */
|
||||||
unsigned ldmHashLog;
|
unsigned ldmHashLog;
|
||||||
unsigned ldmBucketSizeLog;
|
unsigned ldmBucketSizeLog;
|
||||||
unsigned ldmHashEveryLog;
|
unsigned ldmHashRateLog;
|
||||||
} BMK_advancedParams_t;
|
} BMK_advancedParams_t;
|
||||||
|
|
||||||
/* returns default parameters used by nonAdvanced functions */
|
/* returns default parameters used by nonAdvanced functions */
|
||||||
|
@ -346,9 +346,9 @@ void FIO_setLdmBucketSizeLog(unsigned ldmBucketSizeLog) {
|
|||||||
g_ldmBucketSizeLog = ldmBucketSizeLog;
|
g_ldmBucketSizeLog = ldmBucketSizeLog;
|
||||||
}
|
}
|
||||||
|
|
||||||
static U32 g_ldmHashEveryLog = FIO_LDM_PARAM_NOTSET;
|
static U32 g_ldmHashRateLog = FIO_LDM_PARAM_NOTSET;
|
||||||
void FIO_setLdmHashEveryLog(unsigned ldmHashEveryLog) {
|
void FIO_setLdmHashRateLog(unsigned ldmHashRateLog) {
|
||||||
g_ldmHashEveryLog = ldmHashEveryLog;
|
g_ldmHashRateLog = ldmHashRateLog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -541,8 +541,8 @@ static cRess_t FIO_createCResources(const char* dictFileName, int cLevel,
|
|||||||
if (g_ldmBucketSizeLog != FIO_LDM_PARAM_NOTSET) {
|
if (g_ldmBucketSizeLog != FIO_LDM_PARAM_NOTSET) {
|
||||||
CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_ldmBucketSizeLog, g_ldmBucketSizeLog) );
|
CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_ldmBucketSizeLog, g_ldmBucketSizeLog) );
|
||||||
}
|
}
|
||||||
if (g_ldmHashEveryLog != FIO_LDM_PARAM_NOTSET) {
|
if (g_ldmHashRateLog != FIO_LDM_PARAM_NOTSET) {
|
||||||
CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_ldmHashEveryLog, g_ldmHashEveryLog) );
|
CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_ldmHashRateLog, g_ldmHashRateLog) );
|
||||||
}
|
}
|
||||||
/* compression parameters */
|
/* compression parameters */
|
||||||
CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_windowLog, comprParams.windowLog) );
|
CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_p_windowLog, comprParams.windowLog) );
|
||||||
|
@ -56,7 +56,7 @@ void FIO_setChecksumFlag(unsigned checksumFlag);
|
|||||||
void FIO_setDictIDFlag(unsigned dictIDFlag);
|
void FIO_setDictIDFlag(unsigned dictIDFlag);
|
||||||
void FIO_setLdmBucketSizeLog(unsigned ldmBucketSizeLog);
|
void FIO_setLdmBucketSizeLog(unsigned ldmBucketSizeLog);
|
||||||
void FIO_setLdmFlag(unsigned ldmFlag);
|
void FIO_setLdmFlag(unsigned ldmFlag);
|
||||||
void FIO_setLdmHashEveryLog(unsigned ldmHashEveryLog);
|
void FIO_setLdmHashRateLog(unsigned ldmHashRateLog);
|
||||||
void FIO_setLdmHashLog(unsigned ldmHashLog);
|
void FIO_setLdmHashLog(unsigned ldmHashLog);
|
||||||
void FIO_setLdmMinMatch(unsigned ldmMinMatch);
|
void FIO_setLdmMinMatch(unsigned ldmMinMatch);
|
||||||
void FIO_setMemLimit(unsigned memLimit);
|
void FIO_setMemLimit(unsigned memLimit);
|
||||||
|
@ -431,7 +431,7 @@ Larger bucket sizes improve collision resolution but decrease compression speed\
|
|||||||
The minimum \fIlblog\fR is 0 and the maximum is 8 (default: 3)\.
|
The minimum \fIlblog\fR is 0 and the maximum is 8 (default: 3)\.
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
\fBldmHashEveryLog\fR=\fIlhevery\fR, \fBlhevery\fR=\fIlhevery\fR
|
\fBldmHashRateLog\fR=\fIlhrlog\fR, \fBlhrlog\fR=\fIlhrlog\fR
|
||||||
Specify the frequency of inserting entries into the long distance matching hash table\.
|
Specify the frequency of inserting entries into the long distance matching hash table\.
|
||||||
.
|
.
|
||||||
.IP
|
.IP
|
||||||
|
@ -450,7 +450,7 @@ The list of available _options_:
|
|||||||
|
|
||||||
The minimum _lblog_ is 0 and the maximum is 8 (default: 3).
|
The minimum _lblog_ is 0 and the maximum is 8 (default: 3).
|
||||||
|
|
||||||
- `ldmHashEveryLog`=_lhevery_, `lhevery`=_lhevery_:
|
- `ldmHashRateLog`=_lhrlog_, `lhrlog`=_lhrlog_:
|
||||||
Specify the frequency of inserting entries into the long distance matching
|
Specify the frequency of inserting entries into the long distance matching
|
||||||
hash table.
|
hash table.
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ static const unsigned g_defaultMaxWindowLog = 27;
|
|||||||
static U32 g_overlapLog = OVERLAP_LOG_DEFAULT;
|
static U32 g_overlapLog = OVERLAP_LOG_DEFAULT;
|
||||||
static U32 g_ldmHashLog = 0;
|
static U32 g_ldmHashLog = 0;
|
||||||
static U32 g_ldmMinMatch = 0;
|
static U32 g_ldmMinMatch = 0;
|
||||||
static U32 g_ldmHashEveryLog = LDM_PARAM_DEFAULT;
|
static U32 g_ldmHashRateLog = LDM_PARAM_DEFAULT;
|
||||||
static U32 g_ldmBucketSizeLog = LDM_PARAM_DEFAULT;
|
static U32 g_ldmBucketSizeLog = LDM_PARAM_DEFAULT;
|
||||||
|
|
||||||
|
|
||||||
@ -410,7 +410,7 @@ static unsigned parseCompressionParameters(const char* stringPtr, ZSTD_compressi
|
|||||||
if (longCommandWArg(&stringPtr, "ldmHashLog=") || longCommandWArg(&stringPtr, "lhlog=")) { g_ldmHashLog = readU32FromChar(&stringPtr); if (stringPtr[0]==',') { stringPtr++; continue; } else break; }
|
if (longCommandWArg(&stringPtr, "ldmHashLog=") || longCommandWArg(&stringPtr, "lhlog=")) { g_ldmHashLog = readU32FromChar(&stringPtr); if (stringPtr[0]==',') { stringPtr++; continue; } else break; }
|
||||||
if (longCommandWArg(&stringPtr, "ldmMinMatch=") || longCommandWArg(&stringPtr, "lmml=")) { g_ldmMinMatch = readU32FromChar(&stringPtr); if (stringPtr[0]==',') { stringPtr++; continue; } else break; }
|
if (longCommandWArg(&stringPtr, "ldmMinMatch=") || longCommandWArg(&stringPtr, "lmml=")) { g_ldmMinMatch = readU32FromChar(&stringPtr); if (stringPtr[0]==',') { stringPtr++; continue; } else break; }
|
||||||
if (longCommandWArg(&stringPtr, "ldmBucketSizeLog=") || longCommandWArg(&stringPtr, "lblog=")) { g_ldmBucketSizeLog = readU32FromChar(&stringPtr); if (stringPtr[0]==',') { stringPtr++; continue; } else break; }
|
if (longCommandWArg(&stringPtr, "ldmBucketSizeLog=") || longCommandWArg(&stringPtr, "lblog=")) { g_ldmBucketSizeLog = readU32FromChar(&stringPtr); if (stringPtr[0]==',') { stringPtr++; continue; } else break; }
|
||||||
if (longCommandWArg(&stringPtr, "ldmHashEveryLog=") || longCommandWArg(&stringPtr, "lhevery=")) { g_ldmHashEveryLog = readU32FromChar(&stringPtr); if (stringPtr[0]==',') { stringPtr++; continue; } else break; }
|
if (longCommandWArg(&stringPtr, "ldmHashRateLog=") || longCommandWArg(&stringPtr, "lhrlog=")) { g_ldmHashRateLog = readU32FromChar(&stringPtr); if (stringPtr[0]==',') { stringPtr++; continue; } else break; }
|
||||||
DISPLAYLEVEL(4, "invalid compression parameter \n");
|
DISPLAYLEVEL(4, "invalid compression parameter \n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -940,8 +940,8 @@ int main(int argCount, const char* argv[])
|
|||||||
if (g_ldmBucketSizeLog != LDM_PARAM_DEFAULT) {
|
if (g_ldmBucketSizeLog != LDM_PARAM_DEFAULT) {
|
||||||
benchParams.ldmBucketSizeLog = g_ldmBucketSizeLog;
|
benchParams.ldmBucketSizeLog = g_ldmBucketSizeLog;
|
||||||
}
|
}
|
||||||
if (g_ldmHashEveryLog != LDM_PARAM_DEFAULT) {
|
if (g_ldmHashRateLog != LDM_PARAM_DEFAULT) {
|
||||||
benchParams.ldmHashEveryLog = g_ldmHashEveryLog;
|
benchParams.ldmHashRateLog = g_ldmHashRateLog;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cLevel > ZSTD_maxCLevel()) cLevel = ZSTD_maxCLevel();
|
if (cLevel > ZSTD_maxCLevel()) cLevel = ZSTD_maxCLevel();
|
||||||
@ -1051,7 +1051,7 @@ int main(int argCount, const char* argv[])
|
|||||||
FIO_setLdmHashLog(g_ldmHashLog);
|
FIO_setLdmHashLog(g_ldmHashLog);
|
||||||
FIO_setLdmMinMatch(g_ldmMinMatch);
|
FIO_setLdmMinMatch(g_ldmMinMatch);
|
||||||
if (g_ldmBucketSizeLog != LDM_PARAM_DEFAULT) FIO_setLdmBucketSizeLog(g_ldmBucketSizeLog);
|
if (g_ldmBucketSizeLog != LDM_PARAM_DEFAULT) FIO_setLdmBucketSizeLog(g_ldmBucketSizeLog);
|
||||||
if (g_ldmHashEveryLog != LDM_PARAM_DEFAULT) FIO_setLdmHashEveryLog(g_ldmHashEveryLog);
|
if (g_ldmHashRateLog != LDM_PARAM_DEFAULT) FIO_setLdmHashRateLog(g_ldmHashRateLog);
|
||||||
FIO_setAdaptiveMode(adapt);
|
FIO_setAdaptiveMode(adapt);
|
||||||
FIO_setAdaptMin(adaptMin);
|
FIO_setAdaptMin(adaptMin);
|
||||||
FIO_setAdaptMax(adaptMax);
|
FIO_setAdaptMax(adaptMax);
|
||||||
|
@ -79,6 +79,6 @@ void FUZZ_setRandomParameters(ZSTD_CCtx *cctx, size_t srcSize, uint32_t *state)
|
|||||||
ZSTD_LDM_MINMATCH_MAX, state);
|
ZSTD_LDM_MINMATCH_MAX, state);
|
||||||
setRand(cctx, ZSTD_p_ldmBucketSizeLog, 0, ZSTD_LDM_BUCKETSIZELOG_MAX,
|
setRand(cctx, ZSTD_p_ldmBucketSizeLog, 0, ZSTD_LDM_BUCKETSIZELOG_MAX,
|
||||||
state);
|
state);
|
||||||
setRand(cctx, ZSTD_p_ldmHashEveryLog, 0,
|
setRand(cctx, ZSTD_p_ldmHashRateLog, ZSTD_LDM_HASHRATELOG_MIN,
|
||||||
ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN, state);
|
ZSTD_LDM_HASHRATELOG_MAX, state);
|
||||||
}
|
}
|
||||||
|
@ -242,8 +242,8 @@ roundTripTest -g512K
|
|||||||
roundTripTest -g512K " --zstd=mml=3,tlen=48,strat=6"
|
roundTripTest -g512K " --zstd=mml=3,tlen=48,strat=6"
|
||||||
roundTripTest -g512K " --zstd=strat=6,wlog=23,clog=23,hlog=22,slog=6"
|
roundTripTest -g512K " --zstd=strat=6,wlog=23,clog=23,hlog=22,slog=6"
|
||||||
roundTripTest -g512K " --zstd=windowLog=23,chainLog=23,hashLog=22,searchLog=6,minMatch=3,targetLength=48,strategy=6"
|
roundTripTest -g512K " --zstd=windowLog=23,chainLog=23,hashLog=22,searchLog=6,minMatch=3,targetLength=48,strategy=6"
|
||||||
roundTripTest -g512K " --single-thread --long --zstd=ldmHashLog=20,ldmMinMatch=64,ldmBucketSizeLog=1,ldmHashEveryLog=7"
|
roundTripTest -g512K " --single-thread --long --zstd=ldmHashLog=20,ldmMinMatch=64,ldmBucketSizeLog=1,ldmHashRateLog=7"
|
||||||
roundTripTest -g512K " --single-thread --long --zstd=lhlog=20,lmml=64,lblog=1,lhevery=7"
|
roundTripTest -g512K " --single-thread --long --zstd=lhlog=20,lmml=64,lblog=1,lhrlog=7"
|
||||||
roundTripTest -g512K 19
|
roundTripTest -g512K 19
|
||||||
|
|
||||||
|
|
||||||
|
@ -1878,8 +1878,8 @@ static int fuzzerTests_newAPI(U32 seed, U32 nbTests, unsigned startTest,
|
|||||||
if (FUZ_rand(&lseed) & 1) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_enableLongDistanceMatching, FUZ_rand(&lseed) & 63, opaqueAPI) );
|
if (FUZ_rand(&lseed) & 1) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_enableLongDistanceMatching, FUZ_rand(&lseed) & 63, opaqueAPI) );
|
||||||
if (FUZ_rand(&lseed) & 3) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_ldmHashLog, FUZ_randomClampedLength(&lseed, ZSTD_HASHLOG_MIN, 23), opaqueAPI) );
|
if (FUZ_rand(&lseed) & 3) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_ldmHashLog, FUZ_randomClampedLength(&lseed, ZSTD_HASHLOG_MIN, 23), opaqueAPI) );
|
||||||
if (FUZ_rand(&lseed) & 3) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_ldmMinMatch, FUZ_randomClampedLength(&lseed, ZSTD_LDM_MINMATCH_MIN, ZSTD_LDM_MINMATCH_MAX), opaqueAPI) );
|
if (FUZ_rand(&lseed) & 3) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_ldmMinMatch, FUZ_randomClampedLength(&lseed, ZSTD_LDM_MINMATCH_MIN, ZSTD_LDM_MINMATCH_MAX), opaqueAPI) );
|
||||||
if (FUZ_rand(&lseed) & 3) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_ldmBucketSizeLog, FUZ_randomClampedLength(&lseed, 0, ZSTD_LDM_BUCKETSIZELOG_MAX), opaqueAPI) );
|
if (FUZ_rand(&lseed) & 3) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_ldmBucketSizeLog, FUZ_randomClampedLength(&lseed, ZSTD_LDM_BUCKETSIZELOG_MIN, ZSTD_LDM_BUCKETSIZELOG_MAX), opaqueAPI) );
|
||||||
if (FUZ_rand(&lseed) & 3) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_ldmHashEveryLog, FUZ_randomClampedLength(&lseed, 0, ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN), opaqueAPI) );
|
if (FUZ_rand(&lseed) & 3) CHECK_Z( setCCtxParameter(zc, cctxParams, ZSTD_p_ldmHashRateLog, FUZ_randomClampedLength(&lseed, ZSTD_LDM_HASHRATELOG_MIN, ZSTD_LDM_HASHRATELOG_MAX), opaqueAPI) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* mess with frame parameters */
|
/* mess with frame parameters */
|
||||||
|
Loading…
Reference in New Issue
Block a user