[zdict] Make COVER the default algorithm
This commit is contained in:
+9
-9
@@ -639,7 +639,7 @@ static int basicUnitTests(U32 seed, double compressibility)
|
||||
size_t const sampleUnitSize = 8 KB;
|
||||
U32 const nbSamples = (U32)(totalSampleSize / sampleUnitSize);
|
||||
size_t* const samplesSizes = (size_t*) malloc(nbSamples * sizeof(size_t));
|
||||
COVER_params_t params;
|
||||
ZDICT_cover_params_t params;
|
||||
U32 dictID;
|
||||
|
||||
if (dictBuffer==NULL || samplesSizes==NULL) {
|
||||
@@ -648,14 +648,14 @@ static int basicUnitTests(U32 seed, double compressibility)
|
||||
goto _output_error;
|
||||
}
|
||||
|
||||
DISPLAYLEVEL(4, "test%3i : COVER_trainFromBuffer : ", testNb++);
|
||||
DISPLAYLEVEL(4, "test%3i : ZDICT_trainFromBuffer_cover : ", testNb++);
|
||||
{ U32 u; for (u=0; u<nbSamples; u++) samplesSizes[u] = sampleUnitSize; }
|
||||
memset(¶ms, 0, sizeof(params));
|
||||
params.d = 1 + (FUZ_rand(&seed) % 16);
|
||||
params.k = params.d + (FUZ_rand(&seed) % 256);
|
||||
dictSize = COVER_trainFromBuffer(dictBuffer, dictSize,
|
||||
CNBuffer, samplesSizes, nbSamples,
|
||||
params);
|
||||
dictSize = ZDICT_trainFromBuffer_cover(dictBuffer, dictSize,
|
||||
CNBuffer, samplesSizes, nbSamples,
|
||||
params);
|
||||
if (ZDICT_isError(dictSize)) goto _output_error;
|
||||
DISPLAYLEVEL(4, "OK, created dictionary of size %u \n", (U32)dictSize);
|
||||
|
||||
@@ -664,12 +664,12 @@ static int basicUnitTests(U32 seed, double compressibility)
|
||||
if (dictID==0) goto _output_error;
|
||||
DISPLAYLEVEL(4, "OK : %u \n", dictID);
|
||||
|
||||
DISPLAYLEVEL(4, "test%3i : COVER_optimizeTrainFromBuffer : ", testNb++);
|
||||
DISPLAYLEVEL(4, "test%3i : ZDICT_optimizeTrainFromBuffer_cover : ", testNb++);
|
||||
memset(¶ms, 0, sizeof(params));
|
||||
params.steps = 4;
|
||||
optDictSize = COVER_optimizeTrainFromBuffer(dictBuffer, optDictSize,
|
||||
CNBuffer, samplesSizes, nbSamples / 4,
|
||||
¶ms);
|
||||
optDictSize = ZDICT_optimizeTrainFromBuffer_cover(dictBuffer, optDictSize,
|
||||
CNBuffer, samplesSizes,
|
||||
nbSamples / 4, ¶ms);
|
||||
if (ZDICT_isError(optDictSize)) goto _output_error;
|
||||
DISPLAYLEVEL(4, "OK, created dictionary of size %u \n", (U32)optDictSize);
|
||||
|
||||
|
||||
+4
-1
@@ -131,7 +131,10 @@ static const void *symbols[] = {
|
||||
&ZDICT_isError,
|
||||
&ZDICT_getErrorName,
|
||||
/* zdict.h: advanced functions */
|
||||
&ZDICT_trainFromBuffer_advanced,
|
||||
&ZDICT_trainFromBuffer_cover,
|
||||
&ZDICT_optimizeTrainFromBuffer_cover,
|
||||
&ZDICT_finalizeDictionary,
|
||||
&ZDICT_trainFromBuffer_legacy,
|
||||
&ZDICT_addEntropyTablesFromBuffer,
|
||||
NULL,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user