Lines Matching refs:tableLog
942 … dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog);
979 FSE_PUBLIC_API size_t FSE_normalizeCount(short* normalizedCounter, unsigned tableLog,
985 FSE_PUBLIC_API size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog);
993 unsigned maxSymbolValue, unsigned tableLog);
998 FSE_PUBLIC_API FSE_CTable* FSE_createCTable (unsigned maxSymbolValue, unsigned tableLog);
1004 …CTable(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);
1071 FSE_PUBLIC_API FSE_DTable* FSE_createDTable(unsigned tableLog);
1077 …Table (FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);
1783 …ize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace,…
1795 …* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace,…
1960 const U32 tableLog = MEM_read16(ptr); in FSE_initCState() local
1961 statePtr->value = (ptrdiff_t)1<<tableLog; in FSE_initCState()
1963 statePtr->symbolTT = ct + 1 + (tableLog ? (1<<(tableLog-1)) : 1); in FSE_initCState()
1964 statePtr->stateLog = tableLog; in FSE_initCState()
2013 MEM_STATIC U32 FSE_bitCost(const void* symbolTTPtr, U32 tableLog, U32 symbolValue, U32 accuracyLog) in FSE_bitCost() argument
2018 assert(tableLog < 16); in FSE_bitCost()
2019 assert(accuracyLog < 31-tableLog); /* ensure enough room for renormalization double shift */ in FSE_bitCost()
2020 { U32 const tableSize = 1 << tableLog; in FSE_bitCost()
2022 …U32 const normalizedDeltaFromThreshold = (deltaFromThreshold << accuracyLog) >> tableLog; /* lin… in FSE_bitCost()
2034 U16 tableLog; member
2049 DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog); in FSE_initDState()
2247 unsigned maxSymbolValue, unsigned tableLog);
2256 unsigned maxSymbolValue, unsigned tableLog,
2365 unsigned maxSymbolValue, unsigned tableLog,
2447 … dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog);
2448 …ize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace,…
2457 unsigned maxSymbolValue, unsigned tableLog,
2674 { U32 const tableLog = BIT_highbit32(weightTotal) + 1; in HUF_readStats() local
2675 if (tableLog > HUF_TABLELOG_MAX) return ERROR(corruption_detected); in HUF_readStats()
2676 *tableLogPtr = tableLog; in HUF_readStats()
2678 { U32 const total = 1 << tableLog; in HUF_readStats()
2811 FSE_DTable* FSE_createDTable (unsigned tableLog) in FSE_createDTable() argument
2813 if (tableLog > FSE_TABLELOG_ABSOLUTE_MAX) tableLog = FSE_TABLELOG_ABSOLUTE_MAX; in FSE_createDTable()
2814 return (FSE_DTable*)malloc( FSE_DTABLE_SIZE_U32(tableLog) * sizeof (U32) ); in FSE_createDTable()
2822 …dDTable(FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog) in FSE_buildDTable() argument
2829 U32 const tableSize = 1 << tableLog; in FSE_buildDTable()
2834 if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge); in FSE_buildDTable()
2838 DTableH.tableLog = (U16)tableLog; in FSE_buildDTable()
2840 { S16 const largeLimit= (S16)(1 << (tableLog-1)); in FSE_buildDTable()
2872 tableDecode[u].nbBits = (BYTE) (tableLog - BIT_highbit32(nextState) ); in FSE_buildDTable()
2892 DTableH->tableLog = 0; in FSE_buildDTable_rle()
2918 DTableH->tableLog = (U16)nbBits; in FSE_buildDTable_raw()
3011 unsigned tableLog; in FSE_decompress_wksp() local
3015 …size_t const NCountLength = FSE_readNCount (counting, &maxSymbolValue, &tableLog, istart, cSrcSize… in FSE_decompress_wksp()
3018 if (tableLog > maxLog) return ERROR(tableLog_tooLarge); in FSE_decompress_wksp()
3022 CHECK_F( FSE_buildDTable (workSpace, counting, maxSymbolValue, tableLog) ); in FSE_decompress_wksp()
7544 const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, in FSE_buildCTable_wksp() argument
7547 U32 const tableSize = 1 << tableLog; in FSE_buildCTable_wksp()
7551 void* const FSCT = ((U32*)ptr) + 1 /* header */ + (tableLog ? tableSize>>1 : 1) ; in FSE_buildCTable_wksp()
7560 …if (((size_t)1 << tableLog) * sizeof(FSE_FUNCTION_TYPE) > wkspSize) return ERROR(tableLog_tooLarge… in FSE_buildCTable_wksp()
7561 tableU16[-2] = (U16) tableLog; in FSE_buildCTable_wksp()
7563 assert(tableLog < 16); /* required for threshold strategy to work */ in FSE_buildCTable_wksp()
7615 symbolTT[s].deltaNbBits = ((tableLog+1) << 16) - (1<<tableLog); in FSE_buildCTable_wksp()
7620 symbolTT[s].deltaNbBits = (tableLog << 16) - (1<<tableLog); in FSE_buildCTable_wksp()
7626 U32 const maxBitsOut = tableLog - BIT_highbit32 (normalizedCounter[s]-1); in FSE_buildCTable_wksp()
7640 (double)FSE_bitCost(symbolTT, tableLog, symbol, 8) / 256); in FSE_buildCTable_wksp()
7649 …dCTable(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog) in FSE_buildCTable() argument
7652 …return FSE_buildCTable_wksp(ct, normalizedCounter, maxSymbolValue, tableLog, tableSymbol, sizeof(t… in FSE_buildCTable()
7663 size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog) in FSE_NCountWriteBound() argument
7665 size_t const maxHeaderSize = (((maxSymbolValue+1) * tableLog) >> 3) + 3; in FSE_NCountWriteBound()
7671 const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, in FSE_writeNCount_generic() argument
7678 const int tableSize = 1 << tableLog; in FSE_writeNCount_generic()
7688 bitStream += (tableLog-FSE_MIN_TABLELOG) << bitCount; in FSE_writeNCount_generic()
7694 nbBits = tableLog+1; in FSE_writeNCount_generic()
7766 const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog) in FSE_writeNCount() argument
7768 if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge); /* Unsupported */ in FSE_writeNCount()
7769 if (tableLog < FSE_MIN_TABLELOG) return ERROR(GENERIC); /* Unsupported */ in FSE_writeNCount()
7771 if (bufferSize < FSE_NCountWriteBound(maxSymbolValue, tableLog)) in FSE_writeNCount()
7772 …return FSE_writeNCount_generic(buffer, bufferSize, normalizedCounter, maxSymbolValue, tableLog, 0); in FSE_writeNCount()
7774 …return FSE_writeNCount_generic(buffer, bufferSize, normalizedCounter, maxSymbolValue, tableLog, 1 … in FSE_writeNCount()
7782 FSE_CTable* FSE_createCTable (unsigned maxSymbolValue, unsigned tableLog) in FSE_createCTable() argument
7785 if (tableLog > FSE_TABLELOG_ABSOLUTE_MAX) tableLog = FSE_TABLELOG_ABSOLUTE_MAX; in FSE_createCTable()
7786 size = FSE_CTABLE_SIZE_U32 (tableLog, maxSymbolValue) * sizeof(U32); in FSE_createCTable()
7805 U32 tableLog = maxTableLog; in FSE_optimalTableLog_internal() local
7808 if (tableLog==0) tableLog = FSE_DEFAULT_TABLELOG; in FSE_optimalTableLog_internal()
7809 if (maxBitsSrc < tableLog) tableLog = maxBitsSrc; /* Accuracy can be reduced */ in FSE_optimalTableLog_internal()
7810 …if (minBits > tableLog) tableLog = minBits; /* Need a minimum to safely represent all symbol val… in FSE_optimalTableLog_internal()
7811 if (tableLog < FSE_MIN_TABLELOG) tableLog = FSE_MIN_TABLELOG; in FSE_optimalTableLog_internal()
7812 if (tableLog > FSE_MAX_TABLELOG) tableLog = FSE_MAX_TABLELOG; in FSE_optimalTableLog_internal()
7813 return tableLog; in FSE_optimalTableLog_internal()
7825 static size_t FSE_normalizeM2(short* norm, U32 tableLog, const unsigned* count, size_t total, U32 m… in FSE_normalizeM2() argument
7833 U32 const lowThreshold = (U32)(total >> tableLog); in FSE_normalizeM2()
7834 U32 lowOne = (U32)((total * 3) >> (tableLog + 1)); in FSE_normalizeM2()
7856 ToDistribute = (1 << tableLog) - distributed; in FSE_normalizeM2()
7871 ToDistribute = (1 << tableLog) - distributed; in FSE_normalizeM2()
7892 { U64 const vStepLog = 62 - tableLog; in FSE_normalizeM2()
7912 size_t FSE_normalizeCount (short* normalizedCounter, unsigned tableLog, in FSE_normalizeCount() argument
7917 if (tableLog==0) tableLog = FSE_DEFAULT_TABLELOG; in FSE_normalizeCount()
7918 if (tableLog < FSE_MIN_TABLELOG) return ERROR(GENERIC); /* Unsupported size */ in FSE_normalizeCount()
7919 if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge); /* Unsupported size */ in FSE_normalizeCount()
7920 …if (tableLog < FSE_minTableLog(total, maxSymbolValue)) return ERROR(GENERIC); /* Too small table… in FSE_normalizeCount()
7923 U64 const scale = 62 - tableLog; in FSE_normalizeCount()
7926 int stillToDistribute = 1<<tableLog; in FSE_normalizeCount()
7930 U32 lowThreshold = (U32)(total >> tableLog); in FSE_normalizeCount()
7950 …size_t const errorCode = FSE_normalizeM2(normalizedCounter, tableLog, count, total, maxSymbolValue… in FSE_normalizeCount()
7964 if (nTotal != (1U<<tableLog)) in FSE_normalizeCount()
7965 RAWLOG(2, "Warning !!! Total == %u != %u !!!", nTotal, 1U<<tableLog); in FSE_normalizeCount()
7970 return tableLog; in FSE_normalizeCount()
8109 …ize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace,… in FSE_compress_wksp() argument
8118 size_t const CTableSize = FSE_CTABLE_SIZE_U32(tableLog, maxSymbolValue); in FSE_compress_wksp()
8123 if (wkspSize < FSE_WKSP_SIZE_U32(tableLog, maxSymbolValue)) return ERROR(tableLog_tooLarge); in FSE_compress_wksp()
8126 if (!tableLog) tableLog = FSE_DEFAULT_TABLELOG; in FSE_compress_wksp()
8135 tableLog = FSE_optimalTableLog(tableLog, srcSize, maxSymbolValue); in FSE_compress_wksp()
8136 CHECK_F( FSE_normalizeCount(norm, tableLog, count, srcSize, maxSymbolValue) ); in FSE_compress_wksp()
8139 { CHECK_V_F(nc_err, FSE_writeNCount(op, oend-op, norm, maxSymbolValue, tableLog) ); in FSE_compress_wksp()
8144 …CHECK_F( FSE_buildCTable_wksp(CTable, norm, maxSymbolValue, tableLog, scratchBuffer, scratchBuffer… in FSE_compress_wksp()
8161 …t, size_t dstCapacity, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog) in FSE_compress2() argument
8165 if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge); in FSE_compress2()
8166 …return FSE_compress_wksp(dst, dstCapacity, src, srcSize, maxSymbolValue, tableLog, &scratchBuffer,… in FSE_compress2()
8432 U32 tableLog = MAX_FSE_TABLELOG_FOR_HUFF_HEADER; in HUF_compressWeights() local
8449 tableLog = FSE_optimalTableLog(tableLog, wtSize, maxSymbolValue); in HUF_compressWeights()
8450 CHECK_F( FSE_normalizeCount(norm, tableLog, count, wtSize, maxSymbolValue) ); in HUF_compressWeights()
8453 { CHECK_V_F(hSize, FSE_writeNCount(op, (size_t)(oend-op), norm, maxSymbolValue, tableLog) ); in HUF_compressWeights()
8458 …CHECK_F( FSE_buildCTable_wksp(CTable, norm, maxSymbolValue, tableLog, scratchBuffer, sizeof(scratc… in HUF_compressWeights()
8516 U32 tableLog = 0; in HUF_readCTable() local
8520 …e, HUF_readStats(huffWeight, HUF_SYMBOLVALUE_MAX+1, rankVal, &nbSymbols, &tableLog, src, srcSize)); in HUF_readCTable()
8523 if (tableLog > HUF_TABLELOG_MAX) return ERROR(tableLog_tooLarge); in HUF_readCTable()
8528 for (n=1; n<=tableLog; n++) { in HUF_readCTable()
8539 CTable[n].nbBits = (BYTE)(tableLog + 1 - w) & -(w != 0); in HUF_readCTable()
8547 valPerRank[tableLog+1] = 0; /* for w==0 */ in HUF_readCTable()
8549 U32 n; for (n=tableLog; n>0; n--) { /* start at n=tablelog <-> w=1 */ in HUF_readCTable()
11314 const U32 tableLog = FSE_optimalTableLog(FSELog, nbSeq, max); in ZSTD_NCountCost() local
11315 FORWARD_IF_ERROR(FSE_normalizeCount(norm, tableLog, count, nbSeq, max), ""); in ZSTD_NCountCost()
11316 return FSE_writeNCount(wksp, sizeof(wksp), norm, max, tableLog); in ZSTD_NCountCost()
11357 unsigned const tableLog = cstate.stateLog; in ZSTD_fseBitCost() local
11358 unsigned const badCost = (tableLog + 1) << kAccuracyLog; in ZSTD_fseBitCost()
11359 unsigned const bitCost = FSE_bitCost(cstate.symbolTT, tableLog, s, kAccuracyLog); in ZSTD_fseBitCost()
11502 const U32 tableLog = FSE_optimalTableLog(FSELog, nbSeq, max); in ZSTD_buildCTable() local
11508 FORWARD_IF_ERROR(FSE_normalizeCount(norm, tableLog, count, nbSeq_1, max), ""); in ZSTD_buildCTable()
11509 …{ size_t const NCountSize = FSE_writeNCount(op, oend - op, norm, max, tableLog); /* overflow p… in ZSTD_buildCTable()
11511 …FORWARD_IF_ERROR(FSE_buildCTable_wksp(nextCTable, norm, max, tableLog, entropyWorkspace, entropyWo… in ZSTD_buildCTable()
21448 typedef struct { BYTE maxTableLog; BYTE tableType; BYTE tableLog; BYTE reserved; } DTableDesc; member
21467 U32 tableLog = 0; in HUF_readDTableX1_wksp() local
21487 …iSize = HUF_readStats(huffWeight, HUF_SYMBOLVALUE_MAX + 1, rankVal, &nbSymbols, &tableLog, src, sr… in HUF_readDTableX1_wksp()
21492 …if (tableLog > (U32)(dtd.maxTableLog+1)) return ERROR(tableLog_tooLarge); /* DTable too small, H… in HUF_readDTableX1_wksp()
21494 dtd.tableLog = (BYTE)tableLog; in HUF_readDTableX1_wksp()
21500 for (n=1; n<tableLog+1; n++) { in HUF_readDTableX1_wksp()
21517 D.nbBits = (BYTE)(tableLog + 1 - w); in HUF_readDTableX1_wksp()
21598 U32 const dtLog = dtd.tableLog; in HUF_decompress1X1_usingDTable_internal_body()
21647 U32 const dtLog = dtd.tableLog; in HUF_decompress4X1_usingDTable_internal_body()
21902 U32 tableLog, maxW, sizeOfSort, nbSymbols; in HUF_readDTableX2_wksp() local
21937 …iSize = HUF_readStats(weightList, HUF_SYMBOLVALUE_MAX + 1, rankStats, &nbSymbols, &tableLog, src, … in HUF_readDTableX2_wksp()
21941 if (tableLog > maxTableLog) return ERROR(tableLog_tooLarge); /* DTable can't fit code depth */ in HUF_readDTableX2_wksp()
21944 … for (maxW = tableLog; rankStats[maxW]==0; maxW--) {} /* necessarily finds a solution before 0 */ in HUF_readDTableX2_wksp()
21970 { int const rescale = (maxTableLog-tableLog) - 1; /* tableLog <= maxTableLog */ in HUF_readDTableX2_wksp()
21978 { U32 const minBits = tableLog+1 - maxW; in HUF_readDTableX2_wksp()
21990 tableLog+1); in HUF_readDTableX2_wksp()
21992 dtd.tableLog = (BYTE)maxTableLog; in HUF_readDTableX2_wksp()
22086 HUF_decodeStreamX2(ostart, &bitD, oend, dt, dtd.tableLog); in HUF_decompress1X2_usingDTable_internal_body()
22134 U32 const dtLog = dtd.tableLog; in HUF_decompress4X2_usingDTable_internal_body()
22685 U32 tableLog; member
24568 unsigned tableLog);
26743 DTableH->tableLog = 0; in ZSTD_buildSeqTable_rle()
26762 unsigned tableLog) in ZSTD_buildFSETable() argument
26768 U32 const tableSize = 1 << tableLog; in ZSTD_buildFSETable()
26773 assert(tableLog <= MaxFSELog); in ZSTD_buildFSETable()
26777 DTableH.tableLog = tableLog; in ZSTD_buildFSETable()
26779 { S16 const largeLimit= (S16)(1 << (tableLog-1)); in ZSTD_buildFSETable()
26812 tableDecode[u].nbBits = (BYTE) (tableLog - BIT_highbit32(nextState) ); in ZSTD_buildFSETable()
26856 { unsigned tableLog; in ZSTD_buildSeqTable() local
26858 size_t const headerSize = FSE_readNCount(norm, &max, &tableLog, src, srcSize); in ZSTD_buildSeqTable()
26860 RETURN_ERROR_IF(tableLog > maxLog, corruption_detected, ""); in ZSTD_buildSeqTable()
26861 ZSTD_buildFSETable(DTableSpace, norm, max, baseValue, nbAdditionalBits, tableLog); in ZSTD_buildSeqTable()
27191 DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog); in ZSTD_initFseState()
27193 (U32)DStatePtr->state, DTableH->tableLog); in ZSTD_initFseState()
27713 U32 const tableLog = ((const ZSTD_seqSymbol_header*)ptr)[0].tableLog; in ZSTD_getLongOffsetsShare() local
27715 U32 const max = 1 << tableLog; in ZSTD_getLongOffsetsShare()
27717 DEBUGLOG(5, "ZSTD_getLongOffsetsShare: (tableLog=%u)", tableLog); in ZSTD_getLongOffsetsShare()
27724 assert(tableLog <= OffFSELog); in ZSTD_getLongOffsetsShare()
27725 total <<= (OffFSELog - tableLog); /* scale to OffFSELog */ in ZSTD_getLongOffsetsShare()