Lines Matching defs:maxSymbolValue

44 unsigned HUF_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue)
46 return FSE_optimalTableLog_internal(maxTableLog, srcSize, maxSymbolValue, 1);
95 unsigned maxSymbolValue = HUF_TABLELOG_MAX;
105 { unsigned const maxCount = HIST_count_simple(wksp->count, &maxSymbolValue, weightTable, wtSize); /* never fails */
110 tableLog = FSE_optimalTableLog(tableLog, wtSize, maxSymbolValue);
111 CHECK_F( FSE_normalizeCount(wksp->norm, tableLog, wksp->count, wtSize, maxSymbolValue, /* useLowProbCount */ 0) );
114 { CHECK_V_F(hSize, FSE_writeNCount(op, (size_t)(oend-op), wksp->norm, maxSymbolValue, tableLog) );
119 CHECK_F( FSE_buildCTable_wksp(wksp->CTable, wksp->norm, maxSymbolValue, tableLog, wksp->scratchBuffer, sizeof(wksp->scratchBuffer)) );
170 const HUF_CElt* CTable, unsigned maxSymbolValue, unsigned huffLog,
180 if (maxSymbolValue > HUF_SYMBOLVALUE_MAX) return ERROR(maxSymbolValue_tooLarge);
186 for (n=0; n<maxSymbolValue; n++)
191 { CHECK_V_F(hSize, HUF_compressWeights(op+1, maxDstSize-1, wksp->huffWeight, maxSymbolValue, &wksp->wksp, sizeof(wksp->wksp)) );
192 if ((hSize>1) & (hSize < maxSymbolValue/2)) { /* FSE compressed */
198 if (maxSymbolValue > (256-128)) return ERROR(GENERIC); /* should not happen : likely means source cannot be compressed */
199 if (((maxSymbolValue+1)/2) + 1 > maxDstSize) return ERROR(dstSize_tooSmall); /* not enough space within dst buffer */
200 op[0] = (BYTE)(128 /*special case*/ + (maxSymbolValue-1));
201 wksp->huffWeight[maxSymbolValue] = 0; /* to be sure it doesn't cause msan issue in final combination */
202 for (n=0; n<maxSymbolValue; n+=2)
204 return ((maxSymbolValue+1)/2) + 1;
211 const HUF_CElt* CTable, unsigned maxSymbolValue, unsigned huffLog)
214 return HUF_writeCTable_wksp(dst, maxDstSize, CTable, maxSymbolValue, huffLog, &wksp, sizeof(wksp));
538 * Sorts the symbols [0, maxSymbolValue] by count[symbol] in decreasing order.
542 * Must have (maxSymbolValue + 1) entries.
544 * @param[in] maxSymbolValue Maximum symbol value.
547 static void HUF_sort(nodeElt huffNode[], const unsigned count[], U32 const maxSymbolValue, rankPos rankPosition[]) {
549 U32 const maxSymbolValue1 = maxSymbolValue+1;
604 * @param maxSymbolValue The maximum symbol value.
607 static int HUF_buildTree(nodeElt* huffNode, U32 maxSymbolValue)
615 nonNullRank = (int)maxSymbolValue;
650 * @param maxSymbolValue The maximum symbol value.
653 static void HUF_buildCTableFromTree(HUF_CElt* CTable, nodeElt const* huffNode, int nonNullRank, U32 maxSymbolValue, U32 maxNbBits)
660 int const alphabetSize = (int)(maxSymbolValue + 1);
677 size_t HUF_buildCTable_wksp (HUF_CElt* CTable, const unsigned* count, U32 maxSymbolValue, U32 maxNbBits, void* workSpace, size_t wkspSize)
688 if (maxSymbolValue > HUF_SYMBOLVALUE_MAX)
693 HUF_sort(huffNode, count, maxSymbolValue, wksp_tables->rankPosition);
696 nonNullRank = HUF_buildTree(huffNode, maxSymbolValue);
702 HUF_buildCTableFromTree(CTable, huffNode, nonNullRank, maxSymbolValue, maxNbBits);
707 size_t HUF_estimateCompressedSize(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue)
712 for (s = 0; s <= (int)maxSymbolValue; ++s) {
718 int HUF_validateCTable(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue) {
722 for (s = 0; s <= (int)maxSymbolValue; ++s) {
1177 unsigned maxSymbolValue, unsigned huffLog,
1196 if (maxSymbolValue > HUF_SYMBOLVALUE_MAX) return ERROR(maxSymbolValue_tooLarge);
1197 if (!maxSymbolValue) maxSymbolValue = HUF_SYMBOLVALUE_MAX;
1211 { unsigned maxSymbolValueBegin = maxSymbolValue;
1215 { unsigned maxSymbolValueEnd = maxSymbolValue;
1223 { CHECK_V_F(largest, HIST_count_wksp (table->count, &maxSymbolValue, (const BYTE*)src, srcSize, table->wksps.hist_wksp, sizeof(table->wksps.hist_wksp)) );
1231 && !HUF_validateCTable(oldHufTable, table->count, maxSymbolValue)) {
1242 huffLog = HUF_optimalTableLog(huffLog, srcSize, maxSymbolValue);
1244 maxSymbolValue, huffLog,
1251 size_t const ctableSize = HUF_CTABLE_SIZE_ST(maxSymbolValue);
1257 { CHECK_V_F(hSize, HUF_writeCTable_wksp(op, dstSize, table->CTable, maxSymbolValue, huffLog,
1261 size_t const oldSize = HUF_estimateCompressedSize(oldHufTable, table->count, maxSymbolValue);
1262 size_t const newSize = HUF_estimateCompressedSize(table->CTable, table->count, maxSymbolValue);
1284 unsigned maxSymbolValue, unsigned huffLog,
1288 maxSymbolValue, huffLog, HUF_singleStream,
1295 unsigned maxSymbolValue, unsigned huffLog,
1301 maxSymbolValue, huffLog, HUF_singleStream,
1311 unsigned maxSymbolValue, unsigned huffLog,
1315 maxSymbolValue, huffLog, HUF_fourStreams,
1326 unsigned maxSymbolValue, unsigned huffLog,
1331 maxSymbolValue, huffLog, HUF_fourStreams,