summaryrefslogtreecommitdiff
path: root/src/common/lz4_compression.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/lz4_compression.h')
-rw-r--r--src/common/lz4_compression.h10
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 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <span>
7#include <vector> 8#include <vector>
8 9
9#include "common/common_types.h" 10#include "common/common_types.h"
@@ -14,11 +15,10 @@ namespace Common::Compression {
14 * Compresses a source memory region with LZ4 and returns the compressed data in a vector. 15 * Compresses a source memory region with LZ4 and returns the compressed data in a vector.
15 * 16 *
16 * @param source the uncompressed source memory region. 17 * @param source the uncompressed source memory region.
17 * @param source_size the size in bytes of the uncompressed source memory region.
18 * 18 *
19 * @return the compressed data. 19 * @return the compressed data.
20 */ 20 */
21std::vector<u8> CompressDataLZ4(const u8* source, std::size_t source_size); 21std::vector<u8> CompressDataLZ4(std::span<const u8> source);
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
@@ -27,22 +27,20 @@ std::vector<u8> CompressDataLZ4(const u8* source, std::size_t source_size);
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.
31 * @param compression_level the used compression level. Should be between 3 and 12. 30 * @param compression_level the used compression level. Should be between 3 and 12.
32 * 31 *
33 * @return the compressed data. 32 * @return the compressed data.
34 */ 33 */
35std::vector<u8> CompressDataLZ4HC(const u8* source, std::size_t source_size, s32 compression_level); 34std::vector<u8> CompressDataLZ4HC(std::span<const u8> source, s32 compression_level);
36 35
37/** 36/**
38 * Utilizes the LZ4 subalgorithm LZ4HC with the highest possible compression level. 37 * Utilizes the LZ4 subalgorithm LZ4HC with the highest possible compression level.
39 * 38 *
40 * @param source the uncompressed source memory region. 39 * @param source the uncompressed source memory region.
41 * @param source_size the size in bytes of the uncompressed source memory region.
42 * 40 *
43 * @return the compressed data. 41 * @return the compressed data.
44 */ 42 */
45std::vector<u8> CompressDataLZ4HCMax(const u8* source, std::size_t source_size); 43std::vector<u8> CompressDataLZ4HCMax(std::span<const u8> source);
46 44
47/** 45/**
48 * Decompresses a source memory region with LZ4 and returns the uncompressed data in a vector. 46 * Decompresses a source memory region with LZ4 and returns the uncompressed data in a vector.