From MultimediaWiki
Jump to navigation Jump to search
  • Company: Zoran Ltd.

This is rather simple video codec based on delta coding. Frame is split into lines, line is split into slices of width 24, 16 or 8 and each is coded using its own prediction method and delta quantisation.

Frame consists of frame header and line data packed into chunks. Word is 16-bit little-endian value (or two-byte pair when used for mode/delta coding).

Frame header

 word - should be 0x55 0xAA
 byte - header size (normally 12)
 byte - frame sequence number (reset with each new frame group)
 word - unknown, probably CRC
 byte - unknown 
 byte - probably intra frame flag (should be 0x80)
 word - frame width
 word - frame height

Line chunks

 1 byte  - should be always 0x5A
 1 byte  - chunk size in 16-bit words
 1 byte  - line number
 luma slices coding modes
 chroma slices coding modes
 luma slice data
 chroma slice data (may be just one component per line)

Line chunk coding

As mentioned above, line is split into 24-pixel slices plus a tail. Each slice can be coded using one of four different modes that are packed into bytes as two-bit variables (MSB first) and padded to the even length (the same coding is used for deltas).

Slice coding modes:

  • 0 - do not update slice from the previous frame
  • 1 - unpack deltas and add them to the slice from the previous frame
  • 2 - copy top slice (should not be present for the first line)
  • 3 - unpack deltas and use top slice for prediction (or do horizontal prediction for the first line)

Delta values are coded in the following manner:

 1 byte - quantiser
 packed delta modes
 escape values

There are four delta modes: -1, 0, 1 and escape. So when e.g. delta mode 2 is read, the output value is equal to the quantiser value. And in case of delta mode 3 the actual value is stored right after the whole mode flags.