LZMA compression

Matt Campbell mattcampbell "at" pobox.com
Mon Feb 12 22:32:01 2007


After reading LZMA docs, it appears that it would be better to use the 
U32 and PIXEL types in my proposed encoding, instead of U16 and CPIXEL. 
  This way, assuming the common 32-bit true-color pixel format is used, 
the encoding guarantees 32-bit alignment at all levels.  According to 
the LZMA docs, aligned data helps to improve the compression ratio.  So 
in this case, premature optimization of the uncompressed stream actually 
hurts.

Another factor worth considering is the size of the LZMA dictionary, 
which is determined when initializing the compressor.  The dilemma here 
is that a larger dictionary leads to a better compression ratio, 
especially when the data contains much repetition (e.g. many similar 
screen redraws), but it also requires more memory on the decompression 
end (the viewer in this case).  The default dictionary size is 8 MB; 
this would require 8 MB of RAM on the viewer end.  This is fine for most 
desktop systems, but probably not for cell phones, PDA's, etc. -- yet 
users of these devices could probably stand to benefit the most from 
improved framebuffer compression.  Any thoughts on how best to handle 
this trade-off?

Matt