![]() |
libdragon
|
Data Structures | |
struct | lz4dec_faststate_t |
Fast-access state of the LZ4 algorithm (streaming version). More... | |
struct | lz4dec_state_t |
State of the LZ4 algorithm (streaming version). More... | |
Macros | |
#define | MIN_MATCH_SIZE 4 |
Minimum match size for LZ4. | |
#define | LITERALS_RUN_LEN 15 |
Maximum run length for literals in LZ4. | |
#define | MATCH_RUN_LEN 15 |
Maximum run length for matches in LZ4. | |
#define | LZ4ULTRA_DECOMPRESSOR_BUILD_LEN(__len) |
Decode multi-byte length. | |
Functions | |
int | decompress_lz4_full_inplace (const unsigned char *pInBlock, size_t nBlockSize, unsigned char *pOutData, size_t nBlockMaxSize) |
void | decompress_lz4_init (void *state, int fd, int winsize) |
Initialize the LZ4 decompressor state. | |
void | decompress_lz4_reset (void *state) |
Reset the LZ4 decompressor state. | |
ssize_t | decompress_lz4_read (void *state, void *buf, size_t len) |
Read decompressed data from the LZ4 stream. | |
struct lz4dec_faststate_t |
Fast-access state of the LZ4 algorithm (streaming version).
See the LZ4 block format for a better understanding of the fields.
struct lz4dec_state_t |
State of the LZ4 algorithm (streaming version).
Data Fields | ||
---|---|---|
uint8_t | buf[128] | File buffer. |
int | fd | File descriptor to read from. |
int | buf_idx | Current index in the file buffer. |
int | buf_size | Size of the file buffer. |
bool | eof | True if we reached the end of the file. |
lz4dec_faststate_t | st | Fast-access state. |
decompress_ringbuf_t | ringbuf | Ring buffer. |
#define LZ4ULTRA_DECOMPRESSOR_BUILD_LEN | ( | __len | ) |
Decode multi-byte length.
int decompress_lz4_full_inplace | ( | const unsigned char * | pInBlock, |
size_t | nBlockSize, | ||
unsigned char * | pOutData, | ||
size_t | nBlockMaxSize | ||
) |
Decompress one data block
pInBlock | pointer to compressed data |
nBlockSize | size of compressed data, in bytes |
pOutData | pointer to output decompression buffer (previously decompressed bytes + room for decompressing this block) |
nBlockMaxSize | total size of output decompression buffer, in bytes |
void decompress_lz4_init | ( | void * | state, |
int | fd, | ||
int | winsize | ||
) |
Initialize the LZ4 decompressor state.
state | Pointer to the decompressor state buffer. |
fd | File descriptor to read compressed data from. |
winsize | Window size for the decompressor. |
void decompress_lz4_reset | ( | void * | state | ) |
Reset the LZ4 decompressor state.
state | Pointer to the decompressor state buffer. |
ssize_t decompress_lz4_read | ( | void * | state, |
void * | buf, | ||
size_t | len | ||
) |
Read decompressed data from the LZ4 stream.
state | Pointer to the decompressor state buffer. |
buf | Buffer to store decompressed data. |
len | Number of bytes to read. |