You could use the LZ78/LZW family of algorithms with fixed dictionaries, as opposed to LZ77/LZSS sliding-window variants.tomaitheous wrote:I'm curious if anyone else has seen fixed "seeded" buffers for LZSS decompression, before the decompressor starts? The decompression engine knows the LZ window is primed with a series of values before hand and can/will access them from the very start. I saw it once in a game (it was a 4k ring buffer) and looked like it helped out for structured patterns and data like tilemaps.
To get fine-grained random access to a large map you probably want use a share a fixed dictionary in ROM for all of the blocks anyway, as small 256-byte (or thereabouts) blocks are too small for LZ77 to function effectively.
I offer my sliding-window compressor as well, if anyone is interested. It decompresses quite a bit faster than Pucrunch or Exomizer and gets compression rates somewhere between the two.tomaitheous wrote:Also, if anyone's interested, pucrunch sets up nicely for a ring buffer setup. The standalone decompresser is already written in 6502, you just need to make some minor modifications. Chris Covell has already adapted it for rom based projects, shouldn't be to much trouble to move it back over to 6502 from 6280. It works fairly decent for 256 and 512 byte ring buffers. If you don't know, a ring buffer setup allows you to decompress an LZ stream directly to an I/O port.
Though, again, if all you can spare is a 256-512 byte buffer then a fixed dictionary is probably a better solution.
I don't follow. Are you talking about decoding individual tiles within the block without having to process the whole thing?tepples wrote:That wouldn't be entirely necessary. You might traverse the quadtree a tile at a time, much like in tokumaru's decoder.doynax wrote:Hm. Presumably you'd pre-calculate/store a pointer to the start of each such 16x16 block for "random access." And avoid decoding partial blocks by extending the screen buffer by 16 tiles on each axis
You'd need to put in pointers to the internal section to do that.
Well, yeah, that was the general idea ;)tepples wrote:RLE on a space-filling curve, such as the Hilbert curve, tends to look a lot like a quadtree.doynax wrote:And to improve locality lets store the tiles within these blocks in an alternative order, say according to a space-filling curve (note that the rearrangement can be trivially implemented with some unrolled copying code.)