3#include <ntr/ntr_Include.hpp>
7 enum class LzVersion : u8 {
14 constexpr size_t MaximumLZ10CompressSize = 1ul <<
static_cast<size_t>(3 * CHAR_BIT);
17 constexpr u64 MaximumLZ11CompressSize = 1ull <<
static_cast<u64
>(4 * CHAR_BIT);
19 constexpr u32 LZ10RepeatSize = 18;
20 constexpr u32 MaximumLZ11RepeatSize = 65809;
21 constexpr u32 DefaultRepeatSize = LZ10RepeatSize;
23 Result LzValidateCompressed(
const u32 lz_header, LzVersion &out_ver);
25 Result LzCompress(
const u8 *data,
const size_t data_size,
const LzVersion ver,
const u32 repeat_size, u8 *&out_data,
size_t &out_size);
27 inline Result LzCompressDefault(
const u8 *data,
const size_t data_size,
const LzVersion ver, u8 *&out_data,
size_t &out_size) {
28 return LzCompress(data, data_size, ver, DefaultRepeatSize, out_data, out_size);
31 Result LzDecompress(
const u8 *data, u8 *&out_data,
size_t &out_size, LzVersion &out_ver,
size_t &out_used_data_size);