LZSS Compression: Difference between revisions
Jump to navigation
Jump to search
m
consistency
>Aruki No edit summary |
>Aruki m (consistency) |
||
Line 83: | Line 83: | ||
== Example C Decompression Function == | == Example C Decompression Function == | ||
<syntaxhighlight lang="c" line start="1">bool DecompressLZSS( | <syntaxhighlight lang="c" line start="1">bool DecompressLZSS(u8 *src, u32 src_len, u8 *dst, u32 dst_len) | ||
{ | { | ||
u8 *src_end = src + src_len; | |||
u8 *dst_end = dst + dst_len; | |||
// Read compressed buffer header | // Read compressed buffer header | ||
Line 139: | Line 139: | ||
// With the count and length calculated, we'll set a pointer to where we want to read back data from: | // With the count and length calculated, we'll set a pointer to where we want to read back data from: | ||
u8 *seek = dst - length; | |||
// count refers to how many byte groups to read back; the size of one byte group varies depending on mode | // count refers to how many byte groups to read back; the size of one byte group varies depending on mode |