gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > LZSS question

#17303 - poslundc - Sat Mar 06, 2004 12:47 am

I've been looking at compressing some of my data with LZSS. I haven't decided just yet if I'm going to use the BIOS function to decompress it or write my own.

Speed isn't too much of a factor so I'm inclined to go with the BIOS, but on examining the GBATEK specification I'm a little weirded out by their data format for LZ77, in particular the data arrangment for compressed blocks. Is this a "standard" byte arrangement for LZSS? I understand how they reassemble the information from its components, but why not just use a halfword with the bottom 12 bits as your displacement and the top four bits as your length?

My main reason for caring is that I'm going to be writing an encoding tool, so I need to pick the data format that I'm going with. If I write my own routine I may still use this format if it's somehow considered "standard". Otherwise I'm not so sure.

Dan.

#17305 - tepples - Sat Mar 06, 2004 12:59 am

"Halfword"? For one thing, unlike on the x86 architecture, you can't do unaligned reads on the ARM7 architecture. Most architectures do not support unaligned reads or writes because efficient methods of unaligned memory access are patented. Therefore, the designer of a bytestream has the freedom to define everything bytewise.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.