LZ4 Decompressor#
LZ4 decompressor LZ4 is a lossless data compression algorithm that is focused on compression and decompression speed.
It belongs to the LZ77 family of byte-oriented compression schemes.
Modules#
Typedefs#
Function to output data from LZ4 decompressor.
Function to read data into LZ4 decompressor.
Functions#
Initialize the LZ4 decompressor.
Decompress a chunk of data.
Finish decompressing data.
Macros#
LZ4 state machine: Token byte.
LZ4 state machine: Literal length byte.
LZ4 state machine: Literal value byte.
LZ4 state machine: LSB of match offset.
LZ4 state machine: MSB of match offset.
LZ4 state machine: Match length.
LZ4 state machine: Backtracking to get matched data.
Typedef Documentation#
Lz4DataWrite_t#
typedef int32_t(* Lz4DataWrite_t) (uint8_t *data, size_t length) )(uint8_t *data, size_t length)
Function to output data from LZ4 decompressor.
59
of file platform/bootloader/parser/compression/btl_decompress_lz4.h
Lz4DataRead_t#
typedef int32_t(* Lz4DataRead_t) (size_t backtrackOffset, uint8_t *data, size_t length) )(size_t backtrackOffset, uint8_t *data, size_t length)
Function to read data into LZ4 decompressor.
61
of file platform/bootloader/parser/compression/btl_decompress_lz4.h
Function Documentation#
lz4_init#
int32_t lz4_init (Lz4Context_t * ctx, Lz4DataRead_t readFunction)
Initialize the LZ4 decompressor.
N/A | ctx | Decompressor context |
N/A | readFunction | Function pointer to read back previously written data |
Returns
Error code
84
of file platform/bootloader/parser/compression/btl_decompress_lz4.h
lz4_decompress#
int32_t lz4_decompress (Lz4Context_t * ctx, void * inputData, size_t inputLength, Lz4DataWrite_t writeFunction)
Decompress a chunk of data.
N/A | ctx | Decompressor context |
N/A | inputData | Compressed input data |
N/A | inputLength | Length of inputData in bytes |
N/A | writeFunction | Function pointer that is called with decompressed data |
Returns
Error code
95
of file platform/bootloader/parser/compression/btl_decompress_lz4.h
lz4_finish#
int32_t lz4_finish (Lz4Context_t * ctx)
Finish decompressing data.
N/A | ctx | Decompressor context |
Returns
Error code indicating success or failure
Return values
BOOTLOADER_OK: on success
BOOTLOADER_ERROR_COMPRESSION_STATE: if the last block wasn't completed
109
of file platform/bootloader/parser/compression/btl_decompress_lz4.h
Macro Definition Documentation#
LZ4_STATE_TOKEN#
#define LZ4_STATE_TOKENValue:
00U
LZ4 state machine: Token byte.
44
of file platform/bootloader/parser/compression/btl_decompress_lz4.h
LZ4_STATE_LITERAL_LENGTH#
#define LZ4_STATE_LITERAL_LENGTHValue:
10U
LZ4 state machine: Literal length byte.
46
of file platform/bootloader/parser/compression/btl_decompress_lz4.h
LZ4_STATE_LITERAL_VALUE#
#define LZ4_STATE_LITERAL_VALUEValue:
20U
LZ4 state machine: Literal value byte.
48
of file platform/bootloader/parser/compression/btl_decompress_lz4.h
LZ4_STATE_OFFSET_LSB#
#define LZ4_STATE_OFFSET_LSBValue:
30U
LZ4 state machine: LSB of match offset.
50
of file platform/bootloader/parser/compression/btl_decompress_lz4.h
LZ4_STATE_OFFSET_MSB#
#define LZ4_STATE_OFFSET_MSBValue:
35U
LZ4 state machine: MSB of match offset.
52
of file platform/bootloader/parser/compression/btl_decompress_lz4.h
LZ4_STATE_MATCH_LENGTH#
#define LZ4_STATE_MATCH_LENGTHValue:
40U
LZ4 state machine: Match length.
54
of file platform/bootloader/parser/compression/btl_decompress_lz4.h
LZ4_STATE_BACKTRACKING#
#define LZ4_STATE_BACKTRACKINGValue:
50U
LZ4 state machine: Backtracking to get matched data.
56
of file platform/bootloader/parser/compression/btl_decompress_lz4.h