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()
86 …if (FSE_BUILD_CTABLE_WORKSPACE_SIZE(maxSymbolValue, tableLog) > wkspSize) return ERROR(tableLog_to… in FSE_buildCTable_wksp()
88 tableU16[-2] = (U16) tableLog; in FSE_buildCTable_wksp()
90 assert(tableLog < 16); /* required for threshold strategy to work */ in FSE_buildCTable_wksp()
182 symbolTT[s].deltaNbBits = ((tableLog+1) << 16) - (1<<tableLog); in FSE_buildCTable_wksp()
187 symbolTT[s].deltaNbBits = (tableLog << 16) - (1<<tableLog); in FSE_buildCTable_wksp()
194 { U32 const maxBitsOut = tableLog - BIT_highbit32 ((U32)normalizedCounter[s]-1); in FSE_buildCTable_wksp()
208 (double)FSE_bitCost(symbolTT, tableLog, symbol, 8) / 256); in FSE_buildCTable_wksp()
222 size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog) in FSE_NCountWriteBound() argument
224 size_t const maxHeaderSize = (((maxSymbolValue+1) * tableLog in FSE_NCountWriteBound()
234 const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, in FSE_writeNCount_generic() argument
241 const int tableSize = 1 << tableLog; in FSE_writeNCount_generic()
251 bitStream += (tableLog-FSE_MIN_TABLELOG) << bitCount; in FSE_writeNCount_generic()
257 nbBits = tableLog+1; in FSE_writeNCount_generic()
329 const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog) in FSE_writeNCount() argument
331 if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge); /* Unsupported */ in FSE_writeNCount()
332 if (tableLog < FSE_MIN_TABLELOG) return ERROR(GENERIC); /* Unsupported */ in FSE_writeNCount()
334 if (bufferSize < FSE_NCountWriteBound(maxSymbolValue, tableLog)) in FSE_writeNCount()
335 …return FSE_writeNCount_generic(buffer, bufferSize, normalizedCounter, maxSymbolValue, tableLog, 0); in FSE_writeNCount()
337 …return FSE_writeNCount_generic(buffer, bufferSize, normalizedCounter, maxSymbolValue, tableLog, 1 … in FSE_writeNCount()
345 FSE_CTable* FSE_createCTable (unsigned maxSymbolValue, unsigned tableLog) in FSE_createCTable() argument
348 if (tableLog > FSE_TABLELOG_ABSOLUTE_MAX) tableLog = FSE_TABLELOG_ABSOLUTE_MAX; in FSE_createCTable()
349 size = FSE_CTABLE_SIZE_U32 (tableLog, maxSymbolValue) * sizeof(U32); in FSE_createCTable()
368 U32 tableLog = maxTableLog; in FSE_optimalTableLog_internal() local
371 if (tableLog==0) tableLog = FSE_DEFAULT_TABLELOG; in FSE_optimalTableLog_internal()
372 if (maxBitsSrc < tableLog) tableLog = maxBitsSrc; /* Accuracy can be reduced */ in FSE_optimalTableLog_internal()
373 …if (minBits > tableLog) tableLog = minBits; /* Need a minimum to safely represent all symbol val… in FSE_optimalTableLog_internal()
374 if (tableLog < FSE_MIN_TABLELOG) tableLog = FSE_MIN_TABLELOG; in FSE_optimalTableLog_internal()
375 if (tableLog > FSE_MAX_TABLELOG) tableLog = FSE_MAX_TABLELOG; in FSE_optimalTableLog_internal()
376 return tableLog; in FSE_optimalTableLog_internal()
387 static size_t FSE_normalizeM2(short* norm, U32 tableLog, const unsigned* count, size_t total, U32 m… in FSE_normalizeM2() argument
395 U32 const lowThreshold = (U32)(total >> tableLog); in FSE_normalizeM2()
396 U32 lowOne = (U32)((total * 3) >> (tableLog + 1)); in FSE_normalizeM2()
418 ToDistribute = (1 << tableLog) - distributed; in FSE_normalizeM2()
433 ToDistribute = (1 << tableLog) - distributed; in FSE_normalizeM2()
454 { U64 const vStepLog = 62 - tableLog; in FSE_normalizeM2()
473 size_t FSE_normalizeCount (short* normalizedCounter, unsigned tableLog, in FSE_normalizeCount() argument
478 if (tableLog==0) tableLog = FSE_DEFAULT_TABLELOG; in FSE_normalizeCount()
479 if (tableLog < FSE_MIN_TABLELOG) return ERROR(GENERIC); /* Unsupported size */ in FSE_normalizeCount()
480 if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge); /* Unsupported size */ in FSE_normalizeCount()
481 …if (tableLog < FSE_minTableLog(total, maxSymbolValue)) return ERROR(GENERIC); /* Too small table… in FSE_normalizeCount()
485 U64 const scale = 62 - tableLog; in FSE_normalizeCount()
488 int stillToDistribute = 1<<tableLog; in FSE_normalizeCount()
492 U32 lowThreshold = (U32)(total >> tableLog); in FSE_normalizeCount()
512 …size_t const errorCode = FSE_normalizeM2(normalizedCounter, tableLog, count, total, maxSymbolValue… in FSE_normalizeCount()
526 if (nTotal != (1U<<tableLog)) in FSE_normalizeCount()
527 RAWLOG(2, "Warning !!! Total == %u != %u !!!", nTotal, 1U<<tableLog); in FSE_normalizeCount()
532 return tableLog; in FSE_normalizeCount()