Lines Matching defs:maxSymbolValue

92 size_t FSE_buildCTable_wksp(FSE_CTable *ct, const short *normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void *workspace, size_t workspaceSize)
119 tableU16[-1] = (U16)maxSymbolValue;
128 for (u = 1; u <= maxSymbolValue + 1; u++) {
136 cumul[maxSymbolValue + 1] = tableSize + 1;
143 for (symbol = 0; symbol <= maxSymbolValue; symbol++) {
170 for (s = 0; s <= maxSymbolValue; s++) {
197 size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog)
199 size_t const maxHeaderSize = (((maxSymbolValue + 1) * tableLog) >> 3) + 3;
200 return maxSymbolValue ? maxHeaderSize : FSE_NCOUNTBOUND; /* maxSymbolValue==0 ? use default */
203 static size_t FSE_writeNCount_generic(void *header, size_t headerBufferSize, const short *normalizedCounter, unsigned maxSymbolValue, unsigned tableLog,
295 if (charnum > maxSymbolValue + 1)
301 size_t FSE_writeNCount(void *buffer, size_t bufferSize, const short *normalizedCounter, unsigned maxSymbolValue, unsigned tableLog)
308 if (bufferSize < FSE_NCountWriteBound(maxSymbolValue, tableLog))
309 return FSE_writeNCount_generic(buffer, bufferSize, normalizedCounter, maxSymbolValue, tableLog, 0);
311 return FSE_writeNCount_generic(buffer, bufferSize, normalizedCounter, maxSymbolValue, tableLog, 1);
328 unsigned maxSymbolValue = *maxSymbolValuePtr;
331 memset(count, 0, (maxSymbolValue + 1) * sizeof(*count));
340 while (!count[maxSymbolValue])
341 maxSymbolValue--;
342 *maxSymbolValuePtr = maxSymbolValue;
346 for (s = 0; s <= maxSymbolValue; s++)
362 unsigned maxSymbolValue = *maxSymbolValuePtr;
373 memset(count, 0, maxSymbolValue + 1);
377 if (!maxSymbolValue)
378 maxSymbolValue = 255; /* 0 == default */
423 for (s = 255; s > maxSymbolValue; s--) {
432 for (s = 0; s <= maxSymbolValue; s++) {
439 while (!count[maxSymbolValue])
440 maxSymbolValue--;
441 *maxSymbolValuePtr = maxSymbolValue;
472 `U16 maxSymbolValue;`
474 `FSE_symbolCompressionTransform symbolTT[maxSymbolValue+1];` // This size is variable
477 size_t FSE_sizeof_CTable(unsigned maxSymbolValue, unsigned tableLog)
481 return FSE_CTABLE_SIZE_U32(tableLog, maxSymbolValue) * sizeof(U32);
485 static unsigned FSE_minTableLog(size_t srcSize, unsigned maxSymbolValue)
488 U32 minBitsSymbols = BIT_highbit32(maxSymbolValue) + 2;
493 unsigned FSE_optimalTableLog_internal(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue, unsigned minus)
497 U32 minBits = FSE_minTableLog(srcSize, maxSymbolValue);
511 unsigned FSE_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue)
513 return FSE_optimalTableLog_internal(maxTableLog, srcSize, maxSymbolValue, 2);
519 static size_t FSE_normalizeM2(short *norm, U32 tableLog, const unsigned *count, size_t total, U32 maxSymbolValue)
530 for (s = 0; s <= maxSymbolValue; s++) {
555 for (s = 0; s <= maxSymbolValue; s++) {
566 if (distributed == maxSymbolValue + 1) {
571 for (s = 0; s <= maxSymbolValue; s++)
580 for (s = 0; ToDistribute > 0; s = (s + 1) % (maxSymbolValue + 1))
591 for (s = 0; s <= maxSymbolValue; s++) {
608 size_t FSE_normalizeCount(short *normalizedCounter, unsigned tableLog, const unsigned *count, size_t total, unsigned maxSymbolValue)
617 if (tableLog < FSE_minTableLog(total, maxSymbolValue))
631 for (s = 0; s <= maxSymbolValue; s++) {
655 size_t const errorCode = FSE_normalizeM2(normalizedCounter, tableLog, count, total, maxSymbolValue);
670 const unsigned maxSymbolValue = tableMask;
683 tableU16[-1] = (U16)maxSymbolValue;
692 for (s = 0; s <= maxSymbolValue; s++) {