Lines Matching defs:maxSymbolValue

48 unsigned HUF_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue)
50 return FSE_optimalTableLog_internal(maxTableLog, srcSize, maxSymbolValue, 1);
69 unsigned maxSymbolValue = HUF_TABLELOG_MAX;
82 { unsigned const maxCount = HIST_count_simple(count, &maxSymbolValue, weightTable, wtSize); /* never fails */
87 tableLog = FSE_optimalTableLog(tableLog, wtSize, maxSymbolValue);
88 CHECK_F( FSE_normalizeCount(norm, tableLog, count, wtSize, maxSymbolValue) );
91 { CHECK_V_F(hSize, FSE_writeNCount(op, (size_t)(oend-op), norm, maxSymbolValue, tableLog) );
96 CHECK_F( FSE_buildCTable_wksp(CTable, norm, maxSymbolValue, tableLog, scratchBuffer, sizeof(scratchBuffer)) );
115 const HUF_CElt* CTable, unsigned maxSymbolValue, unsigned huffLog)
123 if (maxSymbolValue > HUF_SYMBOLVALUE_MAX) return ERROR(maxSymbolValue_tooLarge);
129 for (n=0; n<maxSymbolValue; n++)
133 { CHECK_V_F(hSize, HUF_compressWeights(op+1, maxDstSize-1, huffWeight, maxSymbolValue) );
134 if ((hSize>1) & (hSize < maxSymbolValue/2)) { /* FSE compressed */
140 if (maxSymbolValue > (256-128)) return ERROR(GENERIC); /* should not happen : likely means source cannot be compressed */
141 if (((maxSymbolValue+1)/2) + 1 > maxDstSize) return ERROR(dstSize_tooSmall); /* not enough space within dst buffer */
142 op[0] = (BYTE)(128 /*special case*/ + (maxSymbolValue-1));
143 huffWeight[maxSymbolValue] = 0; /* to be sure it doesn't cause msan issue in final combination */
144 for (n=0; n<maxSymbolValue; n+=2)
146 return ((maxSymbolValue+1)/2) + 1;
307 static void HUF_sort(nodeElt* huffNode, const unsigned* count, U32 maxSymbolValue, rankPos* rankPosition)
312 for (n=0; n<=maxSymbolValue; n++) {
318 for (n=0; n<=maxSymbolValue; n++) {
338 size_t HUF_buildCTable_wksp (HUF_CElt* tree, const unsigned* count, U32 maxSymbolValue, U32 maxNbBits, void* workSpace, size_t wkspSize)
353 if (maxSymbolValue > HUF_SYMBOLVALUE_MAX)
358 HUF_sort(huffNode, count, maxSymbolValue, wksp_tables->rankPosition);
361 nonNullRank = (int)maxSymbolValue;
392 int const alphabetSize = (int)(maxSymbolValue + 1);
416 size_t HUF_buildCTable (HUF_CElt* tree, const unsigned* count, unsigned maxSymbolValue, unsigned maxNbBits)
419 return HUF_buildCTable_wksp(tree, count, maxSymbolValue, maxNbBits, &workspace, sizeof(workspace));
422 size_t HUF_estimateCompressedSize(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue)
426 for (s = 0; s <= (int)maxSymbolValue; ++s) {
432 int HUF_validateCTable(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue) {
435 for (s = 0; s <= (int)maxSymbolValue; ++s) {
640 unsigned maxSymbolValue, unsigned huffLog,
660 if (maxSymbolValue > HUF_SYMBOLVALUE_MAX) return ERROR(maxSymbolValue_tooLarge);
661 if (!maxSymbolValue) maxSymbolValue = HUF_SYMBOLVALUE_MAX;
672 { CHECK_V_F(largest, HIST_count_wksp (table->count, &maxSymbolValue, (const BYTE*)src, srcSize, workSpace, wkspSize) );
680 && !HUF_validateCTable(oldHufTable, table->count, maxSymbolValue)) {
691 huffLog = HUF_optimalTableLog(huffLog, srcSize, maxSymbolValue);
693 maxSymbolValue, huffLog,
698 memset(table->CTable + (maxSymbolValue + 1), 0,
699 sizeof(table->CTable) - ((maxSymbolValue + 1) * sizeof(HUF_CElt)));
703 { CHECK_V_F(hSize, HUF_writeCTable (op, dstSize, table->CTable, maxSymbolValue, huffLog) );
706 size_t const oldSize = HUF_estimateCompressedSize(oldHufTable, table->count, maxSymbolValue);
707 size_t const newSize = HUF_estimateCompressedSize(table->CTable, table->count, maxSymbolValue);
729 unsigned maxSymbolValue, unsigned huffLog,
733 maxSymbolValue, huffLog, HUF_singleStream,
740 unsigned maxSymbolValue, unsigned huffLog,
745 maxSymbolValue, huffLog, HUF_singleStream,
752 unsigned maxSymbolValue, unsigned huffLog)
755 return HUF_compress1X_wksp(dst, dstSize, src, srcSize, maxSymbolValue, huffLog, workSpace, sizeof(workSpace));
763 unsigned maxSymbolValue, unsigned huffLog,
767 maxSymbolValue, huffLog, HUF_fourStreams,
777 unsigned maxSymbolValue, unsigned huffLog,
782 maxSymbolValue, huffLog, HUF_fourStreams,
789 unsigned maxSymbolValue, unsigned huffLog)
792 return HUF_compress4X_wksp(dst, dstSize, src, srcSize, maxSymbolValue, huffLog, workSpace, sizeof(workSpace));