Home
last modified time | relevance | path

Searched refs:tableLog (Results 1 – 21 of 21) sorted by relevance

/external/zstd/lib/compress/
Dfse_compress.c68 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()
[all …]
Dzstd_compress_sequences.c75 const U32 tableLog = FSE_optimalTableLog(FSELog, nbSeq, max); in ZSTD_NCountCost() local
76 …FORWARD_IF_ERROR(FSE_normalizeCount(norm, tableLog, count, nbSeq, max, ZSTD_useLowProbCount(nbSeq)… in ZSTD_NCountCost()
77 return FSE_writeNCount(wksp, sizeof(wksp), norm, max, tableLog); in ZSTD_NCountCost()
118 unsigned const tableLog = cstate.stateLog; in ZSTD_fseBitCost() local
119 unsigned const badCost = (tableLog + 1) << kAccuracyLog; in ZSTD_fseBitCost()
120 unsigned const bitCost = FSE_bitCost(cstate.symbolTT, tableLog, s, kAccuracyLog); in ZSTD_fseBitCost()
263 const U32 tableLog = FSE_optimalTableLog(FSELog, nbSeq, max); in ZSTD_buildCTable() local
270 …FORWARD_IF_ERROR(FSE_normalizeCount(norm, tableLog, count, nbSeq_1, max, ZSTD_useLowProbCount(nbSe… in ZSTD_buildCTable()
271 …{ size_t const NCountSize = FSE_writeNCount(op, oend - op, norm, max, tableLog); /* overflow p… in ZSTD_buildCTable()
273 …FORWARD_IF_ERROR(FSE_buildCTable_wksp(nextCTable, norm, max, tableLog, entropyWorkspace, entropyWo… in ZSTD_buildCTable()
Dhuf_compress.c69 U32 tableLog = MAX_FSE_TABLELOG_FOR_HUFF_HEADER; in HUF_compressWeights() local
86 tableLog = FSE_optimalTableLog(tableLog, wtSize, maxSymbolValue); in HUF_compressWeights()
87 …CHECK_F( FSE_normalizeCount(norm, tableLog, count, wtSize, maxSymbolValue, /* useLowProbCount */ 0… in HUF_compressWeights()
90 { CHECK_V_F(hSize, FSE_writeNCount(op, (size_t)(oend-op), norm, maxSymbolValue, tableLog) ); in HUF_compressWeights()
95 …CHECK_F( FSE_buildCTable_wksp(CTable, norm, maxSymbolValue, tableLog, scratchBuffer, sizeof(scratc… in HUF_compressWeights()
148 U32 tableLog = 0; in HUF_readCTable() local
152 …e, HUF_readStats(huffWeight, HUF_SYMBOLVALUE_MAX+1, rankVal, &nbSymbols, &tableLog, src, srcSize)); in HUF_readCTable()
156 if (tableLog > HUF_TABLELOG_MAX) return ERROR(tableLog_tooLarge); in HUF_readCTable()
161 for (n=1; n<=tableLog; n++) { in HUF_readCTable()
170 CTable[n].nbBits = (BYTE)(tableLog + 1 - w) & -(w != 0); in HUF_readCTable()
[all …]
/external/zstd/lib/common/
Dfse_decompress.c60 FSE_DTable* FSE_createDTable (unsigned tableLog) in FSE_createDTable() argument
62 if (tableLog > FSE_TABLELOG_ABSOLUTE_MAX) tableLog = FSE_TABLELOG_ABSOLUTE_MAX; in FSE_createDTable()
63 return (FSE_DTable*)ZSTD_malloc( FSE_DTABLE_SIZE_U32(tableLog) * sizeof (U32) ); in FSE_createDTable()
71 …* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace,… in FSE_buildDTable_internal() argument
79 U32 const tableSize = 1 << tableLog; in FSE_buildDTable_internal()
83 …if (FSE_BUILD_DTABLE_WKSP_SIZE(tableLog, maxSymbolValue) > wkspSize) return ERROR(maxSymbolValue_t… in FSE_buildDTable_internal()
85 if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge); in FSE_buildDTable_internal()
89 DTableH.tableLog = (U16)tableLog; in FSE_buildDTable_internal()
91 { S16 const largeLimit= (S16)(1 << (tableLog-1)); in FSE_buildDTable_internal()
169 tableDecode[u].nbBits = (BYTE) (tableLog - BIT_highbit32(nextState) ); in FSE_buildDTable_internal()
[all …]
Dfse.h105 … dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog);
148 FSE_PUBLIC_API size_t FSE_normalizeCount(short* normalizedCounter, unsigned tableLog,
154 FSE_PUBLIC_API size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog);
162 unsigned maxSymbolValue, unsigned tableLog);
167 FSE_PUBLIC_API FSE_CTable* FSE_createCTable (unsigned maxSymbolValue, unsigned tableLog);
173 …CTable(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);
247 FSE_PUBLIC_API FSE_DTable* FSE_createDTable(unsigned tableLog);
253 …Table (FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);
328 …ize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace,…
340 …LD_CTABLE_WORKSPACE_SIZE(maxSymbolValue, tableLog) (sizeof(unsigned) * (maxSymbolValue + 2) + (1ul… argument
[all …]
Dhuf.h88 unsigned maxSymbolValue, unsigned tableLog);
97 unsigned maxSymbolValue, unsigned tableLog,
211 unsigned maxSymbolValue, unsigned tableLog,
306 … dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog);
307 …ize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace,…
316 unsigned maxSymbolValue, unsigned tableLog,
Dentropy_common.c309 { U32 const tableLog = BIT_highbit32(weightTotal) + 1; in HUF_readStats_body() local
310 if (tableLog > HUF_TABLELOG_MAX) return ERROR(corruption_detected); in HUF_readStats_body()
311 *tableLogPtr = tableLog; in HUF_readStats_body()
313 { U32 const total = 1 << tableLog; in HUF_readStats_body()
/external/zstd/tests/fuzz/
Dfse_read_ncount.c33 …unsigned const tableLog = FUZZ_dataProducer_uint32Range(producer, FSE_MIN_TABLELOG, FSE_MAX_TABLEL… in LLVMFuzzerTestOneInput() local
36 unsigned remainingWeight = (1u << tableLog) - 1; in LLVMFuzzerTestOneInput()
63 FUZZ_ASSERT(sizeof(data) >= FSE_NCountWriteBound(maxSymbolValue, tableLog)); in LLVMFuzzerTestOneInput()
64 dataSize = FSE_writeNCount(data, sizeof(data), ncount, maxSymbolValue, tableLog); in LLVMFuzzerTestOneInput()
88 FUZZ_ASSERT(rtTableLog == tableLog); in LLVMFuzzerTestOneInput()
/external/zstd/lib/decompress/
Dzstd_decompress_block.c352 DTableH->tableLog = 0; in ZSTD_buildSeqTable_rle()
371 unsigned tableLog, void* wksp, size_t wkspSize) in ZSTD_buildFSETable_body() argument
375 U32 const tableSize = 1 << tableLog; in ZSTD_buildFSETable_body()
384 assert(tableLog <= MaxFSELog); in ZSTD_buildFSETable_body()
389 DTableH.tableLog = tableLog; in ZSTD_buildFSETable_body()
391 { S16 const largeLimit= (S16)(1 << (tableLog-1)); in ZSTD_buildFSETable_body()
478 tableDecode[u].nbBits = (BYTE) (tableLog - BIT_highbit32(nextState) ); in ZSTD_buildFSETable_body()
491 unsigned tableLog, void* wksp, size_t wkspSize) in ZSTD_buildFSETable_body_default() argument
494 baseValue, nbAdditionalBits, tableLog, wksp, wkspSize); in ZSTD_buildFSETable_body_default()
501 unsigned tableLog, void* wksp, size_t wkspSize) in ZSTD_buildFSETable_body_bmi2() argument
[all …]
Dhuf_decompress.c101 typedef struct { BYTE maxTableLog; BYTE tableType; BYTE tableLog; BYTE reserved; } DTableDesc; member
149 U32 tableLog = 0; in HUF_readDTableX1_wksp_bmi2() local
162 …(wksp->huffWeight, HUF_SYMBOLVALUE_MAX + 1, wksp->rankVal, &nbSymbols, &tableLog, src, srcSize, wk… in HUF_readDTableX1_wksp_bmi2()
167 …if (tableLog > (U32)(dtd.maxTableLog+1)) return ERROR(tableLog_tooLarge); /* DTable too small, H… in HUF_readDTableX1_wksp_bmi2()
169 dtd.tableLog = (BYTE)tableLog; in HUF_readDTableX1_wksp_bmi2()
190 for (n=0; n<(int)tableLog+1; n++) { in HUF_readDTableX1_wksp_bmi2()
218 for (w=1; w<tableLog+1; ++w) { in HUF_readDTableX1_wksp_bmi2()
222 BYTE const nbBits = (BYTE)(tableLog + 1 - w); in HUF_readDTableX1_wksp_bmi2()
338 U32 const dtLog = dtd.tableLog; in HUF_decompress1X1_usingDTable_internal_body()
387 U32 const dtLog = dtd.tableLog; in HUF_decompress4X1_usingDTable_internal_body()
[all …]
Dzstd_decompress_block.h58 unsigned tableLog, void* wksp, size_t wkspSize,
Dzstd_decompress_internal.h64 U32 tableLog; member
/external/zstd/lib/legacy/
Dzstd_v02.c704 U16 tableLog; member
719 DStatePtr->state = BIT_readBits(bitD, DTableH.tableLog); in FSE_initDState()
1100 (FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog) in FSE_buildDTable() argument
1105 const U32 tableSize = 1 << tableLog; in FSE_buildDTable()
1111 const S16 largeLimit= (S16)(1 << (tableLog-1)); in FSE_buildDTable()
1117 if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge); in FSE_buildDTable()
1120 DTableH.tableLog = (U16)tableLog; in FSE_buildDTable()
1156 tableDecode[i].nbBits = (BYTE) (tableLog - BIT_highbit32 ((U32)nextState) ); in FSE_buildDTable()
1304 DTableH->tableLog = 0; in FSE_buildDTable_rle()
1329 DTableH->tableLog = (U16)nbBits; in FSE_buildDTable_raw()
[all …]
Dzstd_v03.c706 U16 tableLog; member
721 DStatePtr->state = BIT_readBits(bitD, DTableH.tableLog); in FSE_initDState()
1101 (FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog) in FSE_buildDTable() argument
1106 const U32 tableSize = 1 << tableLog; in FSE_buildDTable()
1112 const S16 largeLimit= (S16)(1 << (tableLog-1)); in FSE_buildDTable()
1118 if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge); in FSE_buildDTable()
1121 DTableH.tableLog = (U16)tableLog; in FSE_buildDTable()
1157 tableDecode[i].nbBits = (BYTE) (tableLog - BIT_highbit32 ((U32)nextState) ); in FSE_buildDTable()
1305 DTableH->tableLog = 0; in FSE_buildDTable_rle()
1330 DTableH->tableLog = (U16)nbBits; in FSE_buildDTable_raw()
[all …]
Dzstd_v07.c764 FSEv07_DTable* FSEv07_createDTable(unsigned tableLog);
770 …le (FSEv07_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);
865 U16 tableLog; member
880 DStatePtr->state = BITv07_readBits(bitD, DTableH->tableLog); in FSEv07_initDState()
1358 { U32 const tableLog = BITv07_highbit32(weightTotal) + 1; in HUFv07_readStats() local
1359 if (tableLog > HUFv07_TABLELOG_ABSOLUTEMAX) return ERROR(corruption_detected); in HUFv07_readStats()
1360 *tableLogPtr = tableLog; in HUFv07_readStats()
1362 { U32 const total = 1 << tableLog; in HUFv07_readStats()
1471 FSEv07_DTable* FSEv07_createDTable (unsigned tableLog) in FSEv07_createDTable() argument
1473 if (tableLog > FSEv07_TABLELOG_ABSOLUTE_MAX) tableLog = FSEv07_TABLELOG_ABSOLUTE_MAX; in FSEv07_createDTable()
[all …]
Dzstd_v06.c718 FSEv06_DTable* FSEv06_createDTable(unsigned tableLog);
724 …le (FSEv06_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);
1101 U16 tableLog; member
1116 DStatePtr->state = BITv06_readBits(bitD, DTableH->tableLog); in FSEv06_initDState()
1451 FSEv06_DTable* FSEv06_createDTable (unsigned tableLog) in FSEv06_createDTable() argument
1453 if (tableLog > FSEv06_TABLELOG_ABSOLUTE_MAX) tableLog = FSEv06_TABLELOG_ABSOLUTE_MAX; in FSEv06_createDTable()
1454 return (FSEv06_DTable*)malloc( FSEv06_DTABLE_SIZE_U32(tableLog) * sizeof (U32) ); in FSEv06_createDTable()
1462 …able(FSEv06_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog) in FSEv06_buildDTable() argument
1469 U32 const tableSize = 1 << tableLog; in FSEv06_buildDTable()
1474 if (tableLog > FSEv06_MAX_TABLELOG) return ERROR(tableLog_tooLarge); in FSEv06_buildDTable()
[all …]
Dzstd_v04.c496 …able ( FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);
879 U16 tableLog; member
894 DStatePtr->state = BIT_readBits(bitD, DTableH.tableLog); in FSE_initDState()
1077 …dDTable(FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog) in FSE_buildDTable() argument
1082 const U32 tableSize = 1 << tableLog; in FSE_buildDTable()
1088 const S16 largeLimit= (S16)(1 << (tableLog-1)); in FSE_buildDTable()
1094 if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge); in FSE_buildDTable()
1098 DTableH.tableLog = (U16)tableLog; in FSE_buildDTable()
1134 tableDecode[i].nbBits = (BYTE) (tableLog - BIT_highbit32 ((U32)nextState) ); in FSE_buildDTable()
1283 DTableH->tableLog = 0; in FSE_buildDTable_rle()
[all …]
Dzstd_v05.c647 FSEv05_DTable* FSEv05_createDTable(unsigned tableLog);
655 …le (FSEv05_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);
995 U16 tableLog; member
1010 DStatePtr->state = BITv05_readBits(bitD, DTableH->tableLog); in FSEv05_initDState()
1202 FSEv05_DTable* FSEv05_createDTable (unsigned tableLog) in FSEv05_createDTable() argument
1204 if (tableLog > FSEv05_TABLELOG_ABSOLUTE_MAX) tableLog = FSEv05_TABLELOG_ABSOLUTE_MAX; in FSEv05_createDTable()
1205 return (FSEv05_DTable*)malloc( FSEv05_DTABLE_SIZE_U32(tableLog) * sizeof (U32) ); in FSEv05_createDTable()
1213 …able(FSEv05_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog) in FSEv05_buildDTable() argument
1218 const U32 tableSize = 1 << tableLog; in FSEv05_buildDTable()
1224 const S16 largeLimit= (S16)(1 << (tableLog-1)); in FSEv05_buildDTable()
[all …]
Dzstd_v01.c395 U16 tableLog; member
400 (FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog) in FSE_buildDTable() argument
405 const U32 tableSize = 1 << tableLog; in FSE_buildDTable()
411 const S16 largeLimit= (S16)(1 << (tableLog-1)); in FSE_buildDTable()
417 if (tableLog > FSE_MAX_TABLELOG) return (size_t)-FSE_ERROR_tableLog_tooLarge; in FSE_buildDTable()
420 DTableH[0].tableLog = (U16)tableLog; in FSE_buildDTable()
456 tableDecode[i].nbBits = (BYTE) (tableLog - FSE_highbit32 ((U32)nextState) ); in FSE_buildDTable()
604 DTableH->tableLog = 0; in FSE_buildDTable_rle()
629 DTableH->tableLog = (U16)nbBits; in FSE_buildDTable_raw()
777 DStatePtr->state = FSE_readBits(bitD, DTableH->tableLog); in FSE_initDState()
[all …]
/external/zstd/tests/
Ddecodecorpus.c860 const U32 tableLog = FSE_optimalTableLog(LLFSELog, nbSeq, max); in writeSequences() local
862 FSE_normalizeCount(norm, tableLog, count, nbSeq_1, max, nbSeq >= 2048); in writeSequences()
863 …{ size_t const NCountSize = FSE_writeNCount(op, oend-op, norm, max, tableLog); /* overflow prote… in writeSequences()
866 …CHECKERR(FSE_buildCTable_wksp(CTable_LitLength, norm, max, tableLog, scratchBuffer, sizeof(scratch… in writeSequences()
888 const U32 tableLog = FSE_optimalTableLog(OffFSELog, nbSeq, max); in writeSequences() local
890 FSE_normalizeCount(norm, tableLog, count, nbSeq_1, max, nbSeq >= 2048); in writeSequences()
891 …{ size_t const NCountSize = FSE_writeNCount(op, oend-op, norm, max, tableLog); /* overflow prote… in writeSequences()
894 …FSE_buildCTable_wksp(CTable_OffsetBits, norm, max, tableLog, scratchBuffer, sizeof(scratchBuffer)); in writeSequences()
918 const U32 tableLog = FSE_optimalTableLog(MLFSELog, nbSeq, max); in writeSequences() local
920 FSE_normalizeCount(norm, tableLog, count, nbSeq_1, max, nbSeq >= 2048); in writeSequences()
[all …]
Dfuzzer.c2977 unsigned const tableLog = 5; in basicUnitTests() local
2987 FSE_normalizeCount(norm, tableLog, count, nbSeq, maxSymbolValue, /* useLowProbCount */ 1); in basicUnitTests()