LZA

From MultimediaWiki
Revision as of 01:54, 19 December 2024 by Kostya (talk | contribs) (fill description)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This is a simple animation format inspired by FLI and employing LZO for compression. It consists of a basic header followed by a number of frame chunks containing one or more blocks.

File header:

 6 bytes - "LZANIM"
 1 byte  - version
 2 bytes - number of frames
 2 bytes - width
 2 bytes - height
 4 bytes - playback speed (milliseconds per frame)

Chunk header:

 1 byte - chunk type
 2 bytes - number of blocks

Known types are 1 for the image data and 2 for VGA palette data.

Image blocks have the following header:

 2 bytes - number of lines to skip before decoding block
 1 byte  - coding method (version 2 only)
 4 bytes - block data size

Blocks with zero size are skipped, otherwise they are handled depending on coding method (it's always LZO for version 1):

  • 1 - LZO-compressed image data
  • 2 - sparse update

For sparse update data is transmitted in the following segments:

 1 byte - number of pixels to skip
 1 byte - number of pixels to copy
 N bytes - pixels to copy