mirror of
https://github.com/facebook/zstd.git
synced 2025-11-22 00:10:22 -05:00
use ZSTD_CLEVEL_DEFAULT in zdict.c
This commit is contained in:
parent
6672689e7e
commit
1aec77ea89
@ -62,7 +62,6 @@
|
|||||||
|
|
||||||
#define NOISELENGTH 32
|
#define NOISELENGTH 32
|
||||||
|
|
||||||
static const int g_compressionLevel_default = 3;
|
|
||||||
static const U32 g_selectivity_default = 9;
|
static const U32 g_selectivity_default = 9;
|
||||||
|
|
||||||
|
|
||||||
@ -706,7 +705,7 @@ static void ZDICT_flatLit(unsigned* countLit)
|
|||||||
|
|
||||||
#define OFFCODE_MAX 30 /* only applicable to first block */
|
#define OFFCODE_MAX 30 /* only applicable to first block */
|
||||||
static size_t ZDICT_analyzeEntropy(void* dstBuffer, size_t maxDstSize,
|
static size_t ZDICT_analyzeEntropy(void* dstBuffer, size_t maxDstSize,
|
||||||
unsigned compressionLevel,
|
int compressionLevel,
|
||||||
const void* srcBuffer, const size_t* fileSizes, unsigned nbFiles,
|
const void* srcBuffer, const size_t* fileSizes, unsigned nbFiles,
|
||||||
const void* dictBuffer, size_t dictBufferSize,
|
const void* dictBuffer, size_t dictBufferSize,
|
||||||
unsigned notificationLevel)
|
unsigned notificationLevel)
|
||||||
@ -741,7 +740,7 @@ static size_t ZDICT_analyzeEntropy(void* dstBuffer, size_t maxDstSize,
|
|||||||
memset(repOffset, 0, sizeof(repOffset));
|
memset(repOffset, 0, sizeof(repOffset));
|
||||||
repOffset[1] = repOffset[4] = repOffset[8] = 1;
|
repOffset[1] = repOffset[4] = repOffset[8] = 1;
|
||||||
memset(bestRepOffset, 0, sizeof(bestRepOffset));
|
memset(bestRepOffset, 0, sizeof(bestRepOffset));
|
||||||
if (compressionLevel==0) compressionLevel = g_compressionLevel_default;
|
if (compressionLevel==0) compressionLevel = ZSTD_CLEVEL_DEFAULT;
|
||||||
params = ZSTD_getParams(compressionLevel, averageSampleSize, dictBufferSize);
|
params = ZSTD_getParams(compressionLevel, averageSampleSize, dictBufferSize);
|
||||||
|
|
||||||
esr.dict = ZSTD_createCDict_advanced(dictBuffer, dictBufferSize, ZSTD_dlm_byRef, ZSTD_dct_rawContent, params.cParams, ZSTD_defaultCMem);
|
esr.dict = ZSTD_createCDict_advanced(dictBuffer, dictBufferSize, ZSTD_dlm_byRef, ZSTD_dct_rawContent, params.cParams, ZSTD_defaultCMem);
|
||||||
@ -893,7 +892,7 @@ size_t ZDICT_finalizeDictionary(void* dictBuffer, size_t dictBufferCapacity,
|
|||||||
size_t hSize;
|
size_t hSize;
|
||||||
#define HBUFFSIZE 256 /* should prove large enough for all entropy headers */
|
#define HBUFFSIZE 256 /* should prove large enough for all entropy headers */
|
||||||
BYTE header[HBUFFSIZE];
|
BYTE header[HBUFFSIZE];
|
||||||
int const compressionLevel = (params.compressionLevel == 0) ? g_compressionLevel_default : params.compressionLevel;
|
int const compressionLevel = (params.compressionLevel == 0) ? ZSTD_CLEVEL_DEFAULT : params.compressionLevel;
|
||||||
U32 const notificationLevel = params.notificationLevel;
|
U32 const notificationLevel = params.notificationLevel;
|
||||||
|
|
||||||
/* check conditions */
|
/* check conditions */
|
||||||
@ -939,7 +938,7 @@ static size_t ZDICT_addEntropyTablesFromBuffer_advanced(
|
|||||||
const void* samplesBuffer, const size_t* samplesSizes, unsigned nbSamples,
|
const void* samplesBuffer, const size_t* samplesSizes, unsigned nbSamples,
|
||||||
ZDICT_params_t params)
|
ZDICT_params_t params)
|
||||||
{
|
{
|
||||||
int const compressionLevel = (params.compressionLevel == 0) ? g_compressionLevel_default : params.compressionLevel;
|
int const compressionLevel = (params.compressionLevel == 0) ? ZSTD_CLEVEL_DEFAULT : params.compressionLevel;
|
||||||
U32 const notificationLevel = params.notificationLevel;
|
U32 const notificationLevel = params.notificationLevel;
|
||||||
size_t hSize = 8;
|
size_t hSize = 8;
|
||||||
|
|
||||||
@ -1114,8 +1113,8 @@ size_t ZDICT_trainFromBuffer(void* dictBuffer, size_t dictBufferCapacity,
|
|||||||
memset(¶ms, 0, sizeof(params));
|
memset(¶ms, 0, sizeof(params));
|
||||||
params.d = 8;
|
params.d = 8;
|
||||||
params.steps = 4;
|
params.steps = 4;
|
||||||
/* Default to level 6 since no compression level information is available */
|
/* Use default level since no compression level information is available */
|
||||||
params.zParams.compressionLevel = 3;
|
params.zParams.compressionLevel = ZSTD_CLEVEL_DEFAULT;
|
||||||
#if defined(DEBUGLEVEL) && (DEBUGLEVEL>=1)
|
#if defined(DEBUGLEVEL) && (DEBUGLEVEL>=1)
|
||||||
params.zParams.notificationLevel = DEBUGLEVEL;
|
params.zParams.notificationLevel = DEBUGLEVEL;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user