Lines Matching defs:maxSymbolValue

47 unsigned HUF_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue)
49 return FSE_optimalTableLog_internal(maxTableLog, srcSize, maxSymbolValue, 1);
98 unsigned maxSymbolValue = HUF_TABLELOG_MAX;
108 { unsigned const maxCount = HIST_count_simple(wksp->count, &maxSymbolValue, weightTable, wtSize); /* never fails */
113 tableLog = FSE_optimalTableLog(tableLog, wtSize, maxSymbolValue);
114 CHECK_F( FSE_normalizeCount(wksp->norm, tableLog, wksp->count, wtSize, maxSymbolValue, /* useLowProbCount */ 0) );
117 { CHECK_V_F(hSize, FSE_writeNCount(op, (size_t)(oend-op), wksp->norm, maxSymbolValue, tableLog) );
122 CHECK_F( FSE_buildCTable_wksp(wksp->CTable, wksp->norm, maxSymbolValue, tableLog, wksp->scratchBuffer, sizeof(wksp->scratchBuffer)) );
173 const HUF_CElt* CTable, unsigned maxSymbolValue, unsigned huffLog,
183 if (maxSymbolValue > HUF_SYMBOLVALUE_MAX) return ERROR(maxSymbolValue_tooLarge);
189 for (n=0; n<maxSymbolValue; n++)
194 { CHECK_V_F(hSize, HUF_compressWeights(op+1, maxDstSize-1, wksp->huffWeight, maxSymbolValue, &wksp->wksp, sizeof(wksp->wksp)) );
195 if ((hSize>1) & (hSize < maxSymbolValue/2)) { /* FSE compressed */
201 if (maxSymbolValue > (256-128)) return ERROR(GENERIC); /* should not happen : likely means source cannot be compressed */
202 if (((maxSymbolValue+1)/2) + 1 > maxDstSize) return ERROR(dstSize_tooSmall); /* not enough space within dst buffer */
203 op[0] = (BYTE)(128 /*special case*/ + (maxSymbolValue-1));
204 wksp->huffWeight[maxSymbolValue] = 0; /* to be sure it doesn't cause msan issue in final combination */
205 for (n=0; n<maxSymbolValue; n+=2)
207 return ((maxSymbolValue+1)/2) + 1;
214 const HUF_CElt* CTable, unsigned maxSymbolValue, unsigned huffLog)
217 return HUF_writeCTable_wksp(dst, maxDstSize, CTable, maxSymbolValue, huffLog, &wksp, sizeof(wksp));
541 * Sorts the symbols [0, maxSymbolValue] by count[symbol] in decreasing order.
545 * Must have (maxSymbolValue + 1) entries.
547 * @param[in] maxSymbolValue Maximum symbol value.
550 static void HUF_sort(nodeElt huffNode[], const unsigned count[], U32 const maxSymbolValue, rankPos rankPosition[]) {
552 U32 const maxSymbolValue1 = maxSymbolValue+1;
607 * @param maxSymbolValue The maximum symbol value.
610 static int HUF_buildTree(nodeElt* huffNode, U32 maxSymbolValue)
618 nonNullRank = (int)maxSymbolValue;
653 * @param maxSymbolValue The maximum symbol value.
656 static void HUF_buildCTableFromTree(HUF_CElt* CTable, nodeElt const* huffNode, int nonNullRank, U32 maxSymbolValue, U32 maxNbBits)
663 int const alphabetSize = (int)(maxSymbolValue + 1);
680 size_t HUF_buildCTable_wksp (HUF_CElt* CTable, const unsigned* count, U32 maxSymbolValue, U32 maxNbBits, void* workSpace, size_t wkspSize)
691 if (maxSymbolValue > HUF_SYMBOLVALUE_MAX)
696 HUF_sort(huffNode, count, maxSymbolValue, wksp_tables->rankPosition);
699 nonNullRank = HUF_buildTree(huffNode, maxSymbolValue);
705 HUF_buildCTableFromTree(CTable, huffNode, nonNullRank, maxSymbolValue, maxNbBits);
710 size_t HUF_estimateCompressedSize(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue)
715 for (s = 0; s <= (int)maxSymbolValue; ++s) {
721 int HUF_validateCTable(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue) {
725 for (s = 0; s <= (int)maxSymbolValue; ++s) {
1180 unsigned maxSymbolValue, unsigned huffLog,
1199 if (maxSymbolValue > HUF_SYMBOLVALUE_MAX) return ERROR(maxSymbolValue_tooLarge);
1200 if (!maxSymbolValue) maxSymbolValue = HUF_SYMBOLVALUE_MAX;
1214 { unsigned maxSymbolValueBegin = maxSymbolValue;
1218 { unsigned maxSymbolValueEnd = maxSymbolValue;
1226 { CHECK_V_F(largest, HIST_count_wksp (table->count, &maxSymbolValue, (const BYTE*)src, srcSize, table->wksps.hist_wksp, sizeof(table->wksps.hist_wksp)) );
1234 && !HUF_validateCTable(oldHufTable, table->count, maxSymbolValue)) {
1245 huffLog = HUF_optimalTableLog(huffLog, srcSize, maxSymbolValue);
1247 maxSymbolValue, huffLog,
1254 size_t const ctableSize = HUF_CTABLE_SIZE_ST(maxSymbolValue);
1260 { CHECK_V_F(hSize, HUF_writeCTable_wksp(op, dstSize, table->CTable, maxSymbolValue, huffLog,
1264 size_t const oldSize = HUF_estimateCompressedSize(oldHufTable, table->count, maxSymbolValue);
1265 size_t const newSize = HUF_estimateCompressedSize(table->CTable, table->count, maxSymbolValue);
1287 unsigned maxSymbolValue, unsigned huffLog,
1291 maxSymbolValue, huffLog, HUF_singleStream,
1298 unsigned maxSymbolValue, unsigned huffLog,
1304 maxSymbolValue, huffLog, HUF_singleStream,
1314 unsigned maxSymbolValue, unsigned huffLog,
1318 maxSymbolValue, huffLog, HUF_fourStreams,
1329 unsigned maxSymbolValue, unsigned huffLog,
1334 maxSymbolValue, huffLog, HUF_fourStreams,
1344 size_t HUF_buildCTable (HUF_CElt* tree, const unsigned* count, unsigned maxSymbolValue, unsigned maxNbBits)
1347 return HUF_buildCTable_wksp(tree, count, maxSymbolValue, maxNbBits, &workspace, sizeof(workspace));
1352 unsigned maxSymbolValue, unsigned huffLog)
1355 return HUF_compress1X_wksp(dst, dstSize, src, srcSize, maxSymbolValue, huffLog, workSpace, sizeof(workSpace));
1360 unsigned maxSymbolValue, unsigned huffLog)
1363 return HUF_compress4X_wksp(dst, dstSize, src, srcSize, maxSymbolValue, huffLog, workSpace, sizeof(workSpace));