Lines Matching refs:maxSymbolValue

942 …void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tabl…
972 …IC_API unsigned FSE_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue);
980 const unsigned* count, size_t srcSize, unsigned maxSymbolValue);
985 FSE_PUBLIC_API size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog);
993 unsigned maxSymbolValue, unsigned tableLog);
998 FSE_PUBLIC_API FSE_CTable* FSE_createCTable (unsigned maxSymbolValue, unsigned tableLog);
1004 …buildCTable(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tabl…
1077 …uildDTable (FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tabl…
1763 #define FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue) (1 + (1<<(maxTableLog-1)) + ((maxSymbolV… argument
1767 #define FSE_CTABLE_SIZE(maxTableLog, maxSymbolValue) (FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolV… argument
1775 unsigned FSE_optimalTableLog_internal(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue
1782 #define FSE_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) ( FSE_CTABLE_SIZE_U32(maxTableLog, maxSymb… argument
1783 …void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tabl…
1795 size_t FSE_buildCTable_wksp(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue
2247 unsigned maxSymbolValue, unsigned tableLog);
2256 unsigned maxSymbolValue, unsigned tableLog,
2295 #define HUF_CTABLE_SIZE_U32(maxSymbolValue) ((maxSymbolValue)+1) /* Use tables of U32, for prop… argument
2296 #define HUF_CTABLE_SIZE(maxSymbolValue) (HUF_CTABLE_SIZE_U32(maxSymbolValue) * sizeof(U32)) argument
2297 #define HUF_CREATE_STATIC_CTABLE(name, maxSymbolValue) \ argument
2298 U32 name##hb[HUF_CTABLE_SIZE_U32(maxSymbolValue)]; \
2345 unsigned HUF_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue);
2347 size_t HUF_buildCTable (HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue, unsigned …
2348 …able (void* dst, size_t maxDstSize, const HUF_CElt* CTable, unsigned maxSymbolValue, unsigned huff…
2350 …HUF_estimateCompressedSize(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue);
2351 int HUF_validateCTable(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue);
2365 unsigned maxSymbolValue, unsigned tableLog,
2376 const unsigned* count, U32 maxSymbolValue, U32 maxNbBits,
2447 …void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tabl…
2448 …void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tabl…
2457 unsigned maxSymbolValue, unsigned tableLog,
2822 size_t FSE_buildDTable(FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, uns… in FSE_buildDTable() argument
2828 U32 const maxSV1 = maxSymbolValue + 1; in FSE_buildDTable()
2833 if (maxSymbolValue > FSE_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge); in FSE_buildDTable()
3012 unsigned maxSymbolValue = FSE_MAX_SYMBOL_VALUE; in FSE_decompress_wksp() local
3015 …size_t const NCountLength = FSE_readNCount (counting, &maxSymbolValue, &tableLog, istart, cSrcSize… in FSE_decompress_wksp()
3022 CHECK_F( FSE_buildDTable (workSpace, counting, maxSymbolValue, tableLog) ); in FSE_decompress_wksp()
7544 const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, in FSE_buildCTable_wksp() argument
7562 tableU16[-1] = (U16) maxSymbolValue; in FSE_buildCTable_wksp()
7575 for (u=1; u <= maxSymbolValue+1; u++) { in FSE_buildCTable_wksp()
7582 cumul[maxSymbolValue+1] = tableSize+1; in FSE_buildCTable_wksp()
7588 for (symbol=0; symbol<=maxSymbolValue; symbol++) { in FSE_buildCTable_wksp()
7610 for (s=0; s<=maxSymbolValue; s++) { in FSE_buildCTable_wksp()
7636 for (symbol=0; symbol<=maxSymbolValue; symbol++) { in FSE_buildCTable_wksp()
7649 size_t FSE_buildCTable(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, uns… in FSE_buildCTable() argument
7652 …return FSE_buildCTable_wksp(ct, normalizedCounter, maxSymbolValue, tableLog, tableSymbol, sizeof(t… in FSE_buildCTable()
7663 size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog) in FSE_NCountWriteBound() argument
7665 size_t const maxHeaderSize = (((maxSymbolValue+1) * tableLog) >> 3) + 3; in FSE_NCountWriteBound()
7666 return maxSymbolValue ? maxHeaderSize : FSE_NCOUNTBOUND; /* maxSymbolValue==0 ? use default */ in FSE_NCountWriteBound()
7671 const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, in FSE_writeNCount_generic() argument
7684 unsigned const alphabetSize = maxSymbolValue + 1; in FSE_writeNCount_generic()
7766 const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog) in FSE_writeNCount() argument
7771 if (bufferSize < FSE_NCountWriteBound(maxSymbolValue, tableLog)) in FSE_writeNCount()
7772 …return FSE_writeNCount_generic(buffer, bufferSize, normalizedCounter, maxSymbolValue, tableLog, 0); in FSE_writeNCount()
7774 …return FSE_writeNCount_generic(buffer, bufferSize, normalizedCounter, maxSymbolValue, tableLog, 1 … in FSE_writeNCount()
7782 FSE_CTable* FSE_createCTable (unsigned maxSymbolValue, unsigned tableLog) in FSE_createCTable() argument
7786 size = FSE_CTABLE_SIZE_U32 (tableLog, maxSymbolValue) * sizeof(U32); in FSE_createCTable()
7793 static unsigned FSE_minTableLog(size_t srcSize, unsigned maxSymbolValue) in FSE_minTableLog() argument
7796 U32 minBitsSymbols = BIT_highbit32(maxSymbolValue) + 2; in FSE_minTableLog()
7802 unsigned FSE_optimalTableLog_internal(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue in FSE_optimalTableLog_internal() argument
7806 U32 minBits = FSE_minTableLog(srcSize, maxSymbolValue); in FSE_optimalTableLog_internal()
7816 unsigned FSE_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue) in FSE_optimalTableLog() argument
7818 return FSE_optimalTableLog_internal(maxTableLog, srcSize, maxSymbolValue, 2); in FSE_optimalTableLog()
7825 …FSE_normalizeM2(short* norm, U32 tableLog, const unsigned* count, size_t total, U32 maxSymbolValue) in FSE_normalizeM2() argument
7836 for (s=0; s<=maxSymbolValue; s++) { in FSE_normalizeM2()
7864 for (s=0; s<=maxSymbolValue; s++) { in FSE_normalizeM2()
7874 if (distributed == maxSymbolValue+1) { in FSE_normalizeM2()
7879 for (s=0; s<=maxSymbolValue; s++) in FSE_normalizeM2()
7887 for (s=0; ToDistribute > 0; s = (s+1)%(maxSymbolValue+1)) in FSE_normalizeM2()
7896 for (s=0; s<=maxSymbolValue; s++) { in FSE_normalizeM2()
7914 unsigned maxSymbolValue) in FSE_normalizeCount() argument
7920 …if (tableLog < FSE_minTableLog(total, maxSymbolValue)) return ERROR(GENERIC); /* Too small table… in FSE_normalizeCount()
7932 for (s=0; s<=maxSymbolValue; s++) { in FSE_normalizeCount()
7950 …ize_t const errorCode = FSE_normalizeM2(normalizedCounter, tableLog, count, total, maxSymbolValue); in FSE_normalizeCount()
7960 for (s=0; s<=maxSymbolValue; s++) in FSE_normalizeCount()
7962 for (s=0; s<=maxSymbolValue; s++) in FSE_normalizeCount()
7979 const unsigned maxSymbolValue = tableMask; in FSE_buildCTable_raw() local
7991 tableU16[-1] = (U16) maxSymbolValue; in FSE_buildCTable_raw()
7999 for (s=0; s<=maxSymbolValue; s++) { in FSE_buildCTable_raw()
8109 …void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tabl… in FSE_compress_wksp() argument
8118 size_t const CTableSize = FSE_CTABLE_SIZE_U32(tableLog, maxSymbolValue); in FSE_compress_wksp()
8123 if (wkspSize < FSE_WKSP_SIZE_U32(tableLog, maxSymbolValue)) return ERROR(tableLog_tooLarge); in FSE_compress_wksp()
8125 if (!maxSymbolValue) maxSymbolValue = FSE_MAX_SYMBOL_VALUE; in FSE_compress_wksp()
8129 …{ CHECK_V_F(maxCount, HIST_count_wksp(count, &maxSymbolValue, src, srcSize, scratchBuffer, scrat… in FSE_compress_wksp()
8135 tableLog = FSE_optimalTableLog(tableLog, srcSize, maxSymbolValue); in FSE_compress_wksp()
8136 CHECK_F( FSE_normalizeCount(norm, tableLog, count, srcSize, maxSymbolValue) ); in FSE_compress_wksp()
8139 { CHECK_V_F(nc_err, FSE_writeNCount(op, oend-op, norm, maxSymbolValue, tableLog) ); in FSE_compress_wksp()
8144 …CHECK_F( FSE_buildCTable_wksp(CTable, norm, maxSymbolValue, tableLog, scratchBuffer, scratchBuffer… in FSE_compress_wksp()
8161 …* dst, size_t dstCapacity, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tabl… in FSE_compress2() argument
8166 …return FSE_compress_wksp(dst, dstCapacity, src, srcSize, maxSymbolValue, tableLog, &scratchBuffer,… in FSE_compress2()
8211 unsigned maxSymbolValue = *maxSymbolValuePtr; in HIST_count_simple() local
8214 memset(count, 0, (maxSymbolValue+1) * sizeof(*count)); in HIST_count_simple()
8218 assert(*ip <= maxSymbolValue); in HIST_count_simple()
8222 while (!count[maxSymbolValue]) maxSymbolValue--; in HIST_count_simple()
8223 *maxSymbolValuePtr = maxSymbolValue; in HIST_count_simple()
8226 for (s=0; s<=maxSymbolValue; s++) in HIST_count_simple()
8251 unsigned maxSymbolValue = *maxSymbolValuePtr; in HIST_count_parallel_wksp() local
8262 memset(count, 0, maxSymbolValue + 1); in HIST_count_parallel_wksp()
8266 if (!maxSymbolValue) maxSymbolValue = 255; /* 0 == default */ in HIST_count_parallel_wksp()
8299 U32 s; for (s=255; s>maxSymbolValue; s--) { in HIST_count_parallel_wksp()
8305 if (maxSymbolValue > 255) maxSymbolValue = 255; in HIST_count_parallel_wksp()
8306 for (s=0; s<=maxSymbolValue; s++) { in HIST_count_parallel_wksp()
8311 while (!count[maxSymbolValue]) maxSymbolValue--; in HIST_count_parallel_wksp()
8312 *maxSymbolValuePtr = maxSymbolValue; in HIST_count_parallel_wksp()
8410 unsigned HUF_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue) in HUF_optimalTableLog() argument
8412 return FSE_optimalTableLog_internal(maxTableLog, srcSize, maxSymbolValue, 1); in HUF_optimalTableLog()
8431 unsigned maxSymbolValue = HUF_TABLELOG_MAX; in HUF_compressWeights() local
8444 …{ unsigned const maxCount = HIST_count_simple(count, &maxSymbolValue, weightTable, wtSize); /*… in HUF_compressWeights()
8449 tableLog = FSE_optimalTableLog(tableLog, wtSize, maxSymbolValue); in HUF_compressWeights()
8450 CHECK_F( FSE_normalizeCount(norm, tableLog, count, wtSize, maxSymbolValue) ); in HUF_compressWeights()
8453 { CHECK_V_F(hSize, FSE_writeNCount(op, (size_t)(oend-op), norm, maxSymbolValue, tableLog) ); in HUF_compressWeights()
8458 …CHECK_F( FSE_buildCTable_wksp(CTable, norm, maxSymbolValue, tableLog, scratchBuffer, sizeof(scratc… in HUF_compressWeights()
8477 const HUF_CElt* CTable, unsigned maxSymbolValue, unsigned huffLog) in HUF_writeCTable() argument
8485 if (maxSymbolValue > HUF_SYMBOLVALUE_MAX) return ERROR(maxSymbolValue_tooLarge); in HUF_writeCTable()
8491 for (n=0; n<maxSymbolValue; n++) in HUF_writeCTable()
8495 { CHECK_V_F(hSize, HUF_compressWeights(op+1, maxDstSize-1, huffWeight, maxSymbolValue) ); in HUF_writeCTable()
8496 if ((hSize>1) & (hSize < maxSymbolValue/2)) { /* FSE compressed */ in HUF_writeCTable()
8502 …if (maxSymbolValue > (256-128)) return ERROR(GENERIC); /* should not happen : likely means sourc… in HUF_writeCTable()
8503 …if (((maxSymbolValue+1)/2) + 1 > maxDstSize) return ERROR(dstSize_tooSmall); /* not enough space… in HUF_writeCTable()
8504 op[0] = (BYTE)(128 /*special case*/ + (maxSymbolValue-1)); in HUF_writeCTable()
8505 …huffWeight[maxSymbolValue] = 0; /* to be sure it doesn't cause msan issue in final combination */ in HUF_writeCTable()
8506 for (n=0; n<maxSymbolValue; n+=2) in HUF_writeCTable()
8508 return ((maxSymbolValue+1)/2) + 1; in HUF_writeCTable()
8669 static void HUF_sort(nodeElt* huffNode, const unsigned* count, U32 maxSymbolValue, rankPos* rankPos… in HUF_sort() argument
8674 for (n=0; n<=maxSymbolValue; n++) { in HUF_sort()
8680 for (n=0; n<=maxSymbolValue; n++) { in HUF_sort()
8700 size_t HUF_buildCTable_wksp (HUF_CElt* tree, const unsigned* count, U32 maxSymbolValue, U32 maxNbBi… in HUF_buildCTable_wksp() argument
8715 if (maxSymbolValue > HUF_SYMBOLVALUE_MAX) in HUF_buildCTable_wksp()
8720 HUF_sort(huffNode, count, maxSymbolValue, wksp_tables->rankPosition); in HUF_buildCTable_wksp()
8723 nonNullRank = (int)maxSymbolValue; in HUF_buildCTable_wksp()
8754 int const alphabetSize = (int)(maxSymbolValue + 1); in HUF_buildCTable_wksp()
8778 size_t HUF_buildCTable (HUF_CElt* tree, const unsigned* count, unsigned maxSymbolValue, unsigned ma… in HUF_buildCTable() argument
8781 …return HUF_buildCTable_wksp(tree, count, maxSymbolValue, maxNbBits, &workspace, sizeof(workspace)); in HUF_buildCTable()
8784 … HUF_estimateCompressedSize(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue) in HUF_estimateCompressedSize() argument
8788 for (s = 0; s <= (int)maxSymbolValue; ++s) { in HUF_estimateCompressedSize()
8794 int HUF_validateCTable(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue) { in HUF_validateCTable() argument
8797 for (s = 0; s <= (int)maxSymbolValue; ++s) { in HUF_validateCTable()
9002 unsigned maxSymbolValue, unsigned huffLog, in HUF_compress_internal() argument
9022 if (maxSymbolValue > HUF_SYMBOLVALUE_MAX) return ERROR(maxSymbolValue_tooLarge); in HUF_compress_internal()
9023 if (!maxSymbolValue) maxSymbolValue = HUF_SYMBOLVALUE_MAX; in HUF_compress_internal()
9034 …{ CHECK_V_F(largest, HIST_count_wksp (table->count, &maxSymbolValue, (const BYTE*)src, srcSize, … in HUF_compress_internal()
9042 && !HUF_validateCTable(oldHufTable, table->count, maxSymbolValue)) { in HUF_compress_internal()
9053 huffLog = HUF_optimalTableLog(huffLog, srcSize, maxSymbolValue); in HUF_compress_internal()
9055 maxSymbolValue, huffLog, in HUF_compress_internal()
9060 memset(table->CTable + (maxSymbolValue + 1), 0, in HUF_compress_internal()
9061 sizeof(table->CTable) - ((maxSymbolValue + 1) * sizeof(HUF_CElt))); in HUF_compress_internal()
9065 { CHECK_V_F(hSize, HUF_writeCTable (op, dstSize, table->CTable, maxSymbolValue, huffLog) ); in HUF_compress_internal()
9068 … size_t const oldSize = HUF_estimateCompressedSize(oldHufTable, table->count, maxSymbolValue); in HUF_compress_internal()
9069 … size_t const newSize = HUF_estimateCompressedSize(table->CTable, table->count, maxSymbolValue); in HUF_compress_internal()
9091 unsigned maxSymbolValue, unsigned huffLog, in HUF_compress1X_wksp() argument
9095 maxSymbolValue, huffLog, HUF_singleStream, in HUF_compress1X_wksp()
9102 unsigned maxSymbolValue, unsigned huffLog, in HUF_compress1X_repeat() argument
9107 maxSymbolValue, huffLog, HUF_singleStream, in HUF_compress1X_repeat()
9114 unsigned maxSymbolValue, unsigned huffLog) in HUF_compress1X() argument
9117 …return HUF_compress1X_wksp(dst, dstSize, src, srcSize, maxSymbolValue, huffLog, workSpace, sizeof(… in HUF_compress1X()
9125 unsigned maxSymbolValue, unsigned huffLog, in HUF_compress4X_wksp() argument
9129 maxSymbolValue, huffLog, HUF_fourStreams, in HUF_compress4X_wksp()
9139 unsigned maxSymbolValue, unsigned huffLog, in HUF_compress4X_repeat() argument
9144 maxSymbolValue, huffLog, HUF_fourStreams, in HUF_compress4X_repeat()
9151 unsigned maxSymbolValue, unsigned huffLog) in HUF_compress2() argument
9154 …return HUF_compress4X_wksp(dst, dstSize, src, srcSize, maxSymbolValue, huffLog, workSpace, sizeof(… in HUF_compress2()
11301 U32 const maxSymbolValue = MEM_read16(u16ptr + 1); in ZSTD_getFSEMaxSymbolValue() local
11302 return maxSymbolValue; in ZSTD_getFSEMaxSymbolValue()
11781 unsigned maxSymbolValue = 255; in ZSTD_buildSuperBlockEntropy_literal() local
11807 …{ size_t const largest = HIST_count_wksp (countWksp, &maxSymbolValue, (const BYTE*)src, srcSize,… in ZSTD_buildSuperBlockEntropy_literal()
11822 …repeat_check && !HUF_validateCTable((HUF_CElt const*)prevHuf->CTable, countWksp, maxSymbolValue)) { in ZSTD_buildSuperBlockEntropy_literal()
11828 huffLog = HUF_optimalTableLog(huffLog, srcSize, maxSymbolValue); in ZSTD_buildSuperBlockEntropy_literal()
11830 maxSymbolValue, huffLog, in ZSTD_buildSuperBlockEntropy_literal()
11836 (HUF_CElt*)nextHuf->CTable, countWksp, maxSymbolValue); in ZSTD_buildSuperBlockEntropy_literal()
11839 (HUF_CElt*)nextHuf->CTable, maxSymbolValue, huffLog); in ZSTD_buildSuperBlockEntropy_literal()
11843 (HUF_CElt const*)prevHuf->CTable, countWksp, maxSymbolValue); in ZSTD_buildSuperBlockEntropy_literal()
12292 unsigned maxSymbolValue = 255; in ZSTD_estimateSubBlockSize_literal() local
12298 …size_t const largest = HIST_count_wksp (countWksp, &maxSymbolValue, (const BYTE*)literals, litSize… in ZSTD_estimateSubBlockSize_literal()
12300 …SizeEstimate = HUF_estimateCompressedSize((const HUF_CElt*)huf->CTable, countWksp, maxSymbolValue); in ZSTD_estimateSubBlockSize_literal()
15975 …D_checkDictNCount(short* normalizedCounter, unsigned dictMaxSymbolValue, unsigned maxSymbolValue) { in ZSTD_checkDictNCount() argument
15977 …RETURN_ERROR_IF(dictMaxSymbolValue < maxSymbolValue, dictionary_corrupted, "dict fse tables don't … in ZSTD_checkDictNCount()
15978 for (s = 0; s <= maxSymbolValue; ++s) { in ZSTD_checkDictNCount()
15993 { unsigned maxSymbolValue = 255; in ZSTD_loadCEntropy() local
15995 …t const hufHeaderSize = HUF_readCTable((HUF_CElt*)bs->entropy.huf.CTable, &maxSymbolValue, dictPtr, in ZSTD_loadCEntropy()
16004 RETURN_ERROR_IF(maxSymbolValue < 255, dictionary_corrupted, ""); in ZSTD_loadCEntropy()
24566 const short* normalizedCounter, unsigned maxSymbolValue,
26760 const short* normalizedCounter, unsigned maxSymbolValue, in ZSTD_buildFSETable() argument
26767 U32 const maxSV1 = maxSymbolValue + 1; in ZSTD_buildFSETable()
26772 assert(maxSymbolValue <= MaxSeq); in ZSTD_buildFSETable()