summaryrefslogtreecommitdiff
path: root/src/common/zstd_compression.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/common/zstd_compression.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/common/zstd_compression.h b/src/common/zstd_compression.h
index e9de941c8..b5edf19e7 100644
--- a/src/common/zstd_compression.h
+++ b/src/common/zstd_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,23 +15,21 @@ namespace Common::Compression {
14 * Compresses a source memory region with Zstandard and returns the compressed data in a vector. 15 * Compresses a source memory region with Zstandard 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 * @param compression_level the used compression level. Should be between 1 and 22. 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 */
22std::vector<u8> CompressDataZSTD(const u8* source, std::size_t source_size, s32 compression_level); 22std::vector<u8> CompressDataZSTD(std::span<const u8> source, s32 compression_level);
23 23
24/** 24/**
25 * Compresses a source memory region with Zstandard with the default compression level and returns 25 * Compresses a source memory region with Zstandard with the default compression level and returns
26 * the compressed data in a vector. 26 * the compressed data in a vector.
27 * 27 *
28 * @param source the uncompressed source memory region. 28 * @param source the uncompressed source memory region.
29 * @param source_size the size in bytes of the uncompressed source memory region.
30 * 29 *
31 * @return the compressed data. 30 * @return the compressed data.
32 */ 31 */
33std::vector<u8> CompressDataZSTDDefault(const u8* source, std::size_t source_size); 32std::vector<u8> CompressDataZSTDDefault(std::span<const u8> source);
34 33
35/** 34/**
36 * Decompresses a source memory region with Zstandard and returns the uncompressed data in a vector. 35 * Decompresses a source memory region with Zstandard and returns the uncompressed data in a vector.