diff options
Diffstat (limited to 'src/common/lz4_compression.h')
| -rw-r--r-- | src/common/lz4_compression.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/common/lz4_compression.h b/src/common/lz4_compression.h index 4c16f6e03..87a4be1b0 100644 --- a/src/common/lz4_compression.h +++ b/src/common/lz4_compression.h | |||
| @@ -13,12 +13,12 @@ namespace Common::Compression { | |||
| 13 | /** | 13 | /** |
| 14 | * Compresses a source memory region with LZ4 and returns the compressed data in a vector. | 14 | * Compresses a source memory region with LZ4 and returns the compressed data in a vector. |
| 15 | * | 15 | * |
| 16 | * @param source the uncompressed source memory region. | 16 | * @param source The uncompressed source memory region. |
| 17 | * @param source_size the size in bytes of the uncompressed source memory region. | 17 | * @param source_size The size of the uncompressed source memory region. |
| 18 | * | 18 | * |
| 19 | * @return the compressed data. | 19 | * @return the compressed data. |
| 20 | */ | 20 | */ |
| 21 | std::vector<u8> CompressDataLZ4(const u8* source, std::size_t source_size); | 21 | [[nodiscard]] std::vector<u8> CompressDataLZ4(const u8* source, std::size_t source_size); |
| 22 | 22 | ||
| 23 | /** | 23 | /** |
| 24 | * Utilizes the LZ4 subalgorithm LZ4HC with the specified compression level. Higher compression | 24 | * Utilizes the LZ4 subalgorithm LZ4HC with the specified compression level. Higher compression |
| @@ -26,23 +26,24 @@ std::vector<u8> CompressDataLZ4(const u8* source, std::size_t source_size); | |||
| 26 | * compression level has almost no impact on decompression speed. Data compressed with LZ4HC can | 26 | * compression level has almost no impact on decompression speed. Data compressed with LZ4HC can |
| 27 | * also be decompressed with the default LZ4 decompression. | 27 | * also be decompressed with the default LZ4 decompression. |
| 28 | * | 28 | * |
| 29 | * @param source the uncompressed source memory region. | 29 | * @param source The uncompressed source memory region. |
| 30 | * @param source_size the size in bytes of the uncompressed source memory region. | 30 | * @param source_size The size of the uncompressed source memory region. |
| 31 | * @param compression_level the used compression level. Should be between 3 and 12. | 31 | * @param compression_level The used compression level. Should be between 3 and 12. |
| 32 | * | 32 | * |
| 33 | * @return the compressed data. | 33 | * @return the compressed data. |
| 34 | */ | 34 | */ |
| 35 | std::vector<u8> CompressDataLZ4HC(const u8* source, std::size_t source_size, s32 compression_level); | 35 | [[nodiscard]] std::vector<u8> CompressDataLZ4HC(const u8* source, std::size_t source_size, |
| 36 | s32 compression_level); | ||
| 36 | 37 | ||
| 37 | /** | 38 | /** |
| 38 | * Utilizes the LZ4 subalgorithm LZ4HC with the highest possible compression level. | 39 | * Utilizes the LZ4 subalgorithm LZ4HC with the highest possible compression level. |
| 39 | * | 40 | * |
| 40 | * @param source the uncompressed source memory region. | 41 | * @param source The uncompressed source memory region. |
| 41 | * @param source_size the size in bytes of the uncompressed source memory region. | 42 | * @param source_size The size of the uncompressed source memory region |
| 42 | * | 43 | * |
| 43 | * @return the compressed data. | 44 | * @return the compressed data. |
| 44 | */ | 45 | */ |
| 45 | std::vector<u8> CompressDataLZ4HCMax(const u8* source, std::size_t source_size); | 46 | [[nodiscard]] std::vector<u8> CompressDataLZ4HCMax(const u8* source, std::size_t source_size); |
| 46 | 47 | ||
| 47 | /** | 48 | /** |
| 48 | * Decompresses a source memory region with LZ4 and returns the uncompressed data in a vector. | 49 | * Decompresses a source memory region with LZ4 and returns the uncompressed data in a vector. |
| @@ -52,6 +53,7 @@ std::vector<u8> CompressDataLZ4HCMax(const u8* source, std::size_t source_size); | |||
| 52 | * | 53 | * |
| 53 | * @return the decompressed data. | 54 | * @return the decompressed data. |
| 54 | */ | 55 | */ |
| 55 | std::vector<u8> DecompressDataLZ4(const std::vector<u8>& compressed, std::size_t uncompressed_size); | 56 | [[nodiscard]] std::vector<u8> DecompressDataLZ4(const std::vector<u8>& compressed, |
| 57 | std::size_t uncompressed_size); | ||
| 56 | 58 | ||
| 57 | } // namespace Common::Compression \ No newline at end of file | 59 | } // namespace Common::Compression \ No newline at end of file |