Lines Matching defs:tableLog

92 size_t FSE_buildCTable_wksp(FSE_CTable *ct, const short *normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void *workspace, size_t workspaceSize)
94 U32 const tableSize = 1 << tableLog;
98 void *const FSCT = ((U32 *)ptr) + 1 /* header */ + (tableLog ? tableSize >> 1 : 1);
110 spaceUsed32 += ALIGN(sizeof(FSE_FUNCTION_TYPE) * ((size_t)1 << tableLog), sizeof(U32)) >> 2;
118 tableU16[-2] = (U16)tableLog;
176 symbolTT[s].deltaNbBits = (tableLog << 16) - (1 << tableLog);
181 U32 const maxBitsOut = tableLog - BIT_highbit32(normalizedCounter[s] - 1);
197 size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog)
199 size_t const maxHeaderSize = (((maxSymbolValue + 1) * tableLog) >> 3) + 3;
203 static size_t FSE_writeNCount_generic(void *header, size_t headerBufferSize, const short *normalizedCounter, unsigned maxSymbolValue, unsigned tableLog,
210 const int tableSize = 1 << tableLog;
221 bitStream += (tableLog - FSE_MIN_TABLELOG) << bitCount;
227 nbBits = tableLog + 1;
301 size_t FSE_writeNCount(void *buffer, size_t bufferSize, const short *normalizedCounter, unsigned maxSymbolValue, unsigned tableLog)
303 if (tableLog > FSE_MAX_TABLELOG)
305 if (tableLog < FSE_MIN_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);
471 `U16 tableLog;`
473 `U16 nextStateNumber[1 << tableLog];` // This size is variable
477 size_t FSE_sizeof_CTable(unsigned maxSymbolValue, unsigned tableLog)
479 if (tableLog > FSE_MAX_TABLELOG)
481 return FSE_CTABLE_SIZE_U32(tableLog, maxSymbolValue) * sizeof(U32);
496 U32 tableLog = maxTableLog;
498 if (tableLog == 0)
499 tableLog = FSE_DEFAULT_TABLELOG;
500 if (maxBitsSrc < tableLog)
501 tableLog = maxBitsSrc; /* Accuracy can be reduced */
502 if (minBits > tableLog)
503 tableLog = minBits; /* Need a minimum to safely represent all symbol values */
504 if (tableLog < FSE_MIN_TABLELOG)
505 tableLog = FSE_MIN_TABLELOG;
506 if (tableLog > FSE_MAX_TABLELOG)
507 tableLog = FSE_MAX_TABLELOG;
508 return tableLog;
519 static size_t FSE_normalizeM2(short *norm, U32 tableLog, const unsigned *count, size_t total, U32 maxSymbolValue)
527 U32 const lowThreshold = (U32)(total >> tableLog);
528 U32 lowOne = (U32)((total * 3) >> (tableLog + 1));
550 ToDistribute = (1 << tableLog) - distributed;
563 ToDistribute = (1 << tableLog) - distributed;
587 U64 const vStepLog = 62 - tableLog;
608 size_t FSE_normalizeCount(short *normalizedCounter, unsigned tableLog, const unsigned *count, size_t total, unsigned maxSymbolValue)
611 if (tableLog == 0)
612 tableLog = FSE_DEFAULT_TABLELOG;
613 if (tableLog < FSE_MIN_TABLELOG)
615 if (tableLog > FSE_MAX_TABLELOG)
617 if (tableLog < FSE_minTableLog(total, maxSymbolValue))
618 return ERROR(GENERIC); /* Too small tableLog, compression potentially impossible */
622 U64 const scale = 62 - tableLog;
625 int stillToDistribute = 1 << tableLog;
629 U32 lowThreshold = (U32)(total >> tableLog);
655 size_t const errorCode = FSE_normalizeM2(normalizedCounter, tableLog, count, total, maxSymbolValue);
662 return tableLog;
673 void *const FSCT = ((U32 *)ptr) + 1 /* header */ + (tableSize >> 1); /* assumption : tableLog >= 1 */