Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
HUFFMAN
LZ77
README.md
RaspiLogo24BPP.bin
RaspiLogo24BPP.bmp

README.md

Compress


Compression Bare Metal Code by krom (Peter Lemon).

I have provided examples of LZ77 & Huffman decompression, compatible with the same standards used by
Nintendo GBA/DS bios decompression functions.
There is a simple minimal demo & a GFX demo for both LZ77 & Huffman.
The minimal demos decompress the Raspberry Pi logo to RAM.
The GFX demos decompress the Raspberry Pi logo to the screen.

The best LZ77/Huffman compressor I have found is called "Nintendo DS/GBA Compressors" by CUE.
You can find it here: http://www.romhacking.net/utilities/826/
It also includes full CPP source code for all of it's compressors.

Here is an url to the best explanation of LZ77/Huffman decompression I have found:
http://nocash.emubase.de/gbatek.htm#biosdecompressionfunctions

P.S The variant of LZ77 on GBA/NDS is sometimes called LZSS hence the naming scheme in this util,
but you will find that it is indeed LZ77 compatible data.

Huffman:
Command line used to compress data: "huffman -e8 RaspiLogo24BPP.bin"
Original data size: RaspiLogo24BPP.bin = 921600 bytes
Compress data size: RaspiLogo24BPP.huff = 241984 bytes

LZ77:
Command line used to compress data: "lzss -ewo RaspiLogo24BPP.bin"
Original data size: RaspiLogo24BPP.bin = 921600 bytes
Compress data size: RaspiLogo24BPP.lz = 135168 bytes

Many thanks to my friend Andy Smith, who helped me understand the Huffman decoding =D
You can’t perform that action at this time.