* Modified copy of ZSTD_COMPRESSBOUND / ZSTD_compressBound() from zstd 1.5.7, with the argument * type changed from size_t (which may be only 32 bits) to uint64_t, and removes the error handling. */
| 145 | * type changed from size_t (which may be only 32 bits) to uint64_t, and removes the error handling. |
| 146 | */ |
| 147 | static uint64_t zstdCompressBound(uint64_t length) |
| 148 | { |
| 149 | return length + (length >> 8) |
| 150 | + ((length < (128uLL << 10)) ? (((128uLL << 10) - length) >> 11) /* margin, from 64 to 0 */ : 0uLL); |
| 151 | } |
| 152 | |
| 153 | bool zstdCompress(IStream& source, uint64_t sourceLength, IStream& dest, ZstdMetadata metadata, int16_t level) |
| 154 | { |