Lines Matching refs:srcSize

16 size_t ZSTD_noCompressLiterals (void* dst, size_t dstCapacity, const void* src, size_t srcSize)  in ZSTD_noCompressLiterals()  argument
19 U32 const flSize = 1 + (srcSize>31) + (srcSize>4095); in ZSTD_noCompressLiterals()
21 RETURN_ERROR_IF(srcSize + flSize > dstCapacity, dstSize_tooSmall, ""); in ZSTD_noCompressLiterals()
26 ostart[0] = (BYTE)((U32)set_basic + (srcSize<<3)); in ZSTD_noCompressLiterals()
29 MEM_writeLE16(ostart, (U16)((U32)set_basic + (1<<2) + (srcSize<<4))); in ZSTD_noCompressLiterals()
32 MEM_writeLE32(ostart, (U32)((U32)set_basic + (3<<2) + (srcSize<<4))); in ZSTD_noCompressLiterals()
38 ZSTD_memcpy(ostart + flSize, src, srcSize); in ZSTD_noCompressLiterals()
39 DEBUGLOG(5, "Raw literals: %u -> %u", (U32)srcSize, (U32)(srcSize + flSize)); in ZSTD_noCompressLiterals()
40 return srcSize + flSize; in ZSTD_noCompressLiterals()
43 …ze_t ZSTD_compressRleLiteralsBlock (void* dst, size_t dstCapacity, const void* src, size_t srcSize) in ZSTD_compressRleLiteralsBlock() argument
46 U32 const flSize = 1 + (srcSize>31) + (srcSize>4095); in ZSTD_compressRleLiteralsBlock()
53 ostart[0] = (BYTE)((U32)set_rle + (srcSize<<3)); in ZSTD_compressRleLiteralsBlock()
56 MEM_writeLE16(ostart, (U16)((U32)set_rle + (1<<2) + (srcSize<<4))); in ZSTD_compressRleLiteralsBlock()
59 MEM_writeLE32(ostart, (U32)((U32)set_rle + (3<<2) + (srcSize<<4))); in ZSTD_compressRleLiteralsBlock()
66 DEBUGLOG(5, "RLE literals: %u -> %u", (U32)srcSize, (U32)flSize + 1); in ZSTD_compressRleLiteralsBlock()
74 const void* src, size_t srcSize, in ZSTD_compressLiterals() argument
78 size_t const minGain = ZSTD_minGain(srcSize, strategy); in ZSTD_compressLiterals()
79 size_t const lhSize = 3 + (srcSize >= 1 KB) + (srcSize >= 16 KB); in ZSTD_compressLiterals()
81 U32 singleStream = srcSize < 256; in ZSTD_compressLiterals()
86 disableLiteralCompression, (U32)srcSize); in ZSTD_compressLiterals()
92 return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize); in ZSTD_compressLiterals()
97 if (srcSize <= minLitSize) return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize); in ZSTD_compressLiterals()
102 int const preferRepeat = strategy < ZSTD_lazy ? srcSize <= 1024 : 0; in ZSTD_compressLiterals()
106 ostart+lhSize, dstCapacity-lhSize, src, srcSize, in ZSTD_compressLiterals()
110 ostart+lhSize, dstCapacity-lhSize, src, srcSize, in ZSTD_compressLiterals()
120 if ((cLitSize==0) | (cLitSize >= srcSize - minGain) | ERR_isError(cLitSize)) { in ZSTD_compressLiterals()
122 return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize); in ZSTD_compressLiterals()
126 return ZSTD_compressRleLiteralsBlock(dst, dstCapacity, src, srcSize); in ZSTD_compressLiterals()
138 … { U32 const lhc = hType + ((!singleStream) << 2) + ((U32)srcSize<<4) + ((U32)cLitSize<<14); in ZSTD_compressLiterals()
143 { U32 const lhc = hType + (2 << 2) + ((U32)srcSize<<4) + ((U32)cLitSize<<18); in ZSTD_compressLiterals()
148 { U32 const lhc = hType + (3 << 2) + ((U32)srcSize<<4) + ((U32)cLitSize<<22); in ZSTD_compressLiterals()
156 DEBUGLOG(5, "Compressed literals: %u -> %u", (U32)srcSize, (U32)(lhSize+cLitSize)); in ZSTD_compressLiterals()