diff options
Diffstat (limited to '')
| -rw-r--r-- | src/common/zstd_compression.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/common/zstd_compression.h b/src/common/zstd_compression.h index 4bacf8355..c26a30ab9 100644 --- a/src/common/zstd_compression.h +++ b/src/common/zstd_compression.h | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <span> | ||
| 8 | #include <vector> | 7 | #include <vector> |
| 9 | 8 | ||
| 10 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| @@ -14,22 +13,25 @@ namespace Common::Compression { | |||
| 14 | /** | 13 | /** |
| 15 | * Compresses a source memory region with Zstandard and returns the compressed data in a vector. | 14 | * Compresses a source memory region with Zstandard and returns the compressed data in a vector. |
| 16 | * | 15 | * |
| 17 | * @param source the uncompressed source memory region. | 16 | * @param source The uncompressed source memory region. |
| 18 | * @param compression_level the used compression level. Should be between 1 and 22. | 17 | * @param source_size The size of the uncompressed source memory region. |
| 18 | * @param compression_level The used compression level. Should be between 1 and 22. | ||
| 19 | * | 19 | * |
| 20 | * @return the compressed data. | 20 | * @return the compressed data. |
| 21 | */ | 21 | */ |
| 22 | [[nodiscard]] std::vector<u8> CompressDataZSTD(std::span<const u8> source, s32 compression_level); | 22 | [[nodiscard]] std::vector<u8> CompressDataZSTD(const u8* source, std::size_t source_size, |
| 23 | s32 compression_level); | ||
| 23 | 24 | ||
| 24 | /** | 25 | /** |
| 25 | * Compresses a source memory region with Zstandard with the default compression level and returns | 26 | * Compresses a source memory region with Zstandard with the default compression level and returns |
| 26 | * the compressed data in a vector. | 27 | * the compressed data in a vector. |
| 27 | * | 28 | * |
| 28 | * @param source the uncompressed source memory region. | 29 | * @param source The uncompressed source memory region. |
| 30 | * @param source_size The size of the uncompressed source memory region. | ||
| 29 | * | 31 | * |
| 30 | * @return the compressed data. | 32 | * @return the compressed data. |
| 31 | */ | 33 | */ |
| 32 | [[nodiscard]] std::vector<u8> CompressDataZSTDDefault(std::span<const u8> source); | 34 | [[nodiscard]] std::vector<u8> CompressDataZSTDDefault(const u8* source, std::size_t source_size); |
| 33 | 35 | ||
| 34 | /** | 36 | /** |
| 35 | * Decompresses a source memory region with Zstandard and returns the uncompressed data in a vector. | 37 | * Decompresses a source memory region with Zstandard and returns the uncompressed data in a vector. |