/lib/zstd/ |
D | zstd_internal.h | 68 static const U32 repStartValue[ZSTD_REP_NUM] = {1, 4, 8}; 110 static const U32 LL_bits[MaxLL + 1] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, … 113 static const U32 LL_defaultNormLog = LL_DEFAULTNORMLOG; 115 static const U32 ML_bits[MaxML + 1] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, … 120 static const U32 ML_defaultNormLog = ML_DEFAULTNORMLOG; 124 static const U32 OF_defaultNormLog = OF_DEFAULTNORMLOG; 160 U32 off; 161 U32 len; 165 U32 price; 166 U32 off; [all …]
|
D | compress.c | 31 static const U32 g_searchStrength = 8; /* control skip over incompressible data */ 57 U32 dictLimit; /* below that point, need extDict */ 58 U32 lowLimit; /* below that point, no more data */ 59 U32 nextToUpdate; /* index from which to continue dictionary update */ 60 U32 nextToUpdate3; /* index from which to continue dictionary update */ 61 U32 hashLog3; /* dispatch table : larger == faster, more memory */ 62 U32 loadedDictEnd; /* index of end of dictionary */ 63 U32 forceWindow; /* force back-references to respect limit of 1<<wLog, even for dictionary */ 64 U32 forceRawDict; /* Force loading dictionary in "content-only" mode (no header analysis) */ 66 U32 rep[ZSTD_REP_NUM]; [all …]
|
D | huf_compress.c | 88 U32 maxSymbolValue = HUF_TABLELOG_MAX; in HUF_compressWeights_wksp() 89 U32 tableLog = MAX_FSE_TABLELOG_FOR_HUFF_HEADER; in HUF_compressWeights_wksp() 92 U32 *count; in HUF_compressWeights_wksp() 96 HUF_STATIC_ASSERT(sizeof(FSE_CTable) == sizeof(U32)); in HUF_compressWeights_wksp() 98 CTable = (FSE_CTable *)((U32 *)workspace + spaceUsed32); in HUF_compressWeights_wksp() 100 count = (U32 *)workspace + spaceUsed32; in HUF_compressWeights_wksp() 102 norm = (S16 *)((U32 *)workspace + spaceUsed32); in HUF_compressWeights_wksp() 103 spaceUsed32 += ALIGN(sizeof(S16) * (HUF_TABLELOG_MAX + 1), sizeof(U32)) >> 2; in HUF_compressWeights_wksp() 107 workspace = (U32 *)workspace + spaceUsed32; in HUF_compressWeights_wksp() 152 …Table_wksp(void *dst, size_t maxDstSize, const HUF_CElt *CTable, U32 maxSymbolValue, U32 huffLog, … in HUF_writeCTable_wksp() [all …]
|
D | fse_compress.c | 94 U32 const tableSize = 1 << tableLog; in FSE_buildCTable_wksp() 95 U32 const tableMask = tableSize - 1; in FSE_buildCTable_wksp() 98 void *const FSCT = ((U32 *)ptr) + 1 /* header */ + (tableLog ? tableSize >> 1 : 1); in FSE_buildCTable_wksp() 100 U32 const step = FSE_TABLESTEP(tableSize); in FSE_buildCTable_wksp() 101 U32 highThreshold = tableSize - 1; in FSE_buildCTable_wksp() 103 U32 *cumul; in FSE_buildCTable_wksp() 107 cumul = (U32 *)workspace + spaceUsed32; in FSE_buildCTable_wksp() 109 tableSymbol = (FSE_FUNCTION_TYPE *)((U32 *)workspace + spaceUsed32); in FSE_buildCTable_wksp() 110 spaceUsed32 += ALIGN(sizeof(FSE_FUNCTION_TYPE) * ((size_t)1 << tableLog), sizeof(U32)) >> 2; in FSE_buildCTable_wksp() 114 workspace = (U32 *)workspace + spaceUsed32; in FSE_buildCTable_wksp() [all …]
|
D | huf_decompress.c | 92 U32 tableLog = 0; in HUF_readDTableX2_wksp() 93 U32 nbSymbols = 0; in HUF_readDTableX2_wksp() 98 U32 *rankVal; in HUF_readDTableX2_wksp() 102 rankVal = (U32 *)workspace + spaceUsed32; in HUF_readDTableX2_wksp() 104 huffWeight = (BYTE *)((U32 *)workspace + spaceUsed32); in HUF_readDTableX2_wksp() 105 spaceUsed32 += ALIGN(HUF_SYMBOLVALUE_MAX + 1, sizeof(U32)) >> 2; in HUF_readDTableX2_wksp() 109 workspace = (U32 *)workspace + spaceUsed32; in HUF_readDTableX2_wksp() 122 if (tableLog > (U32)(dtd.maxTableLog + 1)) in HUF_readDTableX2_wksp() 131 U32 n, nextRankStart = 0; in HUF_readDTableX2_wksp() 133 U32 const curr = nextRankStart; in HUF_readDTableX2_wksp() [all …]
|
D | mem.h | 38 typedef uint32_t U32; typedef 61 ZSTD_STATIC U32 ZSTD_read32(const void *memPtr) { return get_unaligned((const U32 *)memPtr); } in ZSTD_read32() 69 ZSTD_STATIC void ZSTD_write32(void *memPtr, U32 value) { put_unaligned(value, (U32 *)memPtr); } in ZSTD_write32() 79 ZSTD_STATIC U32 ZSTD_readLE24(const void *memPtr) { return ZSTD_readLE16(memPtr) + (((const BYTE *)… in ZSTD_readLE24() 81 ZSTD_STATIC void ZSTD_writeLE24(void *memPtr, U32 val) in ZSTD_writeLE24() 87 ZSTD_STATIC U32 ZSTD_readLE32(const void *memPtr) { return get_unaligned_le32(memPtr); } in ZSTD_readLE32() 89 ZSTD_STATIC void ZSTD_writeLE32(void *memPtr, U32 val32) { put_unaligned_le32(val32, memPtr); } in ZSTD_writeLE32() 106 ZSTD_writeLE32(memPtr, (U32)val); in ZSTD_writeLEST() 113 ZSTD_STATIC U32 ZSTD_readBE32(const void *memPtr) { return get_unaligned_be32(memPtr); } in ZSTD_readBE32() 115 ZSTD_STATIC void ZSTD_writeBE32(void *memPtr, U32 val32) { put_unaligned_be32(val32, memPtr); } in ZSTD_writeBE32() [all …]
|
D | zstd_opt.h | 101 FORCE_INLINE U32 ZSTD_getLiteralPrice(seqStore_t *ssPtr, U32 litLength, const BYTE *literals) in ZSTD_getLiteralPrice() 103 U32 price, u; in ZSTD_getLiteralPrice() 106 return ZSTD_highbit32((U32)litLength + 1) + (litLength * 6); in ZSTD_getLiteralPrice() 113 U32 const additional = litLength - ssPtr->cachedLitLength; in ZSTD_getLiteralPrice() 142 FORCE_INLINE U32 ZSTD_getPrice(seqStore_t *seqStorePtr, U32 litLength, const BYTE *literals, U32 of… in ZSTD_getPrice() 145 U32 price; in ZSTD_getPrice() 149 …return ZSTD_getLiteralPrice(seqStorePtr, litLength, literals) + ZSTD_highbit32((U32)matchLength + … in ZSTD_getPrice() 165 …IC void ZSTD_updatePrice(seqStore_t *seqStorePtr, U32 litLength, const BYTE *literals, U32 offset,… in ZSTD_updatePrice() 167 U32 u; in ZSTD_updatePrice() 215 U32 ZSTD_insertAndFindFirstIndexHash3(ZSTD_CCtx *zc, const BYTE *ip) in ZSTD_insertAndFindFirstIndexHash3() [all …]
|
D | entropy_common.c | 67 U32 bitStream; in FSE_readNCount() 121 if ((bitStream & (threshold - 1)) < (U32)max) { in FSE_readNCount() 167 size_t HUF_readStats_wksp(BYTE *huffWeight, size_t hwSize, U32 *rankStats, U32 *nbSymbolsPtr, U32 *… in HUF_readStats_wksp() 169 U32 weightTotal; in HUF_readStats_wksp() 188 U32 n; in HUF_readStats_wksp() 203 memset(rankStats, 0, (HUF_TABLELOG_MAX + 1) * sizeof(U32)); in HUF_readStats_wksp() 206 U32 n; in HUF_readStats_wksp() 219 U32 const tableLog = BIT_highbit32(weightTotal) + 1; in HUF_readStats_wksp() 225 U32 const total = 1 << tableLog; in HUF_readStats_wksp() 226 U32 const rest = total - weightTotal; in HUF_readStats_wksp() [all …]
|
D | huf.h | 83 U32 name##hb[maxSymbolValue + 1]; \ 88 typedef U32 HUF_DTable; 90 …ble, maxTableLog) HUF_DTable DTable[HUF_DTABLE_SIZE((maxTableLog)-1)] = {((U32)((maxTableLog)-1) *… 91 …(DTable, maxTableLog) HUF_DTable DTable[HUF_DTABLE_SIZE(maxTableLog)] = {((U32)(maxTableLog)*0x010… 95 #define HUF_COMPRESS_WORKSPACE_SIZE_U32 (HUF_COMPRESS_WORKSPACE_SIZE / sizeof(U32)) 99 #define HUF_DECOMPRESS_WORKSPACE_SIZE_U32 (HUF_DECOMPRESS_WORKSPACE_SIZE / sizeof(U32)) 152 size_t HUF_buildCTable_wksp(HUF_CElt *tree, const U32 *count, U32 maxSymbolValue, U32 maxNbBits, vo… 159 size_t HUF_readStats_wksp(BYTE *huffWeight, size_t hwSize, U32 *rankStats, U32 *nbSymbolsPtr, U32 *… 178 U32 HUF_selectDecoder(size_t dstSize, size_t cSrcSize);
|
D | bitstream.h | 61 #define STREAM_ACCUMULATOR_MIN ((U32)(ZSTD_32bits() ? STREAM_ACCUMULATOR_MIN_32 : STREAM_ACCUMULATO… 148 ZSTD_STATIC unsigned BIT_highbit32(register U32 val) { return 31 - __builtin_clz(val); } in BIT_highbit32() 280 bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize) * 8; in BIT_initDStream() 286 ZSTD_STATIC size_t BIT_getUpperBits(size_t bitContainer, U32 const start) { return bitContainer >> … in BIT_getUpperBits() 288 ZSTD_STATIC size_t BIT_getMiddleBits(size_t bitContainer, U32 const start, U32 const nbBits) { retu… in BIT_getMiddleBits() 290 ZSTD_STATIC size_t BIT_getLowerBits(size_t bitContainer, U32 const nbBits) { return bitContainer & … in BIT_getLowerBits() 299 ZSTD_STATIC size_t BIT_lookBits(const BIT_DStream_t *bitD, U32 nbBits) in BIT_lookBits() 301 U32 const bitMask = sizeof(bitD->bitContainer) * 8 - 1; in BIT_lookBits() 307 ZSTD_STATIC size_t BIT_lookBitsFast(const BIT_DStream_t *bitD, U32 nbBits) in BIT_lookBitsFast() 309 U32 const bitMask = sizeof(bitD->bitContainer) * 8 - 1; in BIT_lookBitsFast() [all …]
|
D | fse_decompress.c | 101 U32 const maxSV1 = maxSymbolValue + 1; in FSE_buildDTable_wksp() 102 U32 const tableSize = 1 << tableLog; in FSE_buildDTable_wksp() 103 U32 highThreshold = tableSize - 1; in FSE_buildDTable_wksp() 120 U32 s; in FSE_buildDTable_wksp() 137 U32 const tableMask = tableSize - 1; in FSE_buildDTable_wksp() 138 U32 const step = FSE_TABLESTEP(tableSize); in FSE_buildDTable_wksp() 139 U32 s, position = 0; in FSE_buildDTable_wksp() 155 U32 u; in FSE_buildDTable_wksp() 159 tableDecode[u].nbBits = (BYTE)(tableLog - BIT_highbit32((U32)nextState)); in FSE_buildDTable_wksp() 286 const U32 fastMode = DTableH->fastMode; in FSE_decompress_usingDTable() [all …]
|
D | fse.h | 424 U32 deltaNbBits; 431 const U32 tableLog = ZSTD_read16(ptr); in FSE_initCState() 434 statePtr->symbolTT = ((const U32 *)ct + 1 + (tableLog ? (1 << (tableLog - 1)) : 1)); in FSE_initCState() 441 ZSTD_STATIC void FSE_initCState2(FSE_CState_t *statePtr, const FSE_CTable *ct, U32 symbol) in FSE_initCState2() 447 U32 nbBitsOut = (U32)((symbolTT.deltaNbBits + (1 << 15)) >> 16); in FSE_initCState2() 453 ZSTD_STATIC void FSE_encodeSymbol(BIT_CStream_t *bitC, FSE_CState_t *statePtr, U32 symbol) in FSE_encodeSymbol() 457 U32 nbBitsOut = (U32)((statePtr->value + symbolTT.deltaNbBits) >> 16); in FSE_encodeSymbol() 499 U32 const nbBits = DInfo.nbBits; in FSE_updateState() 507 U32 const nbBits = DInfo.nbBits; in FSE_decodeSymbol() 520 U32 const nbBits = DInfo.nbBits; in FSE_decodeSymbolFast()
|
D | decompress.c | 74 U32 rep[ZSTD_REP_NUM]; 91 U32 litEntropy; 92 U32 fseEntropy; 95 U32 dictID; 177 U32 const magic = ZSTD_readLE32(buffer); in ZSTD_isFrame() 195 U32 const dictID = fhd & 3; in ZSTD_frameHeaderSize() 196 U32 const singleSegment = (fhd >> 5) & 1; in ZSTD_frameHeaderSize() 197 U32 const fcsId = fhd >> 6; in ZSTD_frameHeaderSize() 235 U32 const dictIDSizeCode = fhdByte & 3; in ZSTD_getFrameParams() 236 U32 const checksumFlag = (fhdByte >> 2) & 1; in ZSTD_getFrameParams() [all …]
|
/lib/lz4/ |
D | lz4defs.h | 50 typedef uint32_t U32; typedef 110 static FORCE_INLINE U32 LZ4_read32(const void *ptr) in LZ4_read32() 112 return get_unaligned((const U32 *)ptr); in LZ4_read32() 125 static FORCE_INLINE void LZ4_write32(void *memPtr, U32 value) in LZ4_write32() 127 put_unaligned(value, (U32 *)memPtr); in LZ4_write32() 149 U32 a = get_unaligned((const U32 *)src); in LZ4_copy8() 150 U32 b = get_unaligned((const U32 *)src + 1); in LZ4_copy8() 152 put_unaligned(a, (U32 *)dst); in LZ4_copy8() 153 put_unaligned(b, (U32 *)dst + 1); in LZ4_copy8()
|
D | lz4_compress.c | 48 static FORCE_INLINE U32 LZ4_hash4( in LZ4_hash4() 49 U32 sequence, in LZ4_hash4() 60 static FORCE_INLINE U32 LZ4_hash5( in LZ4_hash5() 64 const U32 hashLog = (tableType == byU16) in LZ4_hash5() 71 return (U32)(((sequence << 24) * prime5bytes) >> (64 - hashLog)); in LZ4_hash5() 75 return (U32)(((sequence >> 24) * prime8bytes) >> (64 - hashLog)); in LZ4_hash5() 79 static FORCE_INLINE U32 LZ4_hashPosition( in LZ4_hashPosition() 93 U32 h, in LZ4_putPositionOnHash() 108 U32 *hashTable = (U32 *) tableBase; in LZ4_putPositionOnHash() 110 hashTable[h] = (U32)(p - srcBase); in LZ4_putPositionOnHash() [all …]
|
D | lz4hc_compress.c | 53 static U32 LZ4HC_hashPtr(const void *ptr) in LZ4HC_hashPtr() 78 U32 * const hashTable = hc4->hashTable; in LZ4HC_Insert() 80 U32 const target = (U32)(ip - base); in LZ4HC_Insert() 81 U32 idx = hc4->nextToUpdate; in LZ4HC_Insert() 84 U32 const h = LZ4HC_hashPtr(base + idx); in LZ4HC_Insert() 107 U32 * const HashTable = hc4->hashTable; in LZ4HC_InsertAndFindBestMatch() 110 const U32 dictLimit = hc4->dictLimit; in LZ4HC_InsertAndFindBestMatch() 111 const U32 lowLimit = (hc4->lowLimit + 64 * KB > (U32)(ip - base)) in LZ4HC_InsertAndFindBestMatch() 113 : (U32)(ip - base) - (64 * KB - 1); in LZ4HC_InsertAndFindBestMatch() 114 U32 matchIndex; in LZ4HC_InsertAndFindBestMatch() [all …]
|
D | lz4_decompress.c | 308 LZ4_write32(op, (U32)offset); in LZ4_decompress_generic()
|