diff options
author | Lioncash <mathew1800@gmail.com> | 2020-08-15 11:25:28 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2020-08-15 23:17:56 +0200 |
commit | 1ee060ca0dfae7d0a1c830c7495f3125acf0ec7f (patch) | |
tree | 23126ca46fa87e73445002adb9422d7c6295a1da /src/common/lz4_compression.h | |
parent | common: Make use of [[nodiscard]] where applicable (diff) | |
download | yuzu-1ee060ca0dfae7d0a1c830c7495f3125acf0ec7f.tar yuzu-1ee060ca0dfae7d0a1c830c7495f3125acf0ec7f.tar.gz yuzu-1ee060ca0dfae7d0a1c830c7495f3125acf0ec7f.tar.bz2 yuzu-1ee060ca0dfae7d0a1c830c7495f3125acf0ec7f.tar.lz yuzu-1ee060ca0dfae7d0a1c830c7495f3125acf0ec7f.tar.xz yuzu-1ee060ca0dfae7d0a1c830c7495f3125acf0ec7f.tar.zst yuzu-1ee060ca0dfae7d0a1c830c7495f3125acf0ec7f.zip |
Diffstat (limited to '')
-rw-r--r-- | src/common/lz4_compression.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/common/lz4_compression.h b/src/common/lz4_compression.h index 088ff5c91..87a4be1b0 100644 --- a/src/common/lz4_compression.h +++ b/src/common/lz4_compression.h @@ -4,7 +4,6 @@ #pragma once -#include <span> #include <vector> #include "common/common_types.h" @@ -14,11 +13,12 @@ namespace Common::Compression { /** * Compresses a source memory region with LZ4 and returns the compressed data in a vector. * - * @param source the uncompressed source memory region. + * @param source The uncompressed source memory region. + * @param source_size The size of the uncompressed source memory region. * * @return the compressed data. */ -[[nodiscard]] std::vector<u8> CompressDataLZ4(std::span<const u8> source); +[[nodiscard]] std::vector<u8> CompressDataLZ4(const u8* source, std::size_t source_size); /** * Utilizes the LZ4 subalgorithm LZ4HC with the specified compression level. Higher compression @@ -26,21 +26,24 @@ namespace Common::Compression { * compression level has almost no impact on decompression speed. Data compressed with LZ4HC can * also be decompressed with the default LZ4 decompression. * - * @param source the uncompressed source memory region. - * @param compression_level the used compression level. Should be between 3 and 12. + * @param source The uncompressed source memory region. + * @param source_size The size of the uncompressed source memory region. + * @param compression_level The used compression level. Should be between 3 and 12. * * @return the compressed data. */ -[[nodiscard]] std::vector<u8> CompressDataLZ4HC(std::span<const u8> source, s32 compression_level); +[[nodiscard]] std::vector<u8> CompressDataLZ4HC(const u8* source, std::size_t source_size, + s32 compression_level); /** * Utilizes the LZ4 subalgorithm LZ4HC with the highest possible compression level. * - * @param source the uncompressed source memory region. + * @param source The uncompressed source memory region. + * @param source_size The size of the uncompressed source memory region * * @return the compressed data. */ -[[nodiscard]] std::vector<u8> CompressDataLZ4HCMax(std::span<const u8> source); +[[nodiscard]] std::vector<u8> CompressDataLZ4HCMax(const u8* source, std::size_t source_size); /** * Decompresses a source memory region with LZ4 and returns the uncompressed data in a vector. |