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()
7546 const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, in FSE_buildCTable_wksp() argument
7549 U32 const tableSize = 1 << tableLog; in FSE_buildCTable_wksp()
7553 void* const FSCT = ((U32*)ptr) + 1 /* header */ + (tableLog ? tableSize>>1 : 1) ; in FSE_buildCTable_wksp()
7562 …if (((size_t)1 << tableLog) * sizeof(FSE_FUNCTION_TYPE) > wkspSize) return ERROR(tableLog_tooLarge… in FSE_buildCTable_wksp()
7563 tableU16[-2] = (U16) tableLog; in FSE_buildCTable_wksp()
7565 assert(tableLog < 16); /* required for threshold strategy to work */ in FSE_buildCTable_wksp()
7617 symbolTT[s].deltaNbBits = ((tableLog+1) << 16) - (1<<tableLog); in FSE_buildCTable_wksp()
7622 symbolTT[s].deltaNbBits = (tableLog << 16) - (1<<tableLog); in FSE_buildCTable_wksp()
7628 U32 const maxBitsOut = tableLog - BIT_highbit32 (normalizedCounter[s]-1); in FSE_buildCTable_wksp()
7642 (double)FSE_bitCost(symbolTT, tableLog, symbol, 8) / 256); in FSE_buildCTable_wksp()
7651 …dCTable(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog) in FSE_buildCTable() argument
7654 …return FSE_buildCTable_wksp(ct, normalizedCounter, maxSymbolValue, tableLog, tableSymbol, sizeof(t… in FSE_buildCTable()
7665 size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog) in FSE_NCountWriteBound() argument
7667 size_t const maxHeaderSize = (((maxSymbolValue+1) * tableLog) >> 3) + 3; in FSE_NCountWriteBound()
7673 const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, in FSE_writeNCount_generic() argument
7680 const int tableSize = 1 << tableLog; in FSE_writeNCount_generic()
7690 bitStream += (tableLog-FSE_MIN_TABLELOG) << bitCount; in FSE_writeNCount_generic()
7696 nbBits = tableLog+1; in FSE_writeNCount_generic()
7768 const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog) in FSE_writeNCount() argument
7770 if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge); /* Unsupported */ in FSE_writeNCount()
7771 if (tableLog < FSE_MIN_TABLELOG) return ERROR(GENERIC); /* Unsupported */ in FSE_writeNCount()
7773 if (bufferSize < FSE_NCountWriteBound(maxSymbolValue, tableLog)) in FSE_writeNCount()
7774 …return FSE_writeNCount_generic(buffer, bufferSize, normalizedCounter, maxSymbolValue, tableLog, 0); in FSE_writeNCount()
7776 …return FSE_writeNCount_generic(buffer, bufferSize, normalizedCounter, maxSymbolValue, tableLog, 1 … in FSE_writeNCount()
7784 FSE_CTable* FSE_createCTable (unsigned maxSymbolValue, unsigned tableLog) in FSE_createCTable() argument
7787 if (tableLog > FSE_TABLELOG_ABSOLUTE_MAX) tableLog = FSE_TABLELOG_ABSOLUTE_MAX; in FSE_createCTable()
7788 size = FSE_CTABLE_SIZE_U32 (tableLog, maxSymbolValue) * sizeof(U32); in FSE_createCTable()
7807 U32 tableLog = maxTableLog; in FSE_optimalTableLog_internal() local
7810 if (tableLog==0) tableLog = FSE_DEFAULT_TABLELOG; in FSE_optimalTableLog_internal()
7811 if (maxBitsSrc < tableLog) tableLog = maxBitsSrc; /* Accuracy can be reduced */ in FSE_optimalTableLog_internal()
7812 …if (minBits > tableLog) tableLog = minBits; /* Need a minimum to safely represent all symbol val… in FSE_optimalTableLog_internal()
7813 if (tableLog < FSE_MIN_TABLELOG) tableLog = FSE_MIN_TABLELOG; in FSE_optimalTableLog_internal()
7814 if (tableLog > FSE_MAX_TABLELOG) tableLog = FSE_MAX_TABLELOG; in FSE_optimalTableLog_internal()
7815 return tableLog; in FSE_optimalTableLog_internal()
7827 static size_t FSE_normalizeM2(short* norm, U32 tableLog, const unsigned* count, size_t total, U32 m… in FSE_normalizeM2() argument
7835 U32 const lowThreshold = (U32)(total >> tableLog); in FSE_normalizeM2()
7836 U32 lowOne = (U32)((total * 3) >> (tableLog + 1)); in FSE_normalizeM2()
7858 ToDistribute = (1 << tableLog) - distributed; in FSE_normalizeM2()
7873 ToDistribute = (1 << tableLog) - distributed; in FSE_normalizeM2()
7894 { U64 const vStepLog = 62 - tableLog; in FSE_normalizeM2()
7914 size_t FSE_normalizeCount (short* normalizedCounter, unsigned tableLog, in FSE_normalizeCount() argument
7919 if (tableLog==0) tableLog = FSE_DEFAULT_TABLELOG; in FSE_normalizeCount()
7920 if (tableLog < FSE_MIN_TABLELOG) return ERROR(GENERIC); /* Unsupported size */ in FSE_normalizeCount()
7921 if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge); /* Unsupported size */ in FSE_normalizeCount()
7922 …if (tableLog < FSE_minTableLog(total, maxSymbolValue)) return ERROR(GENERIC); /* Too small table… in FSE_normalizeCount()
7925 U64 const scale = 62 - tableLog; in FSE_normalizeCount()
7928 int stillToDistribute = 1<<tableLog; in FSE_normalizeCount()
7932 U32 lowThreshold = (U32)(total >> tableLog); in FSE_normalizeCount()
7952 …size_t const errorCode = FSE_normalizeM2(normalizedCounter, tableLog, count, total, maxSymbolValue… in FSE_normalizeCount()
7966 if (nTotal != (1U<<tableLog)) in FSE_normalizeCount()
7967 RAWLOG(2, "Warning !!! Total == %u != %u !!!", nTotal, 1U<<tableLog); in FSE_normalizeCount()
7972 return tableLog; in FSE_normalizeCount()
8111 …ize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace,… in FSE_compress_wksp() argument
8120 size_t const CTableSize = FSE_CTABLE_SIZE_U32(tableLog, maxSymbolValue); in FSE_compress_wksp()
8125 if (wkspSize < FSE_WKSP_SIZE_U32(tableLog, maxSymbolValue)) return ERROR(tableLog_tooLarge); in FSE_compress_wksp()
8128 if (!tableLog) tableLog = FSE_DEFAULT_TABLELOG; in FSE_compress_wksp()
8137 tableLog = FSE_optimalTableLog(tableLog, srcSize, maxSymbolValue); in FSE_compress_wksp()
8138 CHECK_F( FSE_normalizeCount(norm, tableLog, count, srcSize, maxSymbolValue) ); in FSE_compress_wksp()
8141 { CHECK_V_F(nc_err, FSE_writeNCount(op, oend-op, norm, maxSymbolValue, tableLog) ); in FSE_compress_wksp()
8146 …CHECK_F( FSE_buildCTable_wksp(CTable, norm, maxSymbolValue, tableLog, scratchBuffer, scratchBuffer… in FSE_compress_wksp()
8163 …t, size_t dstCapacity, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog) in FSE_compress2() argument
8167 if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge); in FSE_compress2()
8168 …return FSE_compress_wksp(dst, dstCapacity, src, srcSize, maxSymbolValue, tableLog, &scratchBuffer,… in FSE_compress2()
8434 U32 tableLog = MAX_FSE_TABLELOG_FOR_HUFF_HEADER; in HUF_compressWeights() local
8451 tableLog = FSE_optimalTableLog(tableLog, wtSize, maxSymbolValue); in HUF_compressWeights()
8452 CHECK_F( FSE_normalizeCount(norm, tableLog, count, wtSize, maxSymbolValue) ); in HUF_compressWeights()
8455 { CHECK_V_F(hSize, FSE_writeNCount(op, (size_t)(oend-op), norm, maxSymbolValue, tableLog) ); in HUF_compressWeights()
8460 …CHECK_F( FSE_buildCTable_wksp(CTable, norm, maxSymbolValue, tableLog, scratchBuffer, sizeof(scratc… in HUF_compressWeights()
8518 U32 tableLog = 0; in HUF_readCTable() local
8522 …e, HUF_readStats(huffWeight, HUF_SYMBOLVALUE_MAX+1, rankVal, &nbSymbols, &tableLog, src, srcSize)); in HUF_readCTable()
8525 if (tableLog > HUF_TABLELOG_MAX) return ERROR(tableLog_tooLarge); in HUF_readCTable()
8530 for (n=1; n<=tableLog; n++) { in HUF_readCTable()
8541 CTable[n].nbBits = (BYTE)(tableLog + 1 - w) & -(w != 0); in HUF_readCTable()
8549 valPerRank[tableLog+1] = 0; /* for w==0 */ in HUF_readCTable()
8551 U32 n; for (n=tableLog; n>0; n--) { /* start at n=tablelog <-> w=1 */ in HUF_readCTable()
11316 const U32 tableLog = FSE_optimalTableLog(FSELog, nbSeq, max); in ZSTD_NCountCost() local
11317 FORWARD_IF_ERROR(FSE_normalizeCount(norm, tableLog, count, nbSeq, max), ""); in ZSTD_NCountCost()
11318 return FSE_writeNCount(wksp, sizeof(wksp), norm, max, tableLog); in ZSTD_NCountCost()
11359 unsigned const tableLog = cstate.stateLog; in ZSTD_fseBitCost() local
11360 unsigned const badCost = (tableLog + 1) << kAccuracyLog; in ZSTD_fseBitCost()
11361 unsigned const bitCost = FSE_bitCost(cstate.symbolTT, tableLog, s, kAccuracyLog); in ZSTD_fseBitCost()
11504 const U32 tableLog = FSE_optimalTableLog(FSELog, nbSeq, max); in ZSTD_buildCTable() local
11510 FORWARD_IF_ERROR(FSE_normalizeCount(norm, tableLog, count, nbSeq_1, max), ""); in ZSTD_buildCTable()
11511 …{ size_t const NCountSize = FSE_writeNCount(op, oend - op, norm, max, tableLog); /* overflow p… in ZSTD_buildCTable()
11513 …FORWARD_IF_ERROR(FSE_buildCTable_wksp(nextCTable, norm, max, tableLog, entropyWorkspace, entropyWo… in ZSTD_buildCTable()
21450 typedef struct { BYTE maxTableLog; BYTE tableType; BYTE tableLog; BYTE reserved; } DTableDesc; member
21469 U32 tableLog = 0; in HUF_readDTableX1_wksp() local
21489 …iSize = HUF_readStats(huffWeight, HUF_SYMBOLVALUE_MAX + 1, rankVal, &nbSymbols, &tableLog, src, sr… in HUF_readDTableX1_wksp()
21494 …if (tableLog > (U32)(dtd.maxTableLog+1)) return ERROR(tableLog_tooLarge); /* DTable too small, H… in HUF_readDTableX1_wksp()
21496 dtd.tableLog = (BYTE)tableLog; in HUF_readDTableX1_wksp()
21502 for (n=1; n<tableLog+1; n++) { in HUF_readDTableX1_wksp()
21519 D.nbBits = (BYTE)(tableLog + 1 - w); in HUF_readDTableX1_wksp()
21600 U32 const dtLog = dtd.tableLog; in HUF_decompress1X1_usingDTable_internal_body()
21649 U32 const dtLog = dtd.tableLog; in HUF_decompress4X1_usingDTable_internal_body()
21904 U32 tableLog, maxW, sizeOfSort, nbSymbols; in HUF_readDTableX2_wksp() local
21939 …iSize = HUF_readStats(weightList, HUF_SYMBOLVALUE_MAX + 1, rankStats, &nbSymbols, &tableLog, src, … in HUF_readDTableX2_wksp()
21943 if (tableLog > maxTableLog) return ERROR(tableLog_tooLarge); /* DTable can't fit code depth */ in HUF_readDTableX2_wksp()
21946 … for (maxW = tableLog; rankStats[maxW]==0; maxW--) {} /* necessarily finds a solution before 0 */ in HUF_readDTableX2_wksp()
21972 { int const rescale = (maxTableLog-tableLog) - 1; /* tableLog <= maxTableLog */ in HUF_readDTableX2_wksp()
21980 { U32 const minBits = tableLog+1 - maxW; in HUF_readDTableX2_wksp()
21992 tableLog+1); in HUF_readDTableX2_wksp()
21994 dtd.tableLog = (BYTE)maxTableLog; in HUF_readDTableX2_wksp()
22088 HUF_decodeStreamX2(ostart, &bitD, oend, dt, dtd.tableLog); in HUF_decompress1X2_usingDTable_internal_body()
22136 U32 const dtLog = dtd.tableLog; in HUF_decompress4X2_usingDTable_internal_body()
22687 U32 tableLog; member
24570 unsigned tableLog);
26745 DTableH->tableLog = 0; in ZSTD_buildSeqTable_rle()
26764 unsigned tableLog) in ZSTD_buildFSETable() argument
26770 U32 const tableSize = 1 << tableLog; in ZSTD_buildFSETable()
26775 assert(tableLog <= MaxFSELog); in ZSTD_buildFSETable()
26779 DTableH.tableLog = tableLog; in ZSTD_buildFSETable()
26781 { S16 const largeLimit= (S16)(1 << (tableLog-1)); in ZSTD_buildFSETable()
26814 tableDecode[u].nbBits = (BYTE) (tableLog - BIT_highbit32(nextState) ); in ZSTD_buildFSETable()
26858 { unsigned tableLog; in ZSTD_buildSeqTable() local
26860 size_t const headerSize = FSE_readNCount(norm, &max, &tableLog, src, srcSize); in ZSTD_buildSeqTable()
26862 RETURN_ERROR_IF(tableLog > maxLog, corruption_detected, ""); in ZSTD_buildSeqTable()
26863 ZSTD_buildFSETable(DTableSpace, norm, max, baseValue, nbAdditionalBits, tableLog); in ZSTD_buildSeqTable()
27193 DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog); in ZSTD_initFseState()
27195 (U32)DStatePtr->state, DTableH->tableLog); in ZSTD_initFseState()
27715 U32 const tableLog = ((const ZSTD_seqSymbol_header*)ptr)[0].tableLog; in ZSTD_getLongOffsetsShare() local
27717 U32 const max = 1 << tableLog; in ZSTD_getLongOffsetsShare()
27719 DEBUGLOG(5, "ZSTD_getLongOffsetsShare: (tableLog=%u)", tableLog); in ZSTD_getLongOffsetsShare()
27726 assert(tableLog <= OffFSELog); in ZSTD_getLongOffsetsShare()
27727 total <<= (OffFSELog - tableLog); /* scale to OffFSELog */ in ZSTD_getLongOffsetsShare()