| /src/external/bsd/zstd/dist/tests/fuzz/ |
| fse_read_ncount.c | 32 /* Pick a random tableLog and maxSymbolValue */ 34 unsigned const maxSymbolValue = FUZZ_dataProducer_uint32Range(producer, 0, 255); 45 for (s = 0; s < maxSymbolValue && remainingWeight > 0; ++s) { 55 /* Ensure ncount[maxSymbolValue] != 0 and the sum is (1<<tableLog) */ 56 ncount[maxSymbolValue] = remainingWeight + 1; 57 if (ncount[maxSymbolValue] == 1 && FUZZ_dataProducer_uint32Range(producer, 0, 1) == 1) { 58 ncount[maxSymbolValue] = -1; 63 FUZZ_ASSERT(sizeof(data) >= FSE_NCountWriteBound(maxSymbolValue, tableLog)); 64 dataSize = FSE_writeNCount(data, sizeof(data), ncount, maxSymbolValue, tableLog); 87 FUZZ_ASSERT(rtMaxSymbolValue == maxSymbolValue); [all...] |
| /src/external/bsd/zstd/dist/lib/compress/ |
| hist.c | 44 unsigned maxSymbolValue = *maxSymbolValuePtr; 47 ZSTD_memset(count, 0, (maxSymbolValue+1) * sizeof(*count)); 51 assert(*ip <= maxSymbolValue); 55 while (!count[maxSymbolValue]) maxSymbolValue--; 56 *maxSymbolValuePtr = maxSymbolValue; 59 for (s=0; s<=maxSymbolValue; s++) 136 { unsigned maxSymbolValue = 255; 137 while (!Counting1[maxSymbolValue]) maxSymbolValue-- [all...] |
| zstd_compress_sequences.c | 49 U32 const maxSymbolValue = MEM_read16(u16ptr + 1); 50 return maxSymbolValue; 115 DEBUGLOG(5, "Repeat FSE_CTable has maxSymbolValue %u < %u",
|
| zstd_compress_superblock.c | 314 unsigned maxSymbolValue = 255; 320 size_t const largest = HIST_count_wksp (countWksp, &maxSymbolValue, (const BYTE*)literals, litSize, workspace, wkspSize); 322 { size_t cLitSizeEstimate = HUF_estimateCompressedSize((const HUF_CElt*)huf->CTable, countWksp, maxSymbolValue);
|
| huf_compress.c | 155 unsigned maxSymbolValue = HUF_TABLELOG_MAX; 165 { unsigned const maxCount = HIST_count_simple(wksp->count, &maxSymbolValue, weightTable, wtSize); /* never fails */ 170 tableLog = FSE_optimalTableLog(tableLog, wtSize, maxSymbolValue); 171 CHECK_F( FSE_normalizeCount(wksp->norm, tableLog, wksp->count, wtSize, maxSymbolValue, /* useLowProbCount */ 0) ); 174 { CHECK_V_F(hSize, FSE_writeNCount(op, (size_t)(oend-op), wksp->norm, maxSymbolValue, tableLog) ); 179 CHECK_F( FSE_buildCTable_wksp(wksp->CTable, wksp->norm, maxSymbolValue, tableLog, wksp->scratchBuffer, sizeof(wksp->scratchBuffer)) ); 230 static void HUF_writeCTableHeader(HUF_CElt* ctable, U32 tableLog, U32 maxSymbolValue) 237 assert(maxSymbolValue < 256); 238 header.maxSymbolValue = (BYTE)maxSymbolValue; [all...] |
| zstd_compress.c | 3648 unsigned maxSymbolValue = HUF_SYMBOLVALUE_MAX; 3675 HIST_count_wksp (countWksp, &maxSymbolValue, 3694 && !HUF_validateCTable((HUF_CElt const*)prevHuf->CTable, countWksp, maxSymbolValue)) { 3700 huffLog = HUF_optimalTableLog(huffLog, srcSize, maxSymbolValue, nodeWksp, nodeWkspSize, nextHuf->CTable, countWksp, hufFlags); 3703 maxSymbolValue, huffLog, 3710 (HUF_CElt*)nextHuf->CTable, countWksp, maxSymbolValue); 3713 (HUF_CElt*)nextHuf->CTable, maxSymbolValue, huffLog, 3718 (HUF_CElt const*)prevHuf->CTable, countWksp, maxSymbolValue); 3837 unsigned maxSymbolValue = HUF_SYMBOLVALUE_MAX; 3844 size_t const largest = HIST_count_wksp (countWksp, &maxSymbolValue, (const BYTE*)literals, litSize, workspace, wkspSize) [all...] |
| /src/external/bsd/zstd/dist/lib/common/ |
| fse_decompress.c | 58 static size_t FSE_buildDTable_internal(FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize) 63 BYTE* spread = (BYTE*)(symbolNext + maxSymbolValue + 1); 65 U32 const maxSV1 = maxSymbolValue + 1; 70 if (FSE_BUILD_DTABLE_WKSP_SIZE(tableLog, maxSymbolValue) > wkspSize) return ERROR(maxSymbolValue_tooLarge); 71 if (maxSymbolValue > FSE_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge); 161 size_t FSE_buildDTable_wksp(FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize) 163 return FSE_buildDTable_internal(dt, normalizedCounter, maxSymbolValue, tableLog, workSpace, wkspSize); 252 unsigned maxSymbolValue = FSE_MAX_SYMBOL_VALUE; 265 FSE_readNCount_bmi2(wksp->ncount, &maxSymbolValue, &tableLog, istart, cSrcSize, bmi2); 273 if (FSE_DECOMPRESS_WKSP_SIZE(tableLog, maxSymbolValue) > wkspSize) return ERROR(tableLog_tooLarge) [all...] |
| huf.h | 58 #define HUF_CTABLE_SIZE_ST(maxSymbolValue) ((maxSymbolValue)+2) /* Use tables of size_t, for proper alignment */ 59 #define HUF_CTABLE_SIZE(maxSymbolValue) (HUF_CTABLE_SIZE_ST(maxSymbolValue) * sizeof(size_t)) 60 #define HUF_CREATE_STATIC_CTABLE(name, maxSymbolValue) \ 61 HUF_CElt name[HUF_CTABLE_SIZE_ST(maxSymbolValue)] /* no final ; */ 131 unsigned HUF_cardinality(const unsigned* count, unsigned maxSymbolValue); 132 unsigned HUF_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue, void* workSpace, 134 size_t HUF_writeCTable_wksp(void* dst, size_t maxDstSize, const HUF_CElt* CTable, unsigned maxSymbolValue, unsigned huffLog, void* workspace, size_t workspaceSize); 136 size_t HUF_estimateCompressedSize(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue); [all...] |
| /src/external/bsd/zstd/dist/tests/ |
| decodecorpus.c | 466 unsigned maxSymbolValue = 255; 471 { size_t const largest = HIST_count_wksp (count, &maxSymbolValue, (const BYTE*)src, srcSize, WKSP, sizeof(WKSP)); 478 /* Max Huffman log is 11, min is highbit(maxSymbolValue)+1 */ 479 huffLog = RAND_range(seed, ZSTD_highbit32(maxSymbolValue)+1, huffLog+1); 481 { size_t const maxBits = HUF_buildCTable_wksp (hufTable, count, maxSymbolValue, huffLog, WKSP, sizeof(WKSP)); 487 { size_t const hSize = HUF_writeCTable_wksp (op, dstSize, hufTable, maxSymbolValue, huffLog, WKSP, sizeof(WKSP)); 812 static void initSymbolSet(const BYTE* symbols, size_t len, BYTE* set, BYTE maxSymbolValue) 816 memset(set, 0, (size_t)maxSymbolValue+1); 823 static int isSymbolSubset(const BYTE* symbols, size_t len, const BYTE* set, BYTE maxSymbolValue) 828 if (symbols[i] > maxSymbolValue || !set[symbols[i]]) [all...] |
| fuzzer.c | 4178 unsigned const maxSymbolValue = 31; 4186 FSE_normalizeCount(norm, tableLog, count, nbSeq, maxSymbolValue, /* useLowProbCount */ 1); 4195 unsigned const maxSymbolValue = 10; 4201 FSE_writeNCount(outBuf, outBufSize, count, maxSymbolValue, tableLog);
|
| /src/external/bsd/zstd/dist/lib/legacy/ |
| zstd_v01.c | 358 (FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog) 374 if (maxSymbolValue > FSE_MAX_SYMBOL_VALUE) return (size_t)-FSE_ERROR_maxSymbolValue_tooLarge; 379 for (s=0; s<=maxSymbolValue; s++) 394 for (s=0; s<=maxSymbolValue; s++) 580 const unsigned maxSymbolValue = tableMask; 589 for (s=0; s<=maxSymbolValue; s++) 866 unsigned maxSymbolValue = FSE_MAX_SYMBOL_VALUE; 872 errorCode = FSE_readNCount (counting, &maxSymbolValue, &tableLog, istart, cSrcSize); 878 errorCode = FSE_buildDTable (dt, counting, maxSymbolValue, tableLog);
|
| zstd_v03.c | 542 Note that its size depends on 'tableLog' and 'maxSymbolValue' */ 595 #define FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue) (1 + (1<<(maxTableLog-1)) + ((maxSymbolValue+1)*2)) 1035 (FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog) 1051 if (maxSymbolValue > FSE_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge); 1056 for (s=0; s<=maxSymbolValue; s++) 1071 for (s=0; s<=maxSymbolValue; s++) 1257 const unsigned maxSymbolValue = tableMask; 1266 for (s=0; s<=maxSymbolValue; s++) 1366 unsigned maxSymbolValue = FSE_MAX_SYMBOL_VALUE [all...] |
| zstd_v04.c | 437 static size_t FSE_buildDTable ( FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog); 457 In practice, that means it's necessary to know 'maxSymbolValue' beforehand, 459 FSE_readNCount() will provide 'tableLog' and 'maxSymbolValue'. 774 #define FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue) (1 + (1<<(maxTableLog-1)) + ((maxSymbolValue+1)*2)) 1017 static size_t FSE_buildDTable(FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog) 1033 if (maxSymbolValue > FSE_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge); 1037 memset(tableDecode, 0, sizeof(FSE_DECODE_TYPE) * (maxSymbolValue+1) ); /* useless init, but keep static analyzer happy, and we don't need to performance optimize legacy decoders */ 1039 for (s=0; s<=maxSymbolValue; s++) 1054 for (s=0; s<=maxSymbolValue; s++ [all...] |
| zstd_v02.c | 541 Note that its size depends on 'tableLog' and 'maxSymbolValue' */ 594 #define FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue) (1 + (1<<(maxTableLog-1)) + ((maxSymbolValue+1)*2)) 1035 (FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog) 1051 if (maxSymbolValue > FSE_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge); 1056 for (s=0; s<=maxSymbolValue; s++) 1071 for (s=0; s<=maxSymbolValue; s++) 1257 const unsigned maxSymbolValue = tableMask; 1266 for (s=0; s<=maxSymbolValue; s++) 1366 unsigned maxSymbolValue = FSE_MAX_SYMBOL_VALUE [all...] |
| zstd_v05.c | 600 size_t FSEv05_buildDTable (FSEv05_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog); 1157 size_t FSEv05_buildDTable(FSEv05_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog) 1173 if (maxSymbolValue > FSEv05_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge); 1177 memset(tableDecode, 0, sizeof(FSEv05_FUNCTION_TYPE) * (maxSymbolValue+1) ); /* useless init, but keep static analyzer happy, and we don't need to performance optimize legacy decoders */ 1179 for (s=0; s<=maxSymbolValue; s++) { 1189 for (s=0; s<=maxSymbolValue; s++) { 1354 const unsigned maxSymbolValue = tableMask; 1363 for (s=0; s<=maxSymbolValue; s++) { 1461 unsigned maxSymbolValue = FSEv05_MAX_SYMBOL_VALUE; 1467 errorCode = FSEv05_readNCount (counting, &maxSymbolValue, &tableLog, istart, cSrcSize) [all...] |
| zstd_v06.c | 665 size_t FSEv06_buildDTable (FSEv06_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog); 684 In practice, that means it's necessary to know 'maxSymbolValue' beforehand, 686 FSEv06_readNCount() will provide 'tableLog' and 'maxSymbolValue'. 1402 size_t FSEv06_buildDTable(FSEv06_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog) 1408 U32 const maxSV1 = maxSymbolValue + 1; 1413 if (maxSymbolValue > FSEv06_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge); 1600 unsigned maxSymbolValue = FSEv06_MAX_SYMBOL_VALUE; 1605 { size_t const NCountLength = FSEv06_readNCount (counting, &maxSymbolValue, &tableLog, istart, cSrcSize); 1612 { size_t const errorCode = FSEv06_buildDTable (dt, counting, maxSymbolValue, tableLog);
|
| zstd_v07.c | 711 size_t FSEv07_buildDTable (FSEv07_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog); 730 In practice, that means it's necessary to know 'maxSymbolValue' beforehand, 732 FSEv07_readNCount() will provide 'tableLog' and 'maxSymbolValue'. 769 unsigned FSEv07_optimalTableLog_internal(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue, unsigned minus); 1423 size_t FSEv07_buildDTable(FSEv07_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog) 1429 U32 const maxSV1 = maxSymbolValue + 1; 1434 if (maxSymbolValue > FSEv07_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge); 1621 unsigned maxSymbolValue = FSEv07_MAX_SYMBOL_VALUE; 1626 { size_t const NCountLength = FSEv07_readNCount (counting, &maxSymbolValue, &tableLog, istart, cSrcSize); 1633 { size_t const errorCode = FSEv07_buildDTable (dt, counting, maxSymbolValue, tableLog) [all...] |