JAM

From MultimediaWiki
Jump to navigation Jump to search
  • Extension: jam

This is a simple video-only format employing LZSS scheme.

File header (all values are little-endian):

 4 bytes - "JAM\0"
 4 bytes - width
 4 bytes - height
 4 bytes - number of frames

Frame data has the following header:

 4 bytes - chunk type (0 - video, 2 - palette, 3 - some control data)
 4 bytes - compression method (0 - differential LZSS, 1 - LZSS, 2 - unpacked)
 4 bytes - packed size (including the header)
 4 bytes - unpacked size

LZSS compression

The compression is the usual one with flags being packed into 32-bit LE, LSB first. Set bit means literal, zero bit means copy. For copy mode 16-bit LE word is read, top five bits are copy length minus three, bottom eleven bits are copy offset (plus 2081 for normal mode, plus 1024 when data is copied from the previous frame).

Games using JAM