CDXL

From MultimediaWiki
Jump to: navigation, search

CDXL is an uncompressed video format created by Commodore for playback from CD-ROM on Amiga computers.

File format

CDXL files have no identifying markers or file headers; the file contains a number of frames, each prefixed by a frame header.

 Frame header | Palette | Video | Audio

All multi-byte integers are big endian.

Frame header

 byte 0        File type
 byte 1        Info byte
   bits 0-2      Video encoding
   bit 3         Stereo flag
   bits 5-7      Plane arrangement
 bytes 2-5     Current chunk size
 bytes 6-9     Previous chunk size
 bytes 10-11   Reserved
 bytes 12-13   Current frame number (1 for first frame)
 bytes 14-15   Video width
 bytes 16-17   Video height
 bytes 18-19   Number of bit planes
 bytes 20-21   Palette size in bytes
 bytes 22-23   Sound size in bytes
 bytes 24-31   Reserved

File type values (it is unknown what these mean):

 0  Custom CDXL
 1  Standard CDXL
 2  Special CDXL

Video encoding values:

 0  RGB
 1  HAM
 2  YUV
 3  AVM & DCTV

Plane arrangement values:

 0  Bit planar
 1  Byte planar
 2  Chunky
 4  Bit line
 6  Byte line

Palette

The palette is encoded as 12-bit RGB values (4 bits each of R, G, and B) stored in 16-bit words with the upper 4 bits unused and set to 0. The palette size field in the header is the number of bytes in the palette, i.e. double the number of entries in the palette.

Audio

Audio is encoded in standard uncompressed signed 8-bit PCM. The CDXL file itself does not seem to contain any sampling rate information, although related documents suggest 11025 Hz is standard.

Video

Video is encoded differently based on the info byte in the header.

RGB is encoded as an index into the palette for the current frame.

HAM (Hold-And-Modify), an Amiga-specific video mode, is encoded as described on Wikipedia. The sample at http://samples.mplayerhq.hu/game-formats/cdxl/amigaball.cdxl at least seems to use the HAM6 method, since it has 32 bytes of palette (i.e. 16 palette entries).