AnimaEngine  1.0.0
Nintendo DS Pokemon Black, White, Black 2, and White 2 sprite extraction and preview toolchain
Functions
lz.c File Reference
#include "lz.h"

Functions

static u32 ReadU24LE (const u8 *p)
 
CompressionType Lz_Detect (const u8 *data, size_t size)
 Auto-detects the compression format of a data buffer by inspecting its header byte. More...
 
const char * Lz_CompressionName (CompressionType type)
 Returns a human-readable name string for a CompressionType enum. More...
 
static int Lz_Decompress10 (const u8 *in_data, size_t in_size, u8 **out_data, size_t *out_size)
 
static int Lz_Decompress11 (const u8 *in_data, size_t in_size, u8 **out_data, size_t *out_size)
 
int Lz_Decompress (const u8 *in_data, size_t in_size, u8 **out_data, size_t *out_size, CompressionType *out_type)
 Decompresses an LZ10 or LZ11 compressed data stream. More...
 

Function Documentation

◆ Lz_CompressionName()

const char* Lz_CompressionName ( CompressionType  type)

Returns a human-readable name string for a CompressionType enum.

Parameters
typeThe compression type.
Returns
Read-only string description of compression algorithm.

◆ Lz_Decompress()

int Lz_Decompress ( const u8 in_data,
size_t  in_size,
u8 **  out_data,
size_t *  out_size,
CompressionType out_type 
)

Decompresses an LZ10 or LZ11 compressed data stream.

Parameters
in_dataPointer to the raw compressed source buffer.
in_sizeSize of the compressed data stream in bytes.
out_dataPointer to the destination buffer pointer, allocated inside this function.
out_sizePointer to store the size of the decompressed output buffer.
out_typeOptional output pointer to store the detected compression format.
Returns
0 on success; negative value on invalid headers or decompression buffer overflow.

◆ Lz_Decompress10()

static int Lz_Decompress10 ( const u8 in_data,
size_t  in_size,
u8 **  out_data,
size_t *  out_size 
)
static

◆ Lz_Decompress11()

static int Lz_Decompress11 ( const u8 in_data,
size_t  in_size,
u8 **  out_data,
size_t *  out_size 
)
static

◆ Lz_Detect()

CompressionType Lz_Detect ( const u8 data,
size_t  size 
)

Auto-detects the compression format of a data buffer by inspecting its header byte.

Parameters
dataPointer to raw data buffer.
sizeBuffer size in bytes.
Returns
Detected compression category.

◆ ReadU24LE()

static u32 ReadU24LE ( const u8 p)
static