Lines Matching refs:tableLog
92 … *ct, const short *normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void *workspace,… in FSE_buildCTable_wksp() argument
94 U32 const tableSize = 1 << tableLog; in FSE_buildCTable_wksp()
98 void *const FSCT = ((U32 *)ptr) + 1 /* header */ + (tableLog ? tableSize >> 1 : 1); in FSE_buildCTable_wksp()
110 spaceUsed32 += ALIGN(sizeof(FSE_FUNCTION_TYPE) * ((size_t)1 << tableLog), sizeof(U32)) >> 2; in FSE_buildCTable_wksp()
118 tableU16[-2] = (U16)tableLog; in FSE_buildCTable_wksp()
176 symbolTT[s].deltaNbBits = (tableLog << 16) - (1 << tableLog); in FSE_buildCTable_wksp()
181 U32 const maxBitsOut = tableLog - BIT_highbit32(normalizedCounter[s] - 1); in FSE_buildCTable_wksp()
197 size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog) in FSE_NCountWriteBound() argument
199 size_t const maxHeaderSize = (((maxSymbolValue + 1) * tableLog) >> 3) + 3; in FSE_NCountWriteBound()
203 …ize_t headerBufferSize, const short *normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, in FSE_writeNCount_generic() argument
210 const int tableSize = 1 << tableLog; in FSE_writeNCount_generic()
221 bitStream += (tableLog - FSE_MIN_TABLELOG) << bitCount; in FSE_writeNCount_generic()
227 nbBits = tableLog + 1; in FSE_writeNCount_generic()
301 …fer, size_t bufferSize, const short *normalizedCounter, unsigned maxSymbolValue, unsigned tableLog) in FSE_writeNCount() argument
303 if (tableLog > FSE_MAX_TABLELOG) in FSE_writeNCount()
305 if (tableLog < FSE_MIN_TABLELOG) in FSE_writeNCount()
308 if (bufferSize < FSE_NCountWriteBound(maxSymbolValue, tableLog)) in FSE_writeNCount()
309 …return FSE_writeNCount_generic(buffer, bufferSize, normalizedCounter, maxSymbolValue, tableLog, 0); in FSE_writeNCount()
311 return FSE_writeNCount_generic(buffer, bufferSize, normalizedCounter, maxSymbolValue, tableLog, 1); in FSE_writeNCount()
477 size_t FSE_sizeof_CTable(unsigned maxSymbolValue, unsigned tableLog) in FSE_sizeof_CTable() argument
479 if (tableLog > FSE_MAX_TABLELOG) in FSE_sizeof_CTable()
481 return FSE_CTABLE_SIZE_U32(tableLog, maxSymbolValue) * sizeof(U32); in FSE_sizeof_CTable()
496 U32 tableLog = maxTableLog; in FSE_optimalTableLog_internal() local
498 if (tableLog == 0) in FSE_optimalTableLog_internal()
499 tableLog = FSE_DEFAULT_TABLELOG; in FSE_optimalTableLog_internal()
500 if (maxBitsSrc < tableLog) in FSE_optimalTableLog_internal()
501 tableLog = maxBitsSrc; /* Accuracy can be reduced */ in FSE_optimalTableLog_internal()
502 if (minBits > tableLog) in FSE_optimalTableLog_internal()
503 tableLog = minBits; /* Need a minimum to safely represent all symbol values */ in FSE_optimalTableLog_internal()
504 if (tableLog < FSE_MIN_TABLELOG) in FSE_optimalTableLog_internal()
505 tableLog = FSE_MIN_TABLELOG; in FSE_optimalTableLog_internal()
506 if (tableLog > FSE_MAX_TABLELOG) in FSE_optimalTableLog_internal()
507 tableLog = FSE_MAX_TABLELOG; in FSE_optimalTableLog_internal()
508 return tableLog; in FSE_optimalTableLog_internal()
519 static size_t FSE_normalizeM2(short *norm, U32 tableLog, const unsigned *count, size_t total, U32 m… in FSE_normalizeM2() argument
527 U32 const lowThreshold = (U32)(total >> tableLog); in FSE_normalizeM2()
528 U32 lowOne = (U32)((total * 3) >> (tableLog + 1)); in FSE_normalizeM2()
550 ToDistribute = (1 << tableLog) - distributed; in FSE_normalizeM2()
563 ToDistribute = (1 << tableLog) - distributed; in FSE_normalizeM2()
587 U64 const vStepLog = 62 - tableLog; in FSE_normalizeM2()
608 size_t FSE_normalizeCount(short *normalizedCounter, unsigned tableLog, const unsigned *count, size_… in FSE_normalizeCount() argument
611 if (tableLog == 0) in FSE_normalizeCount()
612 tableLog = FSE_DEFAULT_TABLELOG; in FSE_normalizeCount()
613 if (tableLog < FSE_MIN_TABLELOG) in FSE_normalizeCount()
615 if (tableLog > FSE_MAX_TABLELOG) in FSE_normalizeCount()
617 if (tableLog < FSE_minTableLog(total, maxSymbolValue)) in FSE_normalizeCount()
622 U64 const scale = 62 - tableLog; in FSE_normalizeCount()
625 int stillToDistribute = 1 << tableLog; in FSE_normalizeCount()
629 U32 lowThreshold = (U32)(total >> tableLog); in FSE_normalizeCount()
655 …size_t const errorCode = FSE_normalizeM2(normalizedCounter, tableLog, count, total, maxSymbolValue… in FSE_normalizeCount()
662 return tableLog; in FSE_normalizeCount()