diff options
author | Lioncash <mathew1800@gmail.com> | 2020-07-25 09:17:01 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2020-07-25 09:17:04 +0200 |
commit | 2e511246fa99ad6a9f9cf1bbb8cf35a51382cd19 (patch) | |
tree | e2e052bb331844f93a84bf184b4d683ae5133956 /src/common/lz4_compression.h | |
parent | zstd_compression: Make use of std::span in interfaces (diff) | |
download | yuzu-2e511246fa99ad6a9f9cf1bbb8cf35a51382cd19.tar yuzu-2e511246fa99ad6a9f9cf1bbb8cf35a51382cd19.tar.gz yuzu-2e511246fa99ad6a9f9cf1bbb8cf35a51382cd19.tar.bz2 yuzu-2e511246fa99ad6a9f9cf1bbb8cf35a51382cd19.tar.lz yuzu-2e511246fa99ad6a9f9cf1bbb8cf35a51382cd19.tar.xz yuzu-2e511246fa99ad6a9f9cf1bbb8cf35a51382cd19.tar.zst yuzu-2e511246fa99ad6a9f9cf1bbb8cf35a51382cd19.zip |
Diffstat (limited to '')
-rw-r--r-- | src/common/lz4_compression.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/common/lz4_compression.h b/src/common/lz4_compression.h index 4c16f6e03..173f9b9ad 100644 --- a/src/common/lz4_compression.h +++ b/src/common/lz4_compression.h @@ -4,6 +4,7 @@ #pragma once +#include <span> #include <vector> #include "common/common_types.h" @@ -14,11 +15,10 @@ 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_size the size in bytes of the uncompressed source memory region. * * @return the compressed data. */ -std::vector<u8> CompressDataLZ4(const u8* source, std::size_t source_size); +std::vector<u8> CompressDataLZ4(std::span<const u8> source); /** * Utilizes the LZ4 subalgorithm LZ4HC with the specified compression level. Higher compression @@ -27,22 +27,20 @@ std::vector<u8> CompressDataLZ4(const u8* source, std::size_t source_size); * also be decompressed with the default LZ4 decompression. * * @param source the uncompressed source memory region. - * @param source_size the size in bytes of the uncompressed source memory region. * @param compression_level the used compression level. Should be between 3 and 12. * * @return the compressed data. */ -std::vector<u8> CompressDataLZ4HC(const u8* source, std::size_t source_size, s32 compression_level); +std::vector<u8> CompressDataLZ4HC(std::span<const u8> source, s32 compression_level); /** * Utilizes the LZ4 subalgorithm LZ4HC with the highest possible compression level. * * @param source the uncompressed source memory region. - * @param source_size the size in bytes of the uncompressed source memory region. * * @return the compressed data. */ -std::vector<u8> CompressDataLZ4HCMax(const u8* source, std::size_t source_size); +std::vector<u8> CompressDataLZ4HCMax(std::span<const u8> source); /** * Decompresses a source memory region with LZ4 and returns the uncompressed data in a vector. |