Lines Matching refs:tableLog
68 const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, in FSE_buildCTable_wksp() argument
71 U32 const tableSize = 1 << tableLog; in FSE_buildCTable_wksp()
75 void* const FSCT = ((U32*)ptr) + 1 /* header */ + (tableLog ? tableSize>>1 : 1) ; in FSE_buildCTable_wksp()
85 …if (FSE_BUILD_CTABLE_WORKSPACE_SIZE(maxSymbolValue, tableLog) > wkspSize) return ERROR(tableLog_to… in FSE_buildCTable_wksp()
87 tableU16[-2] = (U16) tableLog; in FSE_buildCTable_wksp()
89 assert(tableLog < 16); /* required for threshold strategy to work */ in FSE_buildCTable_wksp()
141 symbolTT[s].deltaNbBits = ((tableLog+1) << 16) - (1<<tableLog); in FSE_buildCTable_wksp()
146 symbolTT[s].deltaNbBits = (tableLog << 16) - (1<<tableLog); in FSE_buildCTable_wksp()
152 U32 const maxBitsOut = tableLog - BIT_highbit32 (normalizedCounter[s]-1); in FSE_buildCTable_wksp()
166 (double)FSE_bitCost(symbolTT, tableLog, symbol, 8) / 256); in FSE_buildCTable_wksp()
183 size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog) in FSE_NCountWriteBound() argument
185 size_t const maxHeaderSize = (((maxSymbolValue+1) * tableLog) >> 3) + 3; in FSE_NCountWriteBound()
191 const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, in FSE_writeNCount_generic() argument
198 const int tableSize = 1 << tableLog; in FSE_writeNCount_generic()
208 bitStream += (tableLog-FSE_MIN_TABLELOG) << bitCount; in FSE_writeNCount_generic()
214 nbBits = tableLog+1; in FSE_writeNCount_generic()
286 const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog) in FSE_writeNCount() argument
288 if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge); /* Unsupported */ in FSE_writeNCount()
289 if (tableLog < FSE_MIN_TABLELOG) return ERROR(GENERIC); /* Unsupported */ in FSE_writeNCount()
291 if (bufferSize < FSE_NCountWriteBound(maxSymbolValue, tableLog)) in FSE_writeNCount()
292 …return FSE_writeNCount_generic(buffer, bufferSize, normalizedCounter, maxSymbolValue, tableLog, 0); in FSE_writeNCount()
294 …return FSE_writeNCount_generic(buffer, bufferSize, normalizedCounter, maxSymbolValue, tableLog, 1 … in FSE_writeNCount()
302 FSE_CTable* FSE_createCTable (unsigned maxSymbolValue, unsigned tableLog) in FSE_createCTable() argument
305 if (tableLog > FSE_TABLELOG_ABSOLUTE_MAX) tableLog = FSE_TABLELOG_ABSOLUTE_MAX; in FSE_createCTable()
306 size = FSE_CTABLE_SIZE_U32 (tableLog, maxSymbolValue) * sizeof(U32); in FSE_createCTable()
325 U32 tableLog = maxTableLog; in FSE_optimalTableLog_internal() local
328 if (tableLog==0) tableLog = FSE_DEFAULT_TABLELOG; in FSE_optimalTableLog_internal()
329 if (maxBitsSrc < tableLog) tableLog = maxBitsSrc; /* Accuracy can be reduced */ in FSE_optimalTableLog_internal()
330 …if (minBits > tableLog) tableLog = minBits; /* Need a minimum to safely represent all symbol val… in FSE_optimalTableLog_internal()
331 if (tableLog < FSE_MIN_TABLELOG) tableLog = FSE_MIN_TABLELOG; in FSE_optimalTableLog_internal()
332 if (tableLog > FSE_MAX_TABLELOG) tableLog = FSE_MAX_TABLELOG; in FSE_optimalTableLog_internal()
333 return tableLog; in FSE_optimalTableLog_internal()
344 static size_t FSE_normalizeM2(short* norm, U32 tableLog, const unsigned* count, size_t total, U32 m… in FSE_normalizeM2() argument
352 U32 const lowThreshold = (U32)(total >> tableLog); in FSE_normalizeM2()
353 U32 lowOne = (U32)((total * 3) >> (tableLog + 1)); in FSE_normalizeM2()
375 ToDistribute = (1 << tableLog) - distributed; in FSE_normalizeM2()
390 ToDistribute = (1 << tableLog) - distributed; in FSE_normalizeM2()
411 { U64 const vStepLog = 62 - tableLog; in FSE_normalizeM2()
430 size_t FSE_normalizeCount (short* normalizedCounter, unsigned tableLog, in FSE_normalizeCount() argument
435 if (tableLog==0) tableLog = FSE_DEFAULT_TABLELOG; in FSE_normalizeCount()
436 if (tableLog < FSE_MIN_TABLELOG) return ERROR(GENERIC); /* Unsupported size */ in FSE_normalizeCount()
437 if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge); /* Unsupported size */ in FSE_normalizeCount()
438 …if (tableLog < FSE_minTableLog(total, maxSymbolValue)) return ERROR(GENERIC); /* Too small table… in FSE_normalizeCount()
442 U64 const scale = 62 - tableLog; in FSE_normalizeCount()
445 int stillToDistribute = 1<<tableLog; in FSE_normalizeCount()
449 U32 lowThreshold = (U32)(total >> tableLog); in FSE_normalizeCount()
469 …size_t const errorCode = FSE_normalizeM2(normalizedCounter, tableLog, count, total, maxSymbolValue… in FSE_normalizeCount()
483 if (nTotal != (1U<<tableLog)) in FSE_normalizeCount()
484 RAWLOG(2, "Warning !!! Total == %u != %u !!!", nTotal, 1U<<tableLog); in FSE_normalizeCount()
489 return tableLog; in FSE_normalizeCount()