<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multimedia.cx/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kostya</id>
	<title>MultimediaWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multimedia.cx/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kostya"/>
	<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php/Special:Contributions/Kostya"/>
	<updated>2026-08-19T05:44:11Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Lego_Pirates_of_the_Caribbean_FMV&amp;diff=16150</id>
		<title>Lego Pirates of the Caribbean FMV</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Lego_Pirates_of_the_Caribbean_FMV&amp;diff=16150"/>
		<updated>2026-07-24T16:27:14Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Game: [https://www.mobygames.com/game/77264/lego-pirates-of-the-caribbean-the-video-game/ LEGO Pirates of the Caribbean]&lt;br /&gt;
* Decoder: [https://github.com/Gericom/EveryFileExplorer/blob/master/LegoPirates/FMV.cs Every File Explorer REd decoder]&lt;br /&gt;
&lt;br /&gt;
This seems to be a JPEG-based cutscene format with optional audio.&lt;br /&gt;
&lt;br /&gt;
Header:&lt;br /&gt;
  4 bytes - &amp;quot;FMV!&amp;quot;&lt;br /&gt;
  2 bytes - version&lt;br /&gt;
  2 bytes - header length&lt;br /&gt;
  2 bytes - width&lt;br /&gt;
  2 bytes - height&lt;br /&gt;
  4 bytes - total number of macroblocks?&lt;br /&gt;
  4 bytes - unknown&lt;br /&gt;
  2 bytes - framerate&lt;br /&gt;
  4 bytes - flags (4 - audio present)&lt;br /&gt;
  4 bytes - unknown&lt;br /&gt;
&lt;br /&gt;
Audio header (if flag bit 2 is set):&lt;br /&gt;
  2 bytes - unknown&lt;br /&gt;
  4 bytes - sample rate&lt;br /&gt;
  1 byte  - unknown&lt;br /&gt;
  1 byte  - unknown&lt;br /&gt;
  1 byte  - unknown&lt;br /&gt;
  1 byte  - unknown&lt;br /&gt;
&lt;br /&gt;
The rest of the file seems to be composed of chunks with the following signatures and 32-bit payload sizes:&lt;br /&gt;
* &amp;quot;FMVk&amp;quot; - key frame&lt;br /&gt;
* &amp;quot;FMVd&amp;quot; - delta frame&lt;br /&gt;
* &amp;quot;FMVn&amp;quot; - no frame (repeat last decoded frame)&lt;br /&gt;
* &amp;quot;FMA\0&amp;quot; - audio data&lt;br /&gt;
&lt;br /&gt;
Key frame data:&lt;br /&gt;
  4 bytes - &amp;quot;FMVk&amp;quot;&lt;br /&gt;
  4 bytes - data size&lt;br /&gt;
  2 bytes - metadata size&lt;br /&gt;
  N bytes - RLE-compressed metadata&lt;br /&gt;
  1 byte  - quality&lt;br /&gt;
  (first frame only) Huffman data&lt;br /&gt;
  encoded macroblocks&lt;br /&gt;
&lt;br /&gt;
Delta frame data:&lt;br /&gt;
  4 bytes - &amp;quot;FMVd&amp;quot;&lt;br /&gt;
  4 bytes - data size&lt;br /&gt;
  2 bytes - metadata size&lt;br /&gt;
  N bytes - RLE-compressed metadata&lt;br /&gt;
  1 byte  - quality&lt;br /&gt;
  encoded macroblocks&lt;br /&gt;
&lt;br /&gt;
Frame metadata is macroblock coding types using RLE scheme using a twice repeated value as a trigger for run mode. Next byte in this case tells what to do (0-2: repeat last byte 1-3 times, 128-255 means this byte contains top 7 bits of run length and next byte is low 8 bits of it, otherwise it is run length and the next byte should be repeated N+1 times).&lt;br /&gt;
&lt;br /&gt;
Quality value is used to generate luma and chroma quantisation matrices in the same way as &amp;lt;code&amp;gt;libjpeg&amp;lt;/code&amp;gt; does.&lt;br /&gt;
&lt;br /&gt;
Huffman data is stored as 16 symbol counts (for each possible bit length) followed by the symbols.&lt;br /&gt;
&lt;br /&gt;
Macroblock coding types:&lt;br /&gt;
* 0 - skip&lt;br /&gt;
* 1 - motion block with 5-bit motion vector components&lt;br /&gt;
* 2 - fill block with three bytes, one for each plane&lt;br /&gt;
* 255 - DCT-coded macroblock&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Formats]]&lt;br /&gt;
[[Category:Video Codecs]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Pelrock_cutscene&amp;diff=16149</id>
		<title>Pelrock cutscene</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Pelrock_cutscene&amp;diff=16149"/>
		<updated>2026-06-15T16:23:58Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill known information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Game: [https://www.mobygames.com/game/14161/alfred-pelrock/| Alfred Pelrock]&lt;br /&gt;
* File: &amp;lt;code&amp;gt;ESCENAX.SSN&amp;lt;/code&amp;gt;&lt;br /&gt;
* Decoder: &amp;lt;code&amp;gt;github.com/scummvm/scummvm/blob/master/engines/pelrock/video.cpp&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a cutscene format used in one Spanish game. Data is organised into chunks with size being multiple of 20480 bytes (ten sectors), video data only (audio and subtitles being stored in other files), with optional RLE compression and frames being transmitted as a XOR difference from the previous frame (initial frame is assumed to be zero).&lt;br /&gt;
&lt;br /&gt;
Video has fixed dimensions of 640x400.&lt;br /&gt;
&lt;br /&gt;
Chunk starts with 9-byte header: 32-bit little-endian number of 20480-byte blocks in the chunk, 32-bit size, and 1-byte chunk type:&lt;br /&gt;
* 1 -- RLE-compressed frame&lt;br /&gt;
* 2 -- raw frame updates&lt;br /&gt;
* 3 -- end of video&lt;br /&gt;
* 4 -- palette&lt;br /&gt;
* 6 -- delay (wait 20ms)&lt;br /&gt;
&lt;br /&gt;
=== RLE compression ===&lt;br /&gt;
&lt;br /&gt;
RLE data starts with 32-bit data length and is coded in the same way as PCX (if top two bits are set, low six bits are the run length of the next byte value, otherwise the current byte is a literal pixel value).&lt;br /&gt;
&lt;br /&gt;
=== Raw updates ===&lt;br /&gt;
&lt;br /&gt;
In this case frame data is stored in packets that start immediately after 32-bit data length. Packet header: 32-bit destination offset plus one-byte copy length (zero means end of updates). E.g. first packets of full frame will look like &amp;quot;copy to offset 0 input 255 bytes, (255 bytes); copy to offset 255 input 255 bytes, (255 bytes); ...&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=ACG_Movie&amp;diff=16148</id>
		<title>ACG Movie</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=ACG_Movie&amp;diff=16148"/>
		<updated>2026-05-23T09:54:22Z</updated>

		<summary type="html">&lt;p&gt;Kostya: document it&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Extensions: .m24, .wdf&lt;br /&gt;
&lt;br /&gt;
This is a family of auxiliary animation formats i.e. formats that are used as an animated overlay for some background and do not code whole area themselves (8-bit version does not contain image palette either). The formats employ [[Microsoft RLE]] for compression.&lt;br /&gt;
&lt;br /&gt;
== 8-bit ACG movie ==&lt;br /&gt;
&lt;br /&gt;
File starts with &amp;quot;ACG_MOVIE&amp;quot; string and does not seem to contain anything useful until the offset 0x24C. From there there's frame data prefixed by two 16-bit values and RLE data. The frame ends where RLE data signals end of data.&lt;br /&gt;
&lt;br /&gt;
== 8-bit ACG difference movie ==&lt;br /&gt;
&lt;br /&gt;
Nothing is known about it beside the fact that it starts with &amp;quot;ACG_DIFF8&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== 24-bit ACG movie v1 ==&lt;br /&gt;
&lt;br /&gt;
Nothing is known about it beside the fact that it starts with &amp;quot;ACG MOVIE TRUE24-BIT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== 24-bit ACG difference movie ==&lt;br /&gt;
&lt;br /&gt;
Nothing is known about it beside the fact that it starts with &amp;quot;ACG_DIFF24&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== 24-bit ACG movie v2 ==&lt;br /&gt;
&lt;br /&gt;
File starts with &amp;quot;ACG MOVIE TRUE24- V2&amp;quot; string followed by 16-bit number of the frames, bounding rectangle (32-bit x, y, width and height values) and 16-bit value which looks like height aligned to multiple of 4. Frames start with similar bounding rectangle, 32-bit size (repeated twice) and two 16-bit values. Frame data consists of 24-bit image data compressed with the same 8-bit RLE per plane (i.e. first it's blue component of the whole image, then green and finally red) stored one after another (decoder has to rely on the RLE signalled end-of-data to determine where next component data starts).&lt;br /&gt;
&lt;br /&gt;
[[Category:Container Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Rainbow_Technology_F16&amp;diff=16147</id>
		<title>Rainbow Technology F16</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Rainbow_Technology_F16&amp;diff=16147"/>
		<updated>2026-05-23T09:34:51Z</updated>

		<summary type="html">&lt;p&gt;Kostya: document it&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Company: Rainbow Technology Group of America&lt;br /&gt;
* Extension: .f16&lt;br /&gt;
&lt;br /&gt;
This was a 16-bit (15-bit really) competitor to [[Flic Video]] as the 16-bit extensions to Flic format were not (widely) known at that time.&lt;br /&gt;
&lt;br /&gt;
The format can be described as simplified FLI with just two frame types (raw and RLE-compressed) adapted for 16-bit video.&lt;br /&gt;
&lt;br /&gt;
Header format:&lt;br /&gt;
* 6 bytes -- unknown&lt;br /&gt;
* 2 bytes -- number of frames?&lt;br /&gt;
* 2 bytes -- video width&lt;br /&gt;
* 2 bytes -- video height&lt;br /&gt;
* 2 bytes -- bits per pixel (15)&lt;br /&gt;
* 20 bytes -- unknown&lt;br /&gt;
&lt;br /&gt;
The rest of the data is chunks with the following header:&lt;br /&gt;
* 2 bytes -- chunk tag (0xFF16)&lt;br /&gt;
* 2 bytes -- compression type (0x7B - uncompressed, 0x7C - RLE)&lt;br /&gt;
* 4 bytes -- total chunk size (including this header)&lt;br /&gt;
&lt;br /&gt;
RLE compression is a lot like &amp;lt;code&amp;gt;DELTA_FLI&amp;lt;/code&amp;gt;: it starts with two 16-bit numbers for the height of coded block and its first start line followed by line data. Line data starts with 16-bit number of lines to skip before starting decoding (except for the very first line), followed by the 16-bit number of operations on the line. Each operation consists of 16-bit skip count and 15-bit run/copy count (top bit being used to tell whether it's copy or run). Both values code data sizes in bytes.&lt;br /&gt;
&lt;br /&gt;
[[Category:Container Formats]]&lt;br /&gt;
[[Category:Video Codecs]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=MAGIX_Video&amp;diff=16146</id>
		<title>MAGIX Video</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=MAGIX_Video&amp;diff=16146"/>
		<updated>2026-05-23T09:19:59Z</updated>

		<summary type="html">&lt;p&gt;Kostya: document it&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Extension: .mxv&lt;br /&gt;
&lt;br /&gt;
MAGIX Video is a RIFF-inspired container for intermediate video (motion JPEG) extended to 64-bit support with both chunk types and sizes being 64-bit. Chunk names have a form of &amp;quot;&amp;lt;code&amp;gt;MXxxxx64&amp;lt;/code&amp;gt;&amp;quot;. Unlike RIFF there is no padding chunk sizes to 16-bit.&lt;br /&gt;
&lt;br /&gt;
File starts with &amp;lt;code&amp;gt;MXRIFF64&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;MXJVID64&amp;lt;/code&amp;gt; list followed by stream header either in &amp;lt;code&amp;gt;MXJVHD64&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;MXJVH264&amp;lt;/code&amp;gt; chunk, some other chunks and &amp;lt;code&amp;gt;MXRIFF64&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;MXJVID64&amp;lt;/code&amp;gt; list with frame chunks (&amp;lt;code&amp;gt;MXJVVF64&amp;lt;/code&amp;gt;). At the end there may be &amp;lt;code&amp;gt;MXJVFT64&amp;lt;/code&amp;gt; index chunk (just 64-bit offsets to frames).&lt;br /&gt;
&lt;br /&gt;
[[Category:Container Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=MVS&amp;diff=16145</id>
		<title>MVS</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=MVS&amp;diff=16145"/>
		<updated>2026-05-23T09:07:38Z</updated>

		<summary type="html">&lt;p&gt;Kostya: inter-frame DCT tile description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MVS is an extension (new coding methods) of VNC protocol. It operates on 8x8 blocks (or tiles) and employs DCT in YUV colourspace. There is no sub-sampling, so 8x8 tile codes three 8x8 block for each components (though chroma components usually have the reduced number of coded coefficients).&lt;br /&gt;
&lt;br /&gt;
Packet data begins with a byte signalling its type, the rest depends on type:&lt;br /&gt;
* 0 - intra frame&lt;br /&gt;
* 1 - inter frame&lt;br /&gt;
* 2 - DCT quantisation tables&lt;br /&gt;
&lt;br /&gt;
In general, first decoder should receive quantisation tables, then intra frame and then some inter frames (which update data transmitted in previous frames).&lt;br /&gt;
&lt;br /&gt;
Bitstream is stored MSB first in big-endian format.&lt;br /&gt;
&lt;br /&gt;
== Intra frame ==&lt;br /&gt;
&lt;br /&gt;
Packet payload begins with its ID (0) and two bytes with DCT quantiser selectors. Then there is 24-bit big-endian size of tile metadata followed by tile metadata and the rest is tile data. Data should end with 8-bit code for 'm' (not necessarily at the byte boundary though).&lt;br /&gt;
&lt;br /&gt;
Tiles can either be simple fill operations, copy already decoded tile operation, DCT block or re-using some previously decoded DCT block again.&lt;br /&gt;
&lt;br /&gt;
=== Intra tile metadata ===&lt;br /&gt;
&lt;br /&gt;
Tile metadata is stored in run form: there is 3-bit tile type code followed by variable-length code for the number of tiles with that type.&lt;br /&gt;
&lt;br /&gt;
Tile type run codes are:&lt;br /&gt;
* &amp;lt;code&amp;gt;0000-1110&amp;lt;/code&amp;gt; --- 1-15 tiles&lt;br /&gt;
* &amp;lt;code&amp;gt;11110 + 8-bit code&amp;lt;/code&amp;gt; --- 16-271 tiles&lt;br /&gt;
* &amp;lt;code&amp;gt;111110 + 15-bit code&amp;lt;/code&amp;gt; --- 16-32783 tiles&lt;br /&gt;
* &amp;lt;code&amp;gt;111111 + 22-bit code&amp;lt;/code&amp;gt; --- 16-4194319 tiles&lt;br /&gt;
&lt;br /&gt;
Tile types are:&lt;br /&gt;
* 0 --- fully white block&lt;br /&gt;
* 1 --- paint previous block again (one to the left from the current one or last one in the previous row for the first block of the row)&lt;br /&gt;
* 2 --- paint block from above the current position&lt;br /&gt;
* 3 --- black and white block: bit mask from tile data codes which pixels of the block are black (0) or white (1)&lt;br /&gt;
* 4 --- fill or two-colour pattern block (see below)&lt;br /&gt;
* 5 --- DCT block (see below)&lt;br /&gt;
* 6 --- cached DCT tile: get 16-bit index, draw DCT tile from the cache&lt;br /&gt;
* 7 --- paint last used DCT tile (either from previously decoded DCT block or last used cached one, whichever is more recent) again&lt;br /&gt;
&lt;br /&gt;
=== Fill/two-colour block ===&lt;br /&gt;
&lt;br /&gt;
This mode either fills tile with single colour or paints a pattern using two colours. First bit in tile data tells which mode is that, then there are 1-2 colours in 8-6-6 YUV format (8 bits per luma, top 6 bits per chroma component, see conversion formulae below) and for 2-colour mode there is fill pattern as well.&lt;br /&gt;
&lt;br /&gt;
=== DCT tile ===&lt;br /&gt;
&lt;br /&gt;
DCT tile comprises data for three blocks, one for each component. For encoding, RGB data is converted to YUV, FDCT is performed on each component, then DC prediction is applied, and finally all block data is coded in a special way using general codes (usually Rice codes) dependent on the coefficient position (i.e. DCs are coded in one way, coefficients 1-6 in zigzag order are coded in a different way and the rest of coefficients are coded in yet another way).&lt;br /&gt;
&lt;br /&gt;
Block format:&lt;br /&gt;
  chroma_dc_coded = get_bit();&lt;br /&gt;
  quant_sel = get_bit() ? header_byte2 : header_byte1;&lt;br /&gt;
  if chroma_dc_coded {&lt;br /&gt;
    cr_blk[0] = (last_cr_dc / 2 - get_dc()) * 2;&lt;br /&gt;
    cb_blk[0] = (last_cb_dc / 2 - get_dc()) * 2;&lt;br /&gt;
    last_cr_dc = cr_blk[0];&lt;br /&gt;
    last_cb_dc = cb_blk[0];&lt;br /&gt;
  } else {&lt;br /&gt;
    cr_blk[0] = last_cr_dc;&lt;br /&gt;
    cb_blk[0] = last_cb_dc;&lt;br /&gt;
  }&lt;br /&gt;
  y_blk[0] = last_y_dc - get_dc();&lt;br /&gt;
  last_y_dc = y_blk[0];&lt;br /&gt;
  &lt;br /&gt;
  idx = 1;&lt;br /&gt;
  while (idx &amp;lt; 6) {&lt;br /&gt;
    add_q = quant_sel &amp;gt; 14 ? 2 : (quant_sel &amp;lt;= idx ? 16 : 8);&lt;br /&gt;
    if (get_bit()) {&lt;br /&gt;
      coef[idx++] = get_ac1_5_nozero() * add_q;&lt;br /&gt;
    } else {&lt;br /&gt;
      // decode skip/level value&lt;br /&gt;
      if (is_skip) {&lt;br /&gt;
        idx += value;&lt;br /&gt;
      } else {&lt;br /&gt;
        coef[idx++] = value * add_q;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  while (idx &amp;lt; 64) {&lt;br /&gt;
    add_q = quant_sel &amp;gt; 14 ? (quant_sel &amp;gt; idx ? 2 : 8) : (quant_sel &amp;lt;= idx ? 16 : 8);&lt;br /&gt;
    if (get_bit()) {&lt;br /&gt;
      coef[idx++] = get_ac6_63_nozero() * add_q;&lt;br /&gt;
    } else {&lt;br /&gt;
      // decode skip/level value&lt;br /&gt;
      if (is_skip) {&lt;br /&gt;
        idx += value;&lt;br /&gt;
      } else {&lt;br /&gt;
        coef[idx++] = value * add_q;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For DC prediction initial DC predictors are set to zero.&lt;br /&gt;
&lt;br /&gt;
DC codes: get prefix as unary code of ones (e.g. &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; = 0, &amp;lt;code&amp;gt;1110&amp;lt;/code&amp;gt; = 3), get sign bit, get mantissa bits depending on prefix, negate value if sign bit is set and return it.&lt;br /&gt;
&lt;br /&gt;
Code structure:&lt;br /&gt;
* &amp;lt;code&amp;gt;0 s x&amp;lt;/code&amp;gt; -- codes &amp;amp;plusmn;1&lt;br /&gt;
* &amp;lt;code&amp;gt;10 s x&amp;lt;/code&amp;gt; -- codes &amp;amp;plusmn;2-3&lt;br /&gt;
* &amp;lt;code&amp;gt;110 s xx&amp;lt;/code&amp;gt; -- codes &amp;amp;plusmn;4-7&lt;br /&gt;
* &amp;lt;code&amp;gt;11..10 s xxx&amp;lt;/code&amp;gt; -- &amp;amp;plusmn;((prefix - 2) * 8 + &amp;lt;code&amp;gt;xxx&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Coefficient 1-4 no-zero codes: get prefix as unary code of ones, get sign bit, for prefixes 0-3 code is &amp;amp;plusmn;&amp;lt;code&amp;gt;(prefix * 4) + get_bits(2) + 2&amp;lt;/code&amp;gt;, for other prefixes it is &amp;amp;plusmn;&amp;lt;code&amp;gt;(prefix - 4) * 8 + get_bits(3) + 18&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Coefficient 6-63 no-zero codes are similar to DC codes: get prefix as unary code of ones (e.g. &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; = 0, &amp;lt;code&amp;gt;1110&amp;lt;/code&amp;gt; = 3), get sign bit, get mantissa bits depending on prefix, negate value if sign bit is set and return it.&lt;br /&gt;
&lt;br /&gt;
Code structure:&lt;br /&gt;
* &amp;lt;code&amp;gt;0 s x&amp;lt;/code&amp;gt; -- codes &amp;amp;plusmn;2-3&lt;br /&gt;
* &amp;lt;code&amp;gt;10 s xx&amp;lt;/code&amp;gt; -- codes &amp;amp;plusmn;4-7&lt;br /&gt;
* &amp;lt;code&amp;gt;1..10 s xxx&amp;lt;/code&amp;gt; -- &amp;amp;plusmn;((prefix - 1) * 8 + &amp;lt;code&amp;gt;xxx&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Other coefficient codes use special scheme signalled by 2-bit code type:&lt;br /&gt;
* 0 -- new level value is 1&lt;br /&gt;
* 1 -- new skip value (see below)&lt;br /&gt;
* 2 -- re-use previous non-zero coefficient value&lt;br /&gt;
* 3 -- re-use negated previous non-zero coefficient value&lt;br /&gt;
&lt;br /&gt;
Skip value codes:&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; -- end of block&lt;br /&gt;
* &amp;lt;code&amp;gt;0 00&amp;lt;/code&amp;gt; -- 3&lt;br /&gt;
* &amp;lt;code&amp;gt;0 01&amp;lt;/code&amp;gt; -- 4&lt;br /&gt;
* &amp;lt;code&amp;gt;0 10&amp;lt;/code&amp;gt; -- 5&lt;br /&gt;
* &amp;lt;code&amp;gt;0 11 xxx yyy ...&amp;lt;/code&amp;gt; -- 6+n (read 3-bit values and add them to the initial value of 6, stop when 3-bit value is not equal to 7)&lt;br /&gt;
&lt;br /&gt;
=== Cached DCT tile ===&lt;br /&gt;
&lt;br /&gt;
Decoder maintains a circular buffer of 65000 (not 65536!) DCT tiles. Every time a DCT block is decoded, it is put into this buffer and may be re-used later.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Inter frame ==&lt;br /&gt;
&lt;br /&gt;
In this mode tile may reference previously decoded tile data e.g. re-use copy operation or update previously decoded DCT coefficients.&lt;br /&gt;
&lt;br /&gt;
Like intra frame, packet data starts with ID and two bytes of header, telling the maximum number of Cr and Cb coefficients that may be coded in DCT blocks. Data should end with &amp;lt;code&amp;gt;&amp;quot;mvs\0&amp;quot;&amp;lt;/code&amp;gt; sequence (not necessarily at the byte boundary though).&lt;br /&gt;
&lt;br /&gt;
Unlike intra frame, this mode stores tile types and data interleaved, without any run coding and there are only four types (requiring two bits):&lt;br /&gt;
* 0 -- skip (leave current block unchanged)&lt;br /&gt;
* 1 -- DCT update tile&lt;br /&gt;
* 2 -- repeat copy operation (i.e. if intra frame tile at the current position copied last/top block, copy it again as well)&lt;br /&gt;
* 3 -- re-use cached DCT tile&lt;br /&gt;
&lt;br /&gt;
=== DCT update tile ===&lt;br /&gt;
&lt;br /&gt;
This DCT tile uses DCT coefficients data (luma block and DCs from chroma blocks) as its base (without updating the reference).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Cached DCT tile ===&lt;br /&gt;
&lt;br /&gt;
Unlike intra mode, there is a flag telling whether decoder should read full 16-bit tile index or use the next tile in cache.&lt;br /&gt;
&lt;br /&gt;
For example, if first e.g. tile 24 is selected from the cache, next operation may simply tell to use the next one (tile 25) instead of sending its index explicitly.&lt;br /&gt;
&lt;br /&gt;
DCT data starts with 6-bit index of last non-zero luma coefficient (in zigzag order).&lt;br /&gt;
&lt;br /&gt;
Coding mode for luma block depends on reference block quantiser selector.&lt;br /&gt;
&lt;br /&gt;
If that selector value is less than 15 then coefficients are coded as:&lt;br /&gt;
* when reference coefficient is non-zero and only DC is coded -- as a signed 4-bit difference (with sign inverted if base coefficient is negative);&lt;br /&gt;
* when reference coefficient is non-zero -- as a signed 3-bit difference (with sign inverted if base coefficient is negative);&lt;br /&gt;
* when reference coefficient is zero -- the same way as DC difference in intra DCT tiles.&lt;br /&gt;
&lt;br /&gt;
Otherwise there's also a different mode for small coefficients: -1/0/1 for zero base coefficients (&amp;lt;code&amp;gt;11&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;10&amp;lt;/code&amp;gt; correspondingly) and 0/&amp;amp;mnplus;1 for non-zero ones. The rest is coded as DC differences.&lt;br /&gt;
&lt;br /&gt;
Chroma DCT blocks use the same small coefficients mode to code DCs (as that's the only coefficient with the reference available) and JPEG-style AC coding (zero-run plus number of bits in coefficient plus coefficient mantissa bits).&lt;br /&gt;
&lt;br /&gt;
== DCT quantisation tables ==&lt;br /&gt;
&lt;br /&gt;
The packet should be 129 bytes long: packet ID and two 64-byte quantisation tables (for luma and for chroma).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== YUV colourspace ==&lt;br /&gt;
&lt;br /&gt;
The colourspace seems to use these coefficients:&lt;br /&gt;
  Y  =  0.314520 * R + 0.572543 * G + 0.112937 * B&lt;br /&gt;
  Cr =  0.527292 * R - 0.440418 * G - 0.086874 * B&lt;br /&gt;
  Cb = -0.177695 * R - 0.323471 * G + 0.501166 * B&lt;br /&gt;
&lt;br /&gt;
Or, for the reverse operation&lt;br /&gt;
  R = Y + 1.3 * Cr&lt;br /&gt;
  G = Y - 0.71414 * Cr - 0.34914 * Cb&lt;br /&gt;
  B = Y + 1.77 * Cb&lt;br /&gt;
&lt;br /&gt;
[[Category:Networking Protocols]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=MVS&amp;diff=16144</id>
		<title>MVS</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=MVS&amp;diff=16144"/>
		<updated>2026-05-22T17:02:35Z</updated>

		<summary type="html">&lt;p&gt;Kostya: start filling known information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MVS is an extension (new coding methods) of VNC protocol. It operates on 8x8 blocks (or tiles) and employs DCT in YUV colourspace. There is no sub-sampling, so 8x8 tile codes three 8x8 block for each components (though chroma components usually have the reduced number of coded coefficients).&lt;br /&gt;
&lt;br /&gt;
Packet data begins with a byte signalling its type, the rest depends on type:&lt;br /&gt;
* 0 - intra frame&lt;br /&gt;
* 1 - inter frame&lt;br /&gt;
* 2 - DCT quantisation tables&lt;br /&gt;
&lt;br /&gt;
In general, first decoder should receive quantisation tables, then intra frame and then some inter frames (which update data transmitted in previous frames).&lt;br /&gt;
&lt;br /&gt;
Bitstream is stored MSB first in big-endian format.&lt;br /&gt;
&lt;br /&gt;
== Intra frame ==&lt;br /&gt;
&lt;br /&gt;
Packet payload begins with its ID (0) and two bytes with DCT quantiser selectors. Then there is 24-bit big-endian size of tile metadata followed by tile metadata and the rest is tile data. Data should end with 8-bit code for 'm' (not necessarily at the byte boundary though).&lt;br /&gt;
&lt;br /&gt;
Tiles can either be simple fill operations, copy already decoded tile operation, DCT block or re-using some previously decoded DCT block again.&lt;br /&gt;
&lt;br /&gt;
=== Intra tile metadata ===&lt;br /&gt;
&lt;br /&gt;
Tile metadata is stored in run form: there is 3-bit tile type code followed by variable-length code for the number of tiles with that type.&lt;br /&gt;
&lt;br /&gt;
Tile type run codes are:&lt;br /&gt;
* &amp;lt;code&amp;gt;0000-1110&amp;lt;/code&amp;gt; --- 1-15 tiles&lt;br /&gt;
* &amp;lt;code&amp;gt;11110 + 8-bit code&amp;lt;/code&amp;gt; --- 16-271 tiles&lt;br /&gt;
* &amp;lt;code&amp;gt;111110 + 15-bit code&amp;lt;/code&amp;gt; --- 16-32783 tiles&lt;br /&gt;
* &amp;lt;code&amp;gt;111111 + 22-bit code&amp;lt;/code&amp;gt; --- 16-4194319 tiles&lt;br /&gt;
&lt;br /&gt;
Tile types are:&lt;br /&gt;
* 0 --- fully white block&lt;br /&gt;
* 1 --- paint previous block again (one to the left from the current one or last one in the previous row for the first block of the row)&lt;br /&gt;
* 2 --- paint block from above the current position&lt;br /&gt;
* 3 --- black and white block: bit mask from tile data codes which pixels of the block are black (0) or white (1)&lt;br /&gt;
* 4 --- fill or two-colour pattern block (see below)&lt;br /&gt;
* 5 --- DCT block (see below)&lt;br /&gt;
* 6 --- cached DCT tile: get 16-bit index, draw DCT tile from the cache&lt;br /&gt;
* 7 --- paint last used DCT tile (either from previously decoded DCT block or last used cached one, whichever is more recent) again&lt;br /&gt;
&lt;br /&gt;
=== Fill/two-colour block ===&lt;br /&gt;
&lt;br /&gt;
This mode either fills tile with single colour or paints a pattern using two colours. First bit in tile data tells which mode is that, then there are 1-2 colours in 8-6-6 YUV format (8 bits per luma, top 6 bits per chroma component, see conversion formulae below) and for 2-colour mode there is fill pattern as well.&lt;br /&gt;
&lt;br /&gt;
=== DCT tile ===&lt;br /&gt;
&lt;br /&gt;
DCT tile comprises data for three blocks, one for each component. For encoding, RGB data is converted to YUV, FDCT is performed on each component, then DC prediction is applied, and finally all block data is coded in a special way using general codes (usually Rice codes) dependent on the coefficient position (i.e. DCs are coded in one way, coefficients 1-6 in zigzag order are coded in a different way and the rest of coefficients are coded in yet another way).&lt;br /&gt;
&lt;br /&gt;
Block format:&lt;br /&gt;
  chroma_dc_coded = get_bit();&lt;br /&gt;
  quant_sel = get_bit() ? header_byte2 : header_byte1;&lt;br /&gt;
  if chroma_dc_coded {&lt;br /&gt;
    cr_blk[0] = (last_cr_dc / 2 - get_dc()) * 2;&lt;br /&gt;
    cb_blk[0] = (last_cb_dc / 2 - get_dc()) * 2;&lt;br /&gt;
    last_cr_dc = cr_blk[0];&lt;br /&gt;
    last_cb_dc = cb_blk[0];&lt;br /&gt;
  } else {&lt;br /&gt;
    cr_blk[0] = last_cr_dc;&lt;br /&gt;
    cb_blk[0] = last_cb_dc;&lt;br /&gt;
  }&lt;br /&gt;
  y_blk[0] = last_y_dc - get_dc();&lt;br /&gt;
  last_y_dc = y_blk[0];&lt;br /&gt;
  &lt;br /&gt;
  idx = 1;&lt;br /&gt;
  while (idx &amp;lt; 6) {&lt;br /&gt;
    add_q = quant_sel &amp;gt; 14 ? 2 : (quant_sel &amp;lt;= idx ? 16 : 8);&lt;br /&gt;
    if (get_bit()) {&lt;br /&gt;
      coef[idx++] = get_ac1_5_nozero() * add_q;&lt;br /&gt;
    } else {&lt;br /&gt;
      // decode skip/level value&lt;br /&gt;
      if (is_skip) {&lt;br /&gt;
        idx += value;&lt;br /&gt;
      } else {&lt;br /&gt;
        coef[idx++] = value * add_q;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  while (idx &amp;lt; 64) {&lt;br /&gt;
    add_q = quant_sel &amp;gt; 14 ? (quant_sel &amp;lt; idx ? 2 : 8) : (quant_sel &amp;lt;= idx ? 16 : 8);&lt;br /&gt;
    if (get_bit()) {&lt;br /&gt;
      coef[idx++] = get_ac6_63_nozero() * add_q;&lt;br /&gt;
    } else {&lt;br /&gt;
      // decode skip/level value&lt;br /&gt;
      if (is_skip) {&lt;br /&gt;
        idx += value;&lt;br /&gt;
      } else {&lt;br /&gt;
        coef[idx++] = value * add_q;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For DC prediction initial DC predictors are set to zero.&lt;br /&gt;
&lt;br /&gt;
DC codes: get prefix as unary code of ones (e.g. &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; = 0, &amp;lt;code&amp;gt;1110&amp;lt;/code&amp;gt; = 3), get sign bit, get mantissa bits depending on prefix, negate value if sign bit is set and return it.&lt;br /&gt;
&lt;br /&gt;
Code structure:&lt;br /&gt;
* &amp;lt;code&amp;gt;0 s x&amp;lt;/code&amp;gt; -- codes &amp;amp;plusmn;1&lt;br /&gt;
* &amp;lt;code&amp;gt;10 s x&amp;lt;/code&amp;gt; -- codes &amp;amp;plusmn;2-3&lt;br /&gt;
* &amp;lt;code&amp;gt;110 s xx&amp;lt;/code&amp;gt; -- codes &amp;amp;plusmn;4-7&lt;br /&gt;
* &amp;lt;code&amp;gt;11..10 s xxx&amp;lt;/code&amp;gt; -- &amp;amp;plusmn;((prefix - 2) * 8 + &amp;lt;code&amp;gt;xxx&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Coefficient 1-4 no-zero codes: get prefix as unary code of ones, get sign bit, for prefixes 0-3 code is &amp;amp;plusmn;&amp;lt;code&amp;gt;(prefix * 4) + get_bits(2) + 2&amp;lt;/code&amp;gt;, for other prefixes it is &amp;amp;plusmn;&amp;lt;code&amp;gt;(prefix - 4) * 8 + get_bits(3) + 18&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Coefficient 6-63 no-zero codes are similar to DC codes: get prefix as unary code of ones (e.g. &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; = 0, &amp;lt;code&amp;gt;1110&amp;lt;/code&amp;gt; = 3), get sign bit, get mantissa bits depending on prefix, negate value if sign bit is set and return it.&lt;br /&gt;
&lt;br /&gt;
Code structure:&lt;br /&gt;
* &amp;lt;code&amp;gt;0 s x&amp;lt;/code&amp;gt; -- codes &amp;amp;plusmn;2-3&lt;br /&gt;
* &amp;lt;code&amp;gt;10 s xx&amp;lt;/code&amp;gt; -- codes &amp;amp;plusmn;4-7&lt;br /&gt;
* &amp;lt;code&amp;gt;1..10 s xxx&amp;lt;/code&amp;gt; -- &amp;amp;plusmn;((prefix - 1) * 8 + &amp;lt;code&amp;gt;xxx&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Other coefficient codes use special scheme signalled by 2-bit code type:&lt;br /&gt;
* 0 -- new level value is 1&lt;br /&gt;
* 1 -- new skip value (see below)&lt;br /&gt;
* 2 -- re-use previous non-zero coefficient value&lt;br /&gt;
* 3 -- re-use negated previous non-zero coefficient value&lt;br /&gt;
&lt;br /&gt;
Skip value codes:&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; -- 1&lt;br /&gt;
* &amp;lt;code&amp;gt;0 00&amp;lt;/code&amp;gt; -- 3&lt;br /&gt;
* &amp;lt;code&amp;gt;0 01&amp;lt;/code&amp;gt; -- 4&lt;br /&gt;
* &amp;lt;code&amp;gt;0 10&amp;lt;/code&amp;gt; -- 5&lt;br /&gt;
* &amp;lt;code&amp;gt;0 11 xxx yyy ...&amp;lt;/code&amp;gt; -- 6+n (read 3-bit values and add them to the initial value of 6, stop when 3-bit value is not equal to 7)&lt;br /&gt;
&lt;br /&gt;
=== Cached DCT tile ===&lt;br /&gt;
&lt;br /&gt;
Decoder maintains a circular buffer of 65000 (not 65536!) DCT tiles. Every time a DCT block is decoded, it is put into this buffer and may be re-used later.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Inter frame ==&lt;br /&gt;
&lt;br /&gt;
In this mode tile may reference previously decoded tile data e.g. re-use copy operation or update previously decoded DCT coefficients.&lt;br /&gt;
&lt;br /&gt;
Like intra frame, packet data starts with ID and two bytes of header, telling the maximum number of Cr and Cb coefficients that may be coded in DCT blocks. Data should end with &amp;lt;code&amp;gt;&amp;quot;mvs\0&amp;quot;&amp;lt;/code&amp;gt; sequence (not necessarily at the byte boundary though).&lt;br /&gt;
&lt;br /&gt;
Unlike intra frame, this mode stores tile types and data interleaved, without any run coding and there are only four types (requiring two bits):&lt;br /&gt;
* 0 -- skip (leave current block unchanged)&lt;br /&gt;
* 1 -- DCT update block&lt;br /&gt;
* 2 -- repeat copy operation (i.e. if intra frame tile at the current position copied last/top block, copy it again as well)&lt;br /&gt;
* 3 -- re-use cached DCT tile&lt;br /&gt;
&lt;br /&gt;
=== DCT update block ===&lt;br /&gt;
&lt;br /&gt;
**TODO**&lt;br /&gt;
&lt;br /&gt;
=== Cached DCT tile ===&lt;br /&gt;
&lt;br /&gt;
Unlike intra mode, there is a flag telling whether decoder should read full 16-bit tile index or use the next tile in cache.&lt;br /&gt;
&lt;br /&gt;
For example, if first e.g. tile 24 is selected from the cache, next operation may simply tell to use the next one (tile 25) instead of sending its index explicitly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DCT quantisation tables ==&lt;br /&gt;
&lt;br /&gt;
The packet should be 129 bytes long: packet ID and two 64-byte quantisation tables (for luma and for chroma)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== YUV colourspace ==&lt;br /&gt;
&lt;br /&gt;
The colourspace seems to use these coefficients:&lt;br /&gt;
  Y  =  0.314520 * R + 0.572543 * G + 0.112937 * B&lt;br /&gt;
  Cr =  0.527292 * R - 0.440418 * G - 0.086874 * B&lt;br /&gt;
  Cb = -0.177695 * R - 0.323471 * G + 0.501166 * B&lt;br /&gt;
&lt;br /&gt;
Or, for the reverse operation&lt;br /&gt;
  R = Y + 1.3 * Cr&lt;br /&gt;
  G = Y - 0.71414 * Cr - 0.34914 * Cb&lt;br /&gt;
  B = Y + 1.77 * Cb&lt;br /&gt;
&lt;br /&gt;
[[Category:Networking Protocols]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Factor_5_VID1&amp;diff=16134</id>
		<title>Factor 5 VID1</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Factor_5_VID1&amp;diff=16134"/>
		<updated>2026-04-23T16:29:02Z</updated>

		<summary type="html">&lt;p&gt;Kostya: keep updating&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Company: Factor 5&lt;br /&gt;
* Extension: vid&lt;br /&gt;
* Game: [https://www.mobygames.com/game/9211/enter-the-matrix/ Enter the Matrix (Gamecube version)]&lt;br /&gt;
* demuxer code: [https://github.com/librempeg/librempeg/blob/master/libavformat/vid1.c librempeg]&lt;br /&gt;
&lt;br /&gt;
This is a format used in at least one Gamecube game. VID1 format is not merely a container format but a proprietary video codec used in that container as well.&lt;br /&gt;
&lt;br /&gt;
== Container format ==&lt;br /&gt;
&lt;br /&gt;
This a typical chunked format starting with &amp;quot;VID1&amp;quot; header chunk, &amp;quot;HEAD&amp;quot; chunk containing stream headers, and &amp;quot;FRAM&amp;quot; chunks containing both video (&amp;quot;VIDD&amp;quot;) and audio (&amp;quot;AUDD&amp;quot;) data.&lt;br /&gt;
&lt;br /&gt;
Audio codecs include PCM, variations of IMA ADPCM, or Vorbis.&lt;br /&gt;
&lt;br /&gt;
== Video codec ==&lt;br /&gt;
&lt;br /&gt;
VID1 video codec is a modification of MPEG-4 ASP.&lt;br /&gt;
&lt;br /&gt;
Picture header:&lt;br /&gt;
* 16 bits -- ignored (sync marker?)&lt;br /&gt;
* 2 bits -- frame type (0 - I, 1 - P, 2 - B, 3 - S)&lt;br /&gt;
* 1 bit -- extended information present&lt;br /&gt;
* (extended information if present)&lt;br /&gt;
* 1 bit -- rounding control&lt;br /&gt;
* 3 bits -- DC quantiser threshold index (&amp;lt;code&amp;gt;intra_dc_vlc_thr&amp;lt;/code&amp;gt;)&lt;br /&gt;
* 5 bits -- quantiser&lt;br /&gt;
* (non-I frames) 3 bits -- &amp;lt;code&amp;gt;vop_fcode_forward&amp;lt;/code&amp;gt;&lt;br /&gt;
* (B-frame only) 3 bits -- &amp;lt;code&amp;gt;vop_fcode_backward&amp;lt;/code&amp;gt;&lt;br /&gt;
* 32 bits -- timecode&lt;br /&gt;
* (S-frame only) GMC/sprite information&lt;br /&gt;
* alignment to byte boundary&lt;br /&gt;
&lt;br /&gt;
Extended information:&lt;br /&gt;
* 1 bit -- sprite information is present&lt;br /&gt;
* (if sprite information is present) 2 bits -- number of sprites?&lt;br /&gt;
* (if sprite information is present) 2 bits -- sprite MV resolution?&lt;br /&gt;
* 1 bit -- extended quantisation&lt;br /&gt;
* (if extended quantisation) 1 bit -- luma qmat present&lt;br /&gt;
* (if extended quantisation and luma qmat present) 8x8 bits -- luma qmat&lt;br /&gt;
* (if extended quantisation) 1 bit -- chroma qmat present&lt;br /&gt;
* (if extended quantisation and chroma qmat present) 8x8 bits -- chroma qmat&lt;br /&gt;
* 1 bit -- ignored&lt;br /&gt;
* 1 bit -- ignored&lt;br /&gt;
&lt;br /&gt;
I-frames consists of macroblocks with the following layout:&lt;br /&gt;
* standard I MCBPC&lt;br /&gt;
* 1 bit -- AC prediction enabled&lt;br /&gt;
* I CBPY&lt;br /&gt;
* (if dquant is signalled) 2 bits -- dquant&lt;br /&gt;
* block data (likely just like ISO 14496-2 defines it)&lt;br /&gt;
&lt;br /&gt;
P-frame macroblock layout:&lt;br /&gt;
* 1 bit -- skip flag (if set, no further information is transmitted for the MB)&lt;br /&gt;
* standard P MCBPC&lt;br /&gt;
* (for I-type MBs decoding is the same as in I-frames)&lt;br /&gt;
* 1 bit -- mcsel?&lt;br /&gt;
* P CBPY&lt;br /&gt;
* (for MB type 1 only) 2 bits -- dquant&lt;br /&gt;
* 1 or 4 motion vectors (with residual, just like ISO 14496-2)&lt;br /&gt;
* block data&lt;br /&gt;
&lt;br /&gt;
B-frame macroblock layout:&lt;br /&gt;
* 1 bit -- skip flag (if set, no further information is transmitted for the MB)&lt;br /&gt;
* 1 bit -- coded MB&lt;br /&gt;
* 1-4 bits -- macroblock type (as in table B-4 of ISO 14496-2)&lt;br /&gt;
* (if MB is coded) 6 bits -- CBP&lt;br /&gt;
* (if not direct MB and CBP is non-zero) 1-2 bits -- dbquant&lt;br /&gt;
* (if applicable) forward/backward MV&lt;br /&gt;
* block data&lt;br /&gt;
&lt;br /&gt;
Motion compensation is normal halfpel.&lt;br /&gt;
&lt;br /&gt;
[[Category:Video Codecs]]&lt;br /&gt;
[[Category:Container Formats]]&lt;br /&gt;
[[Category:Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Factor_5_VID1&amp;diff=16133</id>
		<title>Factor 5 VID1</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Factor_5_VID1&amp;diff=16133"/>
		<updated>2026-04-22T17:12:10Z</updated>

		<summary type="html">&lt;p&gt;Kostya: start to fill some information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Company: Factor 5&lt;br /&gt;
* Extension: vid&lt;br /&gt;
* Game: [https://www.mobygames.com/game/9211/enter-the-matrix/ Enter the Matrix (Gamecube version)]&lt;br /&gt;
* demuxer code: [https://github.com/librempeg/librempeg/blob/master/libavformat/vid1.c librempeg]&lt;br /&gt;
&lt;br /&gt;
This is a format used in at least one Gamecube game. VID1 format is not merely a container format but a proprietary video codec used in that container as well.&lt;br /&gt;
&lt;br /&gt;
== Container format ==&lt;br /&gt;
&lt;br /&gt;
This a typical chunked format starting with &amp;quot;VID1&amp;quot; header chunk, &amp;quot;HEAD&amp;quot; chunk containing stream headers, and &amp;quot;FRAM&amp;quot; chunks containing both video (&amp;quot;VIDD&amp;quot;) and audio (&amp;quot;AUDD&amp;quot;) data.&lt;br /&gt;
&lt;br /&gt;
Audio codecs include PCM, variations of IMA ADPCM, or Vorbis.&lt;br /&gt;
&lt;br /&gt;
== Video codec ==&lt;br /&gt;
&lt;br /&gt;
VID1 video codec is a modification of MPEG-4 ASP.&lt;br /&gt;
&lt;br /&gt;
Picture header:&lt;br /&gt;
* 16 bits -- ignored (sync marker?)&lt;br /&gt;
* 2 bits -- frame type (0 - I, 1 - P, 2 - B, 3 - S)&lt;br /&gt;
* 1 bit -- extended information present&lt;br /&gt;
* (extended information if present)&lt;br /&gt;
* 1 bit -- ?&lt;br /&gt;
* 3 bits -- DC quantiser threshold index (&amp;lt;code&amp;gt;intra_dc_vlc_thr&amp;lt;/code&amp;gt;)&lt;br /&gt;
* 5 bits -- quantiser&lt;br /&gt;
* (non-I frames) 3 bits -- something that seems to be used only in B-frames&lt;br /&gt;
* (B-frame only) 3 bits -- ?&lt;br /&gt;
* 32 bits -- timecode?&lt;br /&gt;
* (frame type 3 only) GMC/sprite information&lt;br /&gt;
* alignment to byte boundary&lt;br /&gt;
&lt;br /&gt;
Extended information:&lt;br /&gt;
* 1 bit -- another extended bit&lt;br /&gt;
* (if another extended bit is set) 2 bits -- ?, used in sprite information&lt;br /&gt;
* (if another extended bit is set) 2 bits -- ?&lt;br /&gt;
* 1 bit -- extended quantisation&lt;br /&gt;
* (if extended quantisation) 1 bit -- luma qmat present&lt;br /&gt;
* (if extended quantisation and luma qmat present) 8x8 bits -- luma qmat&lt;br /&gt;
* (if extended quantisation) 1 bit -- chroma qmat present&lt;br /&gt;
* (if extended quantisation and chroma qmat present) 8x8 bits -- chroma qmat&lt;br /&gt;
* 1 bit -- ignored&lt;br /&gt;
* 1 bit -- ignored&lt;br /&gt;
&lt;br /&gt;
I-frames consists of macroblocks with the following layout:&lt;br /&gt;
* standard I MCBPC&lt;br /&gt;
* 1 bit -- AC prediction enabled&lt;br /&gt;
* I CBPY&lt;br /&gt;
* (if dquant is signalled) 2 bits -- dquant&lt;br /&gt;
* block data (likely just like ISO 14496-2 defines it)&lt;br /&gt;
&lt;br /&gt;
P-frame macroblock layout:&lt;br /&gt;
* 1 bit -- skip flag (if set, no further information is transmitted for the MB)&lt;br /&gt;
* standard P MCBPC&lt;br /&gt;
* (for I-type MBs decoding is the same as in I-frames)&lt;br /&gt;
* 1 bit -- mcsel?&lt;br /&gt;
* P CBPY&lt;br /&gt;
* (for MB type 1 only) 2 bits -- dquant&lt;br /&gt;
* 1 or 4 motion vectors (with residual, just like ISO 14496-2)&lt;br /&gt;
* block data&lt;br /&gt;
&lt;br /&gt;
Motion compensation is normal halfpel.&lt;br /&gt;
&lt;br /&gt;
[[Category:Video Codecs]]&lt;br /&gt;
[[Category:Container Formats]]&lt;br /&gt;
[[Category:Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Adorage_effects_codec&amp;diff=16132</id>
		<title>Adorage effects codec</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Adorage_effects_codec&amp;diff=16132"/>
		<updated>2026-04-17T16:10:12Z</updated>

		<summary type="html">&lt;p&gt;Kostya: yet another simple codec&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Company: proDAD&lt;br /&gt;
* FOURCC: pDAD&lt;br /&gt;
&lt;br /&gt;
This is a codec used to store effects for proDAD Adorage video editor.&lt;br /&gt;
&lt;br /&gt;
Each frame actually consists of two images, actual picture and its alpha mask. Usually it is JPEG image with PNG alpha mask but JPEG image with JPEG mask samples are also known and other combinations are theoretically possible.&lt;br /&gt;
&lt;br /&gt;
Frame format:&lt;br /&gt;
* 4 bytes -- header size (12 bytes)&lt;br /&gt;
* 2 bytes -- image part type (&amp;lt;code&amp;gt;JP&amp;lt;/code&amp;gt; for JPEG, &amp;lt;code&amp;gt;PG&amp;lt;/code&amp;gt; for PNG)&lt;br /&gt;
* 2 bytes -- alpha mask type (in the same format)&lt;br /&gt;
* 4 bytes -- unknown, usually zero&lt;br /&gt;
* 4 bytes -- image part size&lt;br /&gt;
* 4 bytes -- alpha part size&lt;br /&gt;
* N bytes -- image picture&lt;br /&gt;
* M bytes -- alpha picture&lt;br /&gt;
&lt;br /&gt;
[[Category:Video Codecs]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=MoviePak&amp;diff=16131</id>
		<title>MoviePak</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=MoviePak&amp;diff=16131"/>
		<updated>2026-04-17T15:59:54Z</updated>

		<summary type="html">&lt;p&gt;Kostya: add description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Company: RasterOps&lt;br /&gt;
&lt;br /&gt;
This is a simple [[JPEG]]-based video codec for Classic Mac QuickTime.&lt;br /&gt;
&lt;br /&gt;
Frame format:&lt;br /&gt;
* 2 bytes -- frame width&lt;br /&gt;
* 2 bytes -- frame height&lt;br /&gt;
* 4 bytes -- first field size (or whole frame for non-interlaced files)&lt;br /&gt;
* 4 bytes -- second field size (0 for non-interlaced files)&lt;br /&gt;
* 64 bytes -- luma quantisation matrix&lt;br /&gt;
* 64 bytes -- chroma quantisation matrix&lt;br /&gt;
* N bytes -- first field data&lt;br /&gt;
* M bytes -- second field data (if present)&lt;br /&gt;
&lt;br /&gt;
Field data is raw (non-escaped) JPEG data for 4:2:2 subsampling.&lt;br /&gt;
&lt;br /&gt;
[[Category:Video Codecs]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=PDQ2&amp;diff=16130</id>
		<title>PDQ2</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=PDQ2&amp;diff=16130"/>
		<updated>2026-04-17T15:54:31Z</updated>

		<summary type="html">&lt;p&gt;Kostya: add description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* FOURCC: PDQ2&lt;br /&gt;
* Game: [https://www.mobygames.com/game/6145/the-incredible-hulk-the-pantheon-saga/ The Incredible Hulk: The Pantheon Saga]&lt;br /&gt;
&lt;br /&gt;
This is a codec used in DOS and Saturn versions of one game and there's not much known about it (not even the proper name). From compression point of view the codec operates on 4x4 tiles that can be either coded raw or copied from some other place in the frame. DOS version allows additional LZ compression of frame data. Also while Saturn version encodes 16-bit pixels, DOS version works on 8-bit paletted format.&lt;br /&gt;
&lt;br /&gt;
Frame structure (all multi-byte values endianness is native to the platform i.e. LE for DOS and BE for Saturn):&lt;br /&gt;
* 1 byte -- frame type (0 - DOS normal frame, 1 - DOS packed frame, 0x80 - Saturn frame)&lt;br /&gt;
* 2 bytes -- if zero frame should be cleared&lt;br /&gt;
* 2 bytes -- size of opcodes part&lt;br /&gt;
* 2 bytes -- size of motion vectors part&lt;br /&gt;
* 2 bytes -- unknown data part&lt;br /&gt;
* N bytes -- opcodes&lt;br /&gt;
* X bytes -- unknown data&lt;br /&gt;
* M bytes -- MV data&lt;br /&gt;
* P bytes -- colour data&lt;br /&gt;
&lt;br /&gt;
Decoding goes as following: while not all tiles are processed read opcode, depending on it read motion vector or colour data, paint/copy tile (or several, if the opcode signals it).&lt;br /&gt;
&lt;br /&gt;
Known opcodes:&lt;br /&gt;
* &amp;lt;code&amp;gt;0x85&amp;lt;/code&amp;gt; -- motion tile, motion vector is coded as two signed 16-bit ints&lt;br /&gt;
* &amp;lt;code&amp;gt;0x86&amp;lt;/code&amp;gt; -- invalid opcode&lt;br /&gt;
* &amp;lt;code&amp;gt;0x87&amp;lt;/code&amp;gt; -- modifier; read next opcode, its top bit tells if it's a tile run or a tile skip minus one&lt;br /&gt;
* &amp;lt;code&amp;gt;0x88&amp;lt;/code&amp;gt; -- motion tile, motion vector is coded as two bytes, unsigned for X component and signed for Y component&lt;br /&gt;
* &amp;lt;code&amp;gt;0x89&amp;lt;/code&amp;gt; -- raw tile, read 16 pixel values from colour data for it&lt;br /&gt;
* &amp;lt;code&amp;gt;0x8A&amp;lt;/code&amp;gt; -- motion tile, motion vector is coded as two bytes, X is in -256..-1 range, Y is in -128..127 range&lt;br /&gt;
* all other opcodes are for motion tiles, coding MV as signed nibbles e.g. &amp;lt;code&amp;gt;0xC4&amp;lt;/code&amp;gt; corresponds to &amp;lt;code&amp;gt;(4,-4)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Formats]]&lt;br /&gt;
[[Category:Video Codecs]]&lt;br /&gt;
[[Category:Video FourCCs]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=DMV&amp;diff=16121</id>
		<title>DMV</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=DMV&amp;diff=16121"/>
		<updated>2026-01-24T10:45:33Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Company: Brainstorm Technology&lt;br /&gt;
* Extensions: dmv, mov&lt;br /&gt;
&lt;br /&gt;
This is a video format that is remarkable for coding data for two video frames at one. It has no specific header and frames are always stored in blocks of size 0xAB15 bytes even if data may not make full use of it.&lt;br /&gt;
&lt;br /&gt;
Block starts with 16-bit size of pixel data, 16-bit size of packed tile indices, 253-colour VGA palette (first three colours are unused), pixel data, and LZ77-compressed tile indices. Audio part always starts at offset 0x9D4D.&lt;br /&gt;
&lt;br /&gt;
Frames are coded by splitting a pair of frames into 2x2x2 blocks and painting them with 1-8 colours (from pixel data) using one of 154 pre-defined patterns.&lt;br /&gt;
&lt;br /&gt;
LZ77 compression scheme opcodes (in binary):&lt;br /&gt;
* &amp;lt;code&amp;gt;000xxxxx&amp;lt;/code&amp;gt; -- copy &amp;lt;code&amp;gt;xxxxx&amp;lt;/code&amp;gt;+1 bytes from input&lt;br /&gt;
* &amp;lt;code&amp;gt;001xxxxx yyyyyyyy&amp;lt;/code&amp;gt; -- copy &amp;lt;code&amp;gt;yyyyyyyyxxxxx&amp;lt;/code&amp;gt;+1 bytes from input&lt;br /&gt;
* &amp;lt;code&amp;gt;010xxxxx yyyyyyyy&amp;lt;/code&amp;gt; -- copy &amp;lt;code&amp;gt;xxxxx&amp;lt;/code&amp;gt;+1 bytes from already decoded output using offset &amp;lt;code&amp;gt;yyyyyyyy&amp;lt;/code&amp;gt;+4&lt;br /&gt;
* &amp;lt;code&amp;gt;011xxxxx yyyyyyyy zzzzzzzzz&amp;lt;/code&amp;gt; -- copy &amp;lt;code&amp;gt;yyyyyyyyxxxxx&amp;lt;/code&amp;gt;+1 bytes from already decoded output using offset &amp;lt;code&amp;gt;yyyyyyyy&amp;lt;/code&amp;gt;+4&lt;br /&gt;
* &amp;lt;code&amp;gt;100xxxxx yyyyyyyy zzzzzzzzz&amp;lt;/code&amp;gt; -- copy &amp;lt;code&amp;gt;xxxxx&amp;lt;/code&amp;gt;+1 bytes from already decoded output using offset &amp;lt;code&amp;gt;zzzzzzzzyyyyyyyy&amp;lt;/code&amp;gt;+4&lt;br /&gt;
* &amp;lt;code&amp;gt;101xxxxx wwwwwwww yyyyyyyy zzzzzzzzz&amp;lt;/code&amp;gt; -- copy &amp;lt;code&amp;gt;wwwwwwwwxxxxx&amp;lt;/code&amp;gt;+1 bytes from already decoded output using offset &amp;lt;code&amp;gt;zzzzzzzzyyyyyyyy&amp;lt;/code&amp;gt;+4&lt;br /&gt;
&lt;br /&gt;
== Games using DMV ==&lt;br /&gt;
* [https://www.mobygames.com/game/15510/f1-manager/ F1 Manager (1996)]&lt;br /&gt;
* [https://archive.org/details/msdos_Mystery_of_Plastic_City_Part_II_The_1996 Mystery of Plastic City Part II]&lt;br /&gt;
* some other games by [https://www.mobygames.com/company/565/software-2000/ Software 2000]&lt;br /&gt;
* various trailers and even interactive movie CDs&lt;br /&gt;
&lt;br /&gt;
[[Category: Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Sesame_Street_STR&amp;diff=16120</id>
		<title>Sesame Street STR</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Sesame_Street_STR&amp;diff=16120"/>
		<updated>2026-01-24T10:10:22Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a simple video format used in some &amp;lt;em&amp;gt;Sesame Street&amp;lt;/em&amp;gt; related games.&lt;br /&gt;
&lt;br /&gt;
File header:&lt;br /&gt;
  4 bytes - &amp;quot;STHD&amp;quot;&lt;br /&gt;
  4 bytes - version (should be 0x100)&lt;br /&gt;
  4 bytes - unknown&lt;br /&gt;
  4 bytes - unknown, usually zero&lt;br /&gt;
  4 bytes - audio sample rate&lt;br /&gt;
  2 bytes - bits per audio sample&lt;br /&gt;
  2 bytes - padding?&lt;br /&gt;
&lt;br /&gt;
Data is organised into chunks, &amp;lt;code&amp;gt;&amp;quot;GRPH&amp;quot;&amp;lt;/code&amp;gt; for images and palettes, &amp;lt;code&amp;gt;&amp;quot;SND &amp;quot;&amp;lt;/code&amp;gt; for audio. Each chunk beside 32-bit usually has one nested subchunk telling what kind of data it is: for video it is either &amp;lt;code&amp;gt;&amp;quot;PAL &amp;quot;&amp;lt;/code&amp;gt; for palette or &amp;lt;code&amp;gt;&amp;quot;PIXX&amp;quot;&amp;lt;/code&amp;gt; for image; for audio it is &amp;lt;code&amp;gt;&amp;quot;SSMP&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Image (sub)chunk has dimensions in its header and stores raw data in permuted form: by VGA bank (i.e. every fourth column) where data is also 4-way interleaved.&lt;br /&gt;
&lt;br /&gt;
[[Category: Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Celestial_Impact_DXV&amp;diff=16119</id>
		<title>Celestial Impact DXV</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Celestial_Impact_DXV&amp;diff=16119"/>
		<updated>2026-01-24T10:00:18Z</updated>

		<summary type="html">&lt;p&gt;Kostya: Created page with &amp;quot;This is a simple RLE-based format used in &amp;lt;em&amp;gt;Celestial Impact&amp;lt;/em&amp;gt; intro file.  First 32-bit value in the file is the number of frames, then frames follow (each prefixed with 32-bit size). Frame data is 141172 bytes of data compressed with RLE; this data includes 400x300 image, 768 bytes of palette, and seemingly unused data. RLE compression is simple: top bit of the opcode tells whether it is a run or copy, bottom 7 bits tell run/copy length.  Category: Game Formats&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a simple RLE-based format used in &amp;lt;em&amp;gt;Celestial Impact&amp;lt;/em&amp;gt; intro file.&lt;br /&gt;
&lt;br /&gt;
First 32-bit value in the file is the number of frames, then frames follow (each prefixed with 32-bit size). Frame data is 141172 bytes of data compressed with RLE; this data includes 400x300 image, 768 bytes of palette, and seemingly unused data. RLE compression is simple: top bit of the opcode tells whether it is a run or copy, bottom 7 bits tell run/copy length.&lt;br /&gt;
&lt;br /&gt;
[[Category: Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=NAF&amp;diff=16118</id>
		<title>NAF</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=NAF&amp;diff=16118"/>
		<updated>2026-01-24T09:55:27Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Company: Ninell&lt;br /&gt;
* Extension: naf, ngf (for images)&lt;br /&gt;
&lt;br /&gt;
This is a simple raw container format that is usually compressed with &amp;lt;code&amp;gt;GZip&amp;lt;/code&amp;gt; first. It seems to be employed on some companion disks to certain Central European game magazines like &amp;lt;em&amp;gt;Secret Service&amp;lt;/em&amp;gt; or &amp;lt;em&amp;gt;Score&amp;lt;/em&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
File header:&lt;br /&gt;
  3 bytes - &amp;quot;NAF&amp;quot; (animation) or &amp;quot;NGF&amp;quot; (image)&lt;br /&gt;
  1 bytes - major version? (always 1)&lt;br /&gt;
  1 bytes - minor version? (always 0)&lt;br /&gt;
  2 bytes - width&lt;br /&gt;
  2 bytes - height&lt;br /&gt;
  768 bytes - VGA palette for videos or full-range palette for images&lt;br /&gt;
&lt;br /&gt;
Picture or animation frames are just raw data without any additional compression or reordering.&lt;br /&gt;
&lt;br /&gt;
[[Category:Container Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=MGIF&amp;diff=16117</id>
		<title>MGIF</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=MGIF&amp;diff=16117"/>
		<updated>2026-01-24T09:44:36Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Company: Napoleon Games s.r.o.&lt;br /&gt;
* Extension: mgf&lt;br /&gt;
* Game: [https://www.mobygames.com/game/55639/gates-of-skeldal/ Gates of Skeldal]&lt;br /&gt;
&lt;br /&gt;
This is a video format employing LZW compression (hence the name). Beside that it does not seem to have anything common with GIF.&lt;br /&gt;
&lt;br /&gt;
Video is organised into frame blocks that may contain several chunks with e.g. video or audio data with video data employing LZW compression. One remarkable thing about LZW compression scheme employed here is that it uses delta compression: actual bytes are coded as a difference to the previously decoded value (or 0 after each LZW restart). Images are always 320x180.&lt;br /&gt;
&lt;br /&gt;
File header:&lt;br /&gt;
  6 bytes - &amp;quot;MGIF97&amp;quot;&lt;br /&gt;
  3 bytes - unknown&lt;br /&gt;
  4 bytes - number of blocks&lt;br /&gt;
  582 bytes - unknown/ignored (data starts at offset 0x253)&lt;br /&gt;
&lt;br /&gt;
Each block starts with a byte telling number of chunks in it and 24-bit size. Each chunk also starts with 8-bit type and 24-bit size. Known chunk types are:&lt;br /&gt;
* 1 -- intra frame (LZW-compressed image)&lt;br /&gt;
* 2 -- inter frame (LZW-compressed delta data)&lt;br /&gt;
* 3 -- RGB555 palette&lt;br /&gt;
* 4 -- audio&lt;br /&gt;
&lt;br /&gt;
Inter frames data is organised (after LZW) into two parts (opcodes and pixel data) with 32-bit value in the very beginning being the pixel data offset. Decoding is rather simple: if top two bits of the opcode are set, end this line and skip following number of lines as defined in low 6 bits of the opcode; otherwise opcode is a number of pixel pairs to copy.&lt;br /&gt;
&lt;br /&gt;
[[Category: Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Dark_Moon_UM&amp;diff=16116</id>
		<title>Dark Moon UM</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Dark_Moon_UM&amp;diff=16116"/>
		<updated>2026-01-24T09:29:17Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Company: Crossroads&lt;br /&gt;
* Extension: um&lt;br /&gt;
* Game: [https://www.mobygames.com/game/25567/dark-moon/ Dark Moon]&lt;br /&gt;
&lt;br /&gt;
This is a raw video stream without any header. Frames are 256x128 pixels large stored in VGA banks order (i.e. every fourth pixels on a line) followed by VGA palette.&lt;br /&gt;
&lt;br /&gt;
[[Category: Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=GRN&amp;diff=16115</id>
		<title>GRN</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=GRN&amp;diff=16115"/>
		<updated>2026-01-23T10:26:44Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Company: Microids&lt;br /&gt;
* Extensions: grn, anm&lt;br /&gt;
* Game: [https://www.mobygames.com/game/11809/ultimate-domain/ Ultimate Domain (aka Genesia)]&lt;br /&gt;
&lt;br /&gt;
This is a video format that has chunked video stream interleaved with audio data if present. If file header indicates audio, then it gets padded to 2kB, followed by the signalled number of 2kB sectors of initial audio data and then it is 8kB of video stream followed by 2kB of audio followed by 8kB of video stream... Without audio there is no header padding or audio sectors present. Video data may employ RLE and/or LZSS for compression.&lt;br /&gt;
&lt;br /&gt;
Header format:&lt;br /&gt;
  4 bytes - &amp;quot;ANIM&amp;quot;&lt;br /&gt;
  4 bytes - data offset&lt;br /&gt;
  2 bytes - width&lt;br /&gt;
  2 bytes - height&lt;br /&gt;
  2 bytes - depth (8 bits per pixel)&lt;br /&gt;
  2 bytes - number of video chunks minus one&lt;br /&gt;
  4 bytes - delay in milliseconds between frames&lt;br /&gt;
  4 bytes - unknown&lt;br /&gt;
  2 bytes - unknown&lt;br /&gt;
  2 bytes - unknown&lt;br /&gt;
  4 bytes - number of 2kB initial audio sectors&lt;br /&gt;
  N*2 bytes - video chunk sizes&lt;br /&gt;
&lt;br /&gt;
Known chunks are:&lt;br /&gt;
* &amp;quot;PAL\x00&amp;quot; -- palette data&lt;br /&gt;
* &amp;quot;IMAGE&amp;quot; -- uncompressed image&lt;br /&gt;
* &amp;quot;LZIM&amp;quot; -- LZSS-compressed image&lt;br /&gt;
* &amp;quot;FRM2&amp;quot; -- RLE-compressed image&lt;br /&gt;
* &amp;quot;LZF2&amp;quot; -- LZSS compressed data for RLE-compressed image &lt;br /&gt;
&lt;br /&gt;
RLE compression resembles FLI but it operates on pairs of pixels. First two 16-bit values define from which line to start decoding and how many lines to process. For each line there's a byte telling how many skip/paint operations are there (1 - skip, 2 - skip, paint, 3 - skip, paint, skip etc), skip operation is one byte telling how many pairs of pixels to skip, paint operation is a signed byte value, non-negative values telling how many bytes to copy from input, negative values telling how many times to repeat the pixel pair from input.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=AMF&amp;diff=16114</id>
		<title>AMF</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=AMF&amp;diff=16114"/>
		<updated>2026-01-23T10:10:41Z</updated>

		<summary type="html">&lt;p&gt;Kostya: update information for CITY 2000 flavour&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Extension: amf&lt;br /&gt;
* Samples: [http://samples.mplayerhq.hu/game-formats/amf/ http://samples.mplayerhq.hu/game-formats/amf/]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Not to be confused with [[Asylum Music Format]]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AMF is a very simple video file format used in the game [http://www.mobygames.com/game/dos/manic-karts Manic Karts] and [https://www.mobygames.com/game/21988/city-2000/ C.I.T.Y. 2000].&lt;br /&gt;
Contains [[RLE]]-encoded palettized video and optionally audio (in &amp;lt;em&amp;gt;C.I.T.Y. 2000&amp;lt;/em&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
&lt;br /&gt;
All numbers are little-endian. File begins with an 8-byte header:&lt;br /&gt;
&lt;br /&gt;
 u16  numframes    -- number of frames&lt;br /&gt;
 u16  width        -- frame width&lt;br /&gt;
 u16  height       -- frame height&lt;br /&gt;
 u16  unknown      -- unknown/unused, always 2&lt;br /&gt;
&lt;br /&gt;
and is followed by at least numframes + 1 frame chunks. Each frame chunk begins with a short header:&lt;br /&gt;
&lt;br /&gt;
 u8   type         -- chunk type&lt;br /&gt;
 u16  size         -- chunk payload size (w/o this header)&lt;br /&gt;
&lt;br /&gt;
and then followed by a chunk payload.&lt;br /&gt;
&lt;br /&gt;
Observed chunk types:&lt;br /&gt;
* 0x3D - audio data (6-byte header followed by 11kHz 8-bit mono PCM)&lt;br /&gt;
* 0x3E - palette chunk (always first chunk in file) Payload format:&lt;br /&gt;
 u8  firstcolor                -- first color of palette to update (always 64)&lt;br /&gt;
 RGB palette[256-firstcolor]   -- new palette entries (always 256-64 = 192 triplets), 6-bits [[DAC]] values&lt;br /&gt;
* 0x3F - video frame chunk (a video file has total numframes chunks of this type) Contains compressed video data&lt;br /&gt;
* all other chunk types are ignored/skipped.&lt;br /&gt;
&lt;br /&gt;
Note: palette can not be changed during playback. Playback rate is about 10 fps.&lt;br /&gt;
&lt;br /&gt;
== Video Decompression ==&lt;br /&gt;
&lt;br /&gt;
 while input buffer is not exhausted&lt;br /&gt;
   tag = next byte of input&lt;br /&gt;
   tag is:&lt;br /&gt;
     &amp;lt;  0x20 : skip (tag) pixels&lt;br /&gt;
     == 0x20 : skip (DecodeLength) pixels&lt;br /&gt;
     &amp;lt;  0x3F : fill (tag - 0x21 + 2) pixels with the next byte of input&lt;br /&gt;
     == 0x3F : fill (DecodeLength) pixels with the next byte of input&lt;br /&gt;
     &amp;gt;= 0x40 : draw (tag)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DecodeLength loads variable-sized length value:&lt;br /&gt;
&lt;br /&gt;
  length = 32&lt;br /&gt;
  repeat&lt;br /&gt;
    delta = next byte of input&lt;br /&gt;
    length += delta&lt;br /&gt;
  until delta != 0xFF&lt;br /&gt;
&lt;br /&gt;
== Trivia ==&lt;br /&gt;
&lt;br /&gt;
The MANIC.AMF file has several [[BMP]] files attached at the end.&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Formats]]&lt;br /&gt;
[[Category:Formats missing in FFmpeg]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Arc_Developments_HUF&amp;diff=16113</id>
		<title>Arc Developments HUF</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Arc_Developments_HUF&amp;diff=16113"/>
		<updated>2026-01-23T10:06:56Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Company: Arc Developments Limited&lt;br /&gt;
* Extension: huf&lt;br /&gt;
* Game: [https://www.mobygames.com/game/31064/johnny-bazookatone/ Johnny Bazookatone]&lt;br /&gt;
&lt;br /&gt;
This is a video format employing RLE and static Huffman compression (symbol weights for which are transmitted in the header). Audio format is 8-bit mono 22kHz PCM.&lt;br /&gt;
&lt;br /&gt;
File header:&lt;br /&gt;
  8 bytes - &amp;quot;[AVF-95]&amp;quot;&lt;br /&gt;
  2 bytes - width&lt;br /&gt;
  2 bytes - height&lt;br /&gt;
  4 bytes - number of frames&lt;br /&gt;
  9 bytes - unknown&lt;br /&gt;
  256 bytes - weights&lt;br /&gt;
  132300 bytes - initial audio data&lt;br /&gt;
&lt;br /&gt;
Frames start with 32-bit size and 8-bit type (0 - intra, 1 - inter) followed by VGA palette for 128 colours and Huffman-compressed data. Last 1470 bytes of the frame are audio data.&lt;br /&gt;
&lt;br /&gt;
After decompressing video data, intra or inter RLE should be applied. Intra RLE is trivial (top bit of the opcode is run flag, bottom 7 bits are pixel value; when run flag is set, next byte tells how many times to repeat the pixel instead of just once with zero value coding end of frame). Inter RLE uses the following opcodes (the number of those opcodes is the first 16 bits of video data): &amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt; -- read 16-bit value and skip that amount of pixels, &amp;lt;code&amp;gt;0x01..0x7F&amp;lt;/code&amp;gt; -- read byte value and skip that many pixels, then read 1..127 pixels, &amp;lt;code&amp;gt;0x80..0xFF&amp;lt;/code&amp;gt; -- read byte value and skip that many pixels, then read colour value and repeat it 128..1 times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Interactive_Pictures_VID&amp;diff=16112</id>
		<title>Interactive Pictures VID</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Interactive_Pictures_VID&amp;diff=16112"/>
		<updated>2026-01-23T09:53:26Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Company: [https://www.mobygames.com/company/14057/interactive-pictures/ Interactive Pictures]&lt;br /&gt;
* Extensions: evd, fvd, gvd&lt;br /&gt;
&lt;br /&gt;
This is a format used in at least DOS version of a poker game by the company. &lt;br /&gt;
&lt;br /&gt;
File header:&lt;br /&gt;
  4 bytes - &amp;quot;VID\x01&amp;quot;&lt;br /&gt;
  4 bytes - number of frames&lt;br /&gt;
  4 bytes - unknown&lt;br /&gt;
  1 byte  - unknown, tile size?&lt;br /&gt;
  2 bytes - width&lt;br /&gt;
  2 bytes - height&lt;br /&gt;
  1 byte  - unknown&lt;br /&gt;
  1 byte  - frames per second&lt;br /&gt;
  2 bytes - number of colours&lt;br /&gt;
  4 bytes - sample rate&lt;br /&gt;
  231 bytes - padding to 256 bytes&lt;br /&gt;
  C*3 bytes - VGA palette&lt;br /&gt;
&lt;br /&gt;
Frame data starts with 16-bit sizes for audio, palette update and video parts. Palette updates are put at the end of palette (i.e. usually low 128 colours are transmitted in the header and top 128 colours are transmitted and updated by the frame data).&lt;br /&gt;
&lt;br /&gt;
Video is coded in 8x8 tiles using following opcodes:&lt;br /&gt;
* &amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt; -- raw tile&lt;br /&gt;
* &amp;lt;code&amp;gt;0x01..0x10&amp;lt;/code&amp;gt; -- 2D RLE: read 64 bits telling where new colour value should be used and fill tile using one of 16 pre-defined scan orders&lt;br /&gt;
* &amp;lt;code&amp;gt;0x80&amp;lt;/code&amp;gt; -- read 64-bit mask and colour value, update tile with this new value in the positions where mask is set&lt;br /&gt;
* &amp;lt;code&amp;gt;0x81&amp;lt;/code&amp;gt; -- read 64-bit mask and colour pair, paint tile using mask to select one of those colours&lt;br /&gt;
* &amp;lt;code&amp;gt;0xFB&amp;lt;/code&amp;gt; -- read 4 colours and 64x2-bit index array, paint tile using appropriate colours&lt;br /&gt;
* &amp;lt;code&amp;gt;0xFD&amp;lt;/code&amp;gt; -- read 16 colours and 64x4-bit index array, paint tile using appropriate colours&lt;br /&gt;
* &amp;lt;code&amp;gt;0xFF&amp;lt;/code&amp;gt; -- read colour value, fill tile with it&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Archimedean_Dynasty_MVI&amp;diff=16111</id>
		<title>Archimedean Dynasty MVI</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Archimedean_Dynasty_MVI&amp;diff=16111"/>
		<updated>2026-01-23T09:36:49Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Extension: mvi&lt;br /&gt;
* Company Massive Development GmbH&lt;br /&gt;
&lt;br /&gt;
This is a video format used in [https://www.mobygames.com/game/2881/archimedean-dynasty/ Schleichfahrt] game that employs LZW compression.&lt;br /&gt;
&lt;br /&gt;
File header:&lt;br /&gt;
  4 bytes - 1 (version?)&lt;br /&gt;
  4 bytes - unknown&lt;br /&gt;
  4 bytes - width&lt;br /&gt;
  4 bytes - height&lt;br /&gt;
  4 bytes - number of frames&lt;br /&gt;
  4 bytes - unknown&lt;br /&gt;
  4 bytes - unknown (always 61?)&lt;br /&gt;
  4 bytes - frames per second&lt;br /&gt;
  4 bytes - audio present&lt;br /&gt;
  4 bytes - number of channels&lt;br /&gt;
  4 bytes - sample rate&lt;br /&gt;
  4 bytes - bits per audio sample&lt;br /&gt;
  N bytes - frame table&lt;br /&gt;
&lt;br /&gt;
Frame table consists of the following records:&lt;br /&gt;
  4 bytes - frame type&lt;br /&gt;
  4 bytes - unknown&lt;br /&gt;
  4 bytes - frame size&lt;br /&gt;
  4 bytes - offset&lt;br /&gt;
&lt;br /&gt;
Frame types are:&lt;br /&gt;
* 1 -- intra frame&lt;br /&gt;
* 2 -- inter frame&lt;br /&gt;
* 3 -- monaural audio&lt;br /&gt;
* 4 -- stereo audio&lt;br /&gt;
* 5 -- palette (sometimes followed by some table)&lt;br /&gt;
&lt;br /&gt;
Intra frames start with 32-bit packed and unpacked sizes for the frame pixels followed by LZW-compressed data if packed size is smaller (and theoretically raw data otherwise). LZW compression is remarkable for mapping 0 to explicit dictionary size bumping, 1 to dictionary reset, 2 to data end and 3..258 to actual symbols.&lt;br /&gt;
&lt;br /&gt;
Inter frames consist of two parts, pixel data and mask data telling where to put those pixels at. Packed and unpacked sizes for both parts are transmitted before actual data. If packed and unpacked sizes are the same, data is unpacked; otherwise LZW compression is used.&lt;br /&gt;
&lt;br /&gt;
[[Category: Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=FLK&amp;diff=16110</id>
		<title>FLK</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=FLK&amp;diff=16110"/>
		<updated>2026-01-21T04:56:45Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an LZW-based format used in some Italian adult game called &amp;lt;em&amp;gt;Selen&amp;lt;/em&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Video consists of one or more blocks of frames with the same palette.&lt;br /&gt;
&lt;br /&gt;
Block header:&lt;br /&gt;
  4 bytes - number of frames&lt;br /&gt;
  4 bytes - video size&lt;br /&gt;
  4 bytes - width&lt;br /&gt;
  4 bytes - height&lt;br /&gt;
  4 bytes - frame table size (should be 64*nframes)&lt;br /&gt;
  12 bytes - unknown&lt;br /&gt;
  4 bytes - suggested unpacked data buffer size&lt;br /&gt;
  16 bytes - unknown&lt;br /&gt;
  N bytes - frame table&lt;br /&gt;
  512 bytes - RGB555 palette&lt;br /&gt;
&lt;br /&gt;
Frame table record:&lt;br /&gt;
  8 bytes - unknown&lt;br /&gt;
  4 bytes - offset to opcodes&lt;br /&gt;
  4 bytes - opcodes size&lt;br /&gt;
  8 bytes - unknown&lt;br /&gt;
  4 bytes - offset to pixel data&lt;br /&gt;
  4 bytes - pixel data size&lt;br /&gt;
  4 bytes - offset to audio data&lt;br /&gt;
  4 bytes - audio data size&lt;br /&gt;
  4 bytes - frame data end?&lt;br /&gt;
  4x2 bytes - bounding rectangle for changed area&lt;br /&gt;
  12 bytes - unknown &lt;br /&gt;
&lt;br /&gt;
Frame data consists of opcodes and LZW-compressed pixel data. If opcodes are not present, pixel data constitutes raw frame.&lt;br /&gt;
&lt;br /&gt;
Opcodes (in binary):&lt;br /&gt;
* &amp;lt;code&amp;gt;000nnnnn&amp;lt;/code&amp;gt; -- output 0..31 pixels&lt;br /&gt;
* &amp;lt;code&amp;gt;001nnnnn nnnnnnnn&amp;lt;/code&amp;gt; -- output 0..8191 pixels&lt;br /&gt;
* &amp;lt;code&amp;gt;010nnnnn&amp;lt;/code&amp;gt; -- run of 0..31 pixels&lt;br /&gt;
* &amp;lt;code&amp;gt;011nnnnn nnnnnnnn&amp;lt;/code&amp;gt; -- run of 0..8191 pixels&lt;br /&gt;
* &amp;lt;code&amp;gt;100nnnnn&amp;lt;/code&amp;gt; -- restore 0..31 pixels of the initial background&lt;br /&gt;
* &amp;lt;code&amp;gt;101nnnnn nnnnnnnn&amp;lt;/code&amp;gt; -- restore 0..8191 pixels of the initial background&lt;br /&gt;
* &amp;lt;code&amp;gt;11000000 00000000&amp;lt;/code&amp;gt; -- end of current line&lt;br /&gt;
* &amp;lt;code&amp;gt;11000000 11111111&amp;lt;/code&amp;gt; -- end of frame&lt;br /&gt;
* &amp;lt;code&amp;gt;11000000 nnnnnnnn&amp;lt;/code&amp;gt; -- skip 1..255 lines&lt;br /&gt;
* &amp;lt;code&amp;gt;110nnnnn&amp;lt;/code&amp;gt; -- skip 0..31 pixels&lt;br /&gt;
* &amp;lt;code&amp;gt;111nnnnn nnnnnnnn&amp;lt;/code&amp;gt; -- skip 0..8191 pixels&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Ikarion_MVI&amp;diff=16109</id>
		<title>Ikarion MVI</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Ikarion_MVI&amp;diff=16109"/>
		<updated>2026-01-21T04:31:22Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Company: Ikarion Software GmbH&lt;br /&gt;
* Extension: mvi&lt;br /&gt;
* Game: [https://www.mobygames.com/game/5821/battle-race/ Battle Race] (both MVI versions are used in it)&lt;br /&gt;
&lt;br /&gt;
There are two distinct MVI formats (even if they are used in the same game): MVI1 employs LZ77 compression on paletted images, MVI2 uses vector quantisation over YUV tiles.&lt;br /&gt;
&lt;br /&gt;
=== MVI1 ===&lt;br /&gt;
&lt;br /&gt;
File starts with &amp;quot;VR6MVI&amp;quot; tag and 16-bit version (either 0x302 or 0x310) followed by blocks of audio and video data.&lt;br /&gt;
&lt;br /&gt;
Version 0x302 blocks contain interleaved audio and video data, version 0x310 blocks start with pre-buffered audio data and have individual audio frames grouped so there may be several video frames between two audio frame groups. &lt;br /&gt;
&lt;br /&gt;
Block header format:&lt;br /&gt;
  2 bytes - number of frames&lt;br /&gt;
  2 bytes - number of 400-byte buffers per audio frame&lt;br /&gt;
  1 byte (version 0x310 only) - number of audio frames in group&lt;br /&gt;
  1 byte (version 0x310 only) - number of audio frames to pre-buffer&lt;br /&gt;
  2 bytes - frame sizes size&lt;br /&gt;
  N bytes - packed frame sizes&lt;br /&gt;
&lt;br /&gt;
Frame sizes are stored as variable-length integers in radix-7 form: each byte has top bit signalling whether the next byte is also a part of this integer and low 7 bits containing part of the integer (LSB first). E.g. &amp;lt;code&amp;gt;0x2A&amp;lt;/code&amp;gt; is coded as &amp;lt;code&amp;gt;0x2A&amp;lt;/code&amp;gt; while &amp;lt;code&amp;gt;0x100&amp;lt;/code&amp;gt; is coded as &amp;lt;code&amp;gt;0x80 0x02&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Each frame starts with 8-bit flags:&lt;br /&gt;
* bit 0 - audio present&lt;br /&gt;
* bit 1 - special tile-based motion compensation scheme with RLE compression (not present in known samples)&lt;br /&gt;
* bit 2 - frame data is LZ77-compressed&lt;br /&gt;
* bit 3 - LZ77-compressed palette data is present&lt;br /&gt;
&lt;br /&gt;
LZ77 compression opcodes:&lt;br /&gt;
* &amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt; -- leave next 16-bit amount of output unchanged&lt;br /&gt;
* &amp;lt;code&amp;gt;0x01..0x7F&amp;lt;/code&amp;gt; -- leave next 1..127 bytes of output unchanged&lt;br /&gt;
* &amp;lt;code&amp;gt;0x80..0x9F&amp;lt;/code&amp;gt; -- copy next 1..32 bytes&lt;br /&gt;
* &amp;lt;code&amp;gt;0xA0..0xBF&amp;lt;/code&amp;gt; -- repeat next value 2..33 times&lt;br /&gt;
* &amp;lt;code&amp;gt;0xC0..0xFF&amp;lt;/code&amp;gt; -- read 1-2 byte offset (in the same way as frame size above), copy 2..65 bytes using that offset (relative to the current position e.g. offset 1 means repeating last byte)&lt;br /&gt;
&lt;br /&gt;
=== MVI2 ===&lt;br /&gt;
&lt;br /&gt;
File header:&lt;br /&gt;
  4 bytes - &amp;quot;MVI2&amp;quot;&lt;br /&gt;
  2 bytes - version (should be 0x101)&lt;br /&gt;
  2 bytes - number of frames&lt;br /&gt;
  2 bytes - delay in milliseconds between frames&lt;br /&gt;
  1 byte  - width in tiles&lt;br /&gt;
  1 byte  - height in tiles&lt;br /&gt;
  1 byte  - Y depth (should be 5)&lt;br /&gt;
  1 byte  - U depth (should be 5)&lt;br /&gt;
  1 byte  - V depth (should be 5)&lt;br /&gt;
  1 byte  - index entry bits (should be 12)&lt;br /&gt;
  1 byte  - tile width exponent (should be 2, for 4x4 tiles)&lt;br /&gt;
  1 byte  - tile height exponent (should be 2, for 4x4 tiles)&lt;br /&gt;
  4*N bytes - frame sizes&lt;br /&gt;
&lt;br /&gt;
Frame starts with 8-bit flags, IMA ADPCM compressed audio data, tile data update (prefixed by 16-bit number of tiles to update) and tile indices.&lt;br /&gt;
&lt;br /&gt;
Tile data is stored as 5-bit values packed LSB first into 10 bytes for 4x4 tile. Tiles are stored in the circular buffer of 4096 tiles, so e.g. if you have first updated 4000 tiles and then 100 tiles then the second update will overwrite 4 first tiles and next update will touch fifth tile and so on.&lt;br /&gt;
&lt;br /&gt;
Frame is split into 64x64 macro tiles that consist of 16x16 Y tiles of size 4x4, 8x8 U tiles and 8x8 V tiles. All tiles are coded as 12-bit indices in the common tile buffer. So e.g. for 128x64 frame first you read 256 Y tile indices for the first macro tile, then 64 U and 64 V indices for the same, and then repeat it for the second macro tile.&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=GTE_Vantage_animation&amp;diff=16108</id>
		<title>GTE Vantage animation</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=GTE_Vantage_animation&amp;diff=16108"/>
		<updated>2026-01-21T03:39:31Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Company: GTE Vantage Inc.&lt;br /&gt;
* Extension: gav&lt;br /&gt;
* Game: [https://www.mobygames.com/game/4796/ncaa-championship-basketball/ NCAA Championship Basketball] (at least game demo)&lt;br /&gt;
&lt;br /&gt;
This is a simple format with independently RLE-compressed frames (animations are even accompanied by auxiliary index files with frame positions to enable easy seeking).&lt;br /&gt;
&lt;br /&gt;
Header:&lt;br /&gt;
  4 bytes - &amp;quot;GAV &amp;quot;&lt;br /&gt;
  4 bytes - number of frames&lt;br /&gt;
  2 bytes - frames per second&lt;br /&gt;
  2 bytes - width&lt;br /&gt;
  2 bytes - height&lt;br /&gt;
  1 byte  - local palette is in use&lt;br /&gt;
  1 byte  - padding&lt;br /&gt;
  768 bytes - VGA palette&lt;br /&gt;
&lt;br /&gt;
Frames start with 32-bit size, 768-byte VGA palette (unless the header signals global palette use only) and RLE data.&lt;br /&gt;
&lt;br /&gt;
RLE scheme is simple: opcode &amp;lt;code&amp;gt;00&amp;lt;/code&amp;gt; means end of stream, &amp;lt;code&amp;gt;01..7F&amp;lt;/code&amp;gt; means copying next 1..127 bytes, &amp;lt;code&amp;gt;80..FF&amp;lt;/code&amp;gt; means repeat the following byte 0-127 times.&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=MP_Entertainment_animation&amp;diff=16107</id>
		<title>MP Entertainment animation</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=MP_Entertainment_animation&amp;diff=16107"/>
		<updated>2026-01-21T03:28:54Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Company: MP Entertainment&lt;br /&gt;
* Extensions: anm, seq&lt;br /&gt;
* Game: [https://www.mobygames.com/game/3994/hopkins-fbi/ Hopkins FBI]&lt;br /&gt;
&lt;br /&gt;
This is a simple chunk-based format employing RLE compression.&lt;br /&gt;
&lt;br /&gt;
File starts with &amp;quot;MPANIM&amp;quot; tag followed by 768-byte palette. First chunk should be &amp;quot;NORM&amp;quot; which contains 32-bit size, 14 bytes of data, and uncompressed frame (640x480).&lt;br /&gt;
Other chunks start with &amp;quot;IMAGE=&amp;quot; tag, 32-bit size, 32-bit unknown value, and the rest is RLE data.&lt;br /&gt;
&lt;br /&gt;
RLE opcodes:&lt;br /&gt;
* &amp;lt;code&amp;gt;D3&amp;lt;/code&amp;gt; (ANM only) -- long run (1 byte run length and 1 byte run value)&lt;br /&gt;
* &amp;lt;code&amp;gt;D4..DD&amp;lt;/code&amp;gt; (ANM only) -- repeat next byte 1..10 times&lt;br /&gt;
* &amp;lt;code&amp;gt;DE..FA&amp;lt;/code&amp;gt; (ANM only) -- skip 1..27 pixels&lt;br /&gt;
* &amp;lt;code&amp;gt;FB&amp;lt;/code&amp;gt; -- not encountered&lt;br /&gt;
* &amp;lt;code&amp;gt;FC&amp;lt;/code&amp;gt; -- end of stream&lt;br /&gt;
* &amp;lt;code&amp;gt;FD&amp;lt;/code&amp;gt; -- next byte tells how many pixels to skip&lt;br /&gt;
* &amp;lt;code&amp;gt;FE&amp;lt;/code&amp;gt; -- next 16-bit value tells how many pixels to skip&lt;br /&gt;
* &amp;lt;code&amp;gt;FF&amp;lt;/code&amp;gt; -- next 32-bit value tells how many pixels to skip&lt;br /&gt;
* all other opcodes are treated as pixel values&lt;br /&gt;
&lt;br /&gt;
As you can see, the difference between ANM and SEQ is that the latter has only skip codes and &amp;lt;code&amp;gt;D3..FA&amp;lt;/code&amp;gt; values are treated as normal pixels.&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=TMM-Frac&amp;diff=16091</id>
		<title>TMM-Frac</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=TMM-Frac&amp;diff=16091"/>
		<updated>2025-11-10T14:08:18Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Company: Total Multimedia&lt;br /&gt;
&lt;br /&gt;
This is a format that employs licensed [[Iterated Systems Fractal Codec]] and was used for some interactive video discs in DOS era.&lt;br /&gt;
&lt;br /&gt;
Multimedia data is stored in blocks of 0xF800 bytes long that comprise several frames with audio and video data.&lt;br /&gt;
&lt;br /&gt;
Block header format:&lt;br /&gt;
  32 bits -- 0x007C0EBF&lt;br /&gt;
  16 bits -- 0x007C (normal block) or 0x0000 (last block)&lt;br /&gt;
  16 bits -- number of frames in block&lt;br /&gt;
&lt;br /&gt;
Frames start with a header:&lt;br /&gt;
  16 bits -- video frame flags (or some unused value for audio)&lt;br /&gt;
  16 bits -- frame type (0x000C - video, 0x0700 - audio)&lt;br /&gt;
  16 bits -- audio frame size (or some unused value for video)&lt;br /&gt;
  16 bits -- video frame size&lt;br /&gt;
&lt;br /&gt;
Audio is stored as 8-bit 22kHz mono PCM, for video the part starting with motion offsets count is transmitted.&lt;br /&gt;
&lt;br /&gt;
First block starts with a header, at offset &amp;lt;code&amp;gt;0x24&amp;lt;/code&amp;gt; there's an absolute offset to the palette data and frame data usually starts at offset &amp;lt;code&amp;gt;0xb3&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=FVF&amp;diff=16090</id>
		<title>FVF</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=FVF&amp;diff=16090"/>
		<updated>2025-11-10T13:44:57Z</updated>

		<summary type="html">&lt;p&gt;Kostya: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;FVF is a format used for cutscenes in [https://www.mobygames.com/game/957/star-trek-the-next-generation-a-final-unity/ Star Trek: The Next Generation - &amp;quot;A Final Unity&amp;quot;] game.&lt;br /&gt;
&lt;br /&gt;
== File structure ==&lt;br /&gt;
All data is little-endian. Data is grouped into frames that are grouped into blocks aligned to at least 2048 bytes. Audio is stored as unpacked PCM, video is compressed with the licensed [[Iterated Systems Fractal Codec]].&lt;br /&gt;
&lt;br /&gt;
Header:&lt;br /&gt;
  4 bytes - &amp;quot;FVF &amp;quot;&lt;br /&gt;
  4 bytes - unknown&lt;br /&gt;
  4 bytes - unknown&lt;br /&gt;
  4 bytes - unknown&lt;br /&gt;
  4 bytes - first block offset&lt;br /&gt;
  4 bytes - last block offset&lt;br /&gt;
  4 bytes - image header (should be 0x60)&lt;br /&gt;
  4 bytes - audio header (usually 0xB5)&lt;br /&gt;
  64 bytes - unknown&lt;br /&gt;
&lt;br /&gt;
Image header:&lt;br /&gt;
  2 bytes - header size? (usually 40)&lt;br /&gt;
  2 bytes - always 1?&lt;br /&gt;
  2 bytes - always 16?&lt;br /&gt;
  2 bytes - width&lt;br /&gt;
  2 bytes - height&lt;br /&gt;
  4 bytes - delay in milliseconds&lt;br /&gt;
  4 bytes - unknown&lt;br /&gt;
  4 bytes - number of frames&lt;br /&gt;
  4 bytes - unknown&lt;br /&gt;
  2 bytes - unknown&lt;br /&gt;
  1 byte  - palette something&lt;br /&gt;
  1 byte  - number of palette entries (usually 15)&lt;br /&gt;
  4 bytes - palette offset (usually 0x88)&lt;br /&gt;
  6 bytes - unknown&lt;br /&gt;
&lt;br /&gt;
Audio header:&lt;br /&gt;
  2 bytes - compression? (usually it's 1 and raw PCM)&lt;br /&gt;
  2 bytes - number of channels?&lt;br /&gt;
  2 bytes - bits per sample (usually 8)&lt;br /&gt;
  2 bytes - sampling rate&lt;br /&gt;
  8 bytes - unknown&lt;br /&gt;
&lt;br /&gt;
Block header:&lt;br /&gt;
  2 bytes - header size (should be 16)&lt;br /&gt;
  2 bytes - flags&lt;br /&gt;
  4 bytes - previous block size&lt;br /&gt;
  4 bytes - current block size&lt;br /&gt;
  4 bytes - next block size&lt;br /&gt;
&lt;br /&gt;
Frame header:&lt;br /&gt;
  2 bytes - header size (should be 24)&lt;br /&gt;
  4 bytes - full size&lt;br /&gt;
  4 bytes - always 24?&lt;br /&gt;
  4 bytes - video part size&lt;br /&gt;
  4 bytes - audio part size&lt;br /&gt;
  6 bytes - unknown&lt;br /&gt;
&lt;br /&gt;
Video frame data is in the same format as VfW variant of the codec, audio part starts with 32-bit size followed by PCM data.&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=FVF&amp;diff=16089</id>
		<title>FVF</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=FVF&amp;diff=16089"/>
		<updated>2025-11-10T13:43:55Z</updated>

		<summary type="html">&lt;p&gt;Kostya: Update information about the video codec&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;FVF is a format used for cutscenes in [https://www.mobygames.com/game/957/star-trek-the-next-generation-a-final-unity/ Star Trek: The Next Generation - &amp;quot;A Final Unity&amp;quot;] game.&lt;br /&gt;
&lt;br /&gt;
== File structure ==&lt;br /&gt;
All data is little-endian. Data is grouped into frames that are grouped into blocks aligned to at least 2048 bytes. Audio is stored as unpacked PCM, video is compressed with the licensed [[Iterated System Fractal Codec]].&lt;br /&gt;
&lt;br /&gt;
Header:&lt;br /&gt;
  4 bytes - &amp;quot;FVF &amp;quot;&lt;br /&gt;
  4 bytes - unknown&lt;br /&gt;
  4 bytes - unknown&lt;br /&gt;
  4 bytes - unknown&lt;br /&gt;
  4 bytes - first block offset&lt;br /&gt;
  4 bytes - last block offset&lt;br /&gt;
  4 bytes - image header (should be 0x60)&lt;br /&gt;
  4 bytes - audio header (usually 0xB5)&lt;br /&gt;
  64 bytes - unknown&lt;br /&gt;
&lt;br /&gt;
Image header:&lt;br /&gt;
  2 bytes - header size? (usually 40)&lt;br /&gt;
  2 bytes - always 1?&lt;br /&gt;
  2 bytes - always 16?&lt;br /&gt;
  2 bytes - width&lt;br /&gt;
  2 bytes - height&lt;br /&gt;
  4 bytes - delay in milliseconds&lt;br /&gt;
  4 bytes - unknown&lt;br /&gt;
  4 bytes - number of frames&lt;br /&gt;
  4 bytes - unknown&lt;br /&gt;
  2 bytes - unknown&lt;br /&gt;
  1 byte  - palette something&lt;br /&gt;
  1 byte  - number of palette entries (usually 15)&lt;br /&gt;
  4 bytes - palette offset (usually 0x88)&lt;br /&gt;
  6 bytes - unknown&lt;br /&gt;
&lt;br /&gt;
Audio header:&lt;br /&gt;
  2 bytes - compression? (usually it's 1 and raw PCM)&lt;br /&gt;
  2 bytes - number of channels?&lt;br /&gt;
  2 bytes - bits per sample (usually 8)&lt;br /&gt;
  2 bytes - sampling rate&lt;br /&gt;
  8 bytes - unknown&lt;br /&gt;
&lt;br /&gt;
Block header:&lt;br /&gt;
  2 bytes - header size (should be 16)&lt;br /&gt;
  2 bytes - flags&lt;br /&gt;
  4 bytes - previous block size&lt;br /&gt;
  4 bytes - current block size&lt;br /&gt;
  4 bytes - next block size&lt;br /&gt;
&lt;br /&gt;
Frame header:&lt;br /&gt;
  2 bytes - header size (should be 24)&lt;br /&gt;
  4 bytes - full size&lt;br /&gt;
  4 bytes - always 24?&lt;br /&gt;
  4 bytes - video part size&lt;br /&gt;
  4 bytes - audio part size&lt;br /&gt;
  6 bytes - unknown&lt;br /&gt;
&lt;br /&gt;
Video frame data is in the same format as VfW variant of the codec, audio part starts with 32-bit size followed by PCM data.&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Iterated_Systems&amp;diff=16088</id>
		<title>Iterated Systems</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Iterated_Systems&amp;diff=16088"/>
		<updated>2025-11-09T16:08:45Z</updated>

		<summary type="html">&lt;p&gt;Kostya: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Website: http://www.iterated.com/ (now defunct)&lt;br /&gt;
&lt;br /&gt;
Iterated Systems developed the [[Iterated Systems Fractal Codec|Fractal]] and [[ClearVideo]] codec. They are apparently no longer in business.&lt;br /&gt;
&lt;br /&gt;
[[Category:Multimedia-related Companies]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Iterated_Systems_Fractal_Codec&amp;diff=16087</id>
		<title>Iterated Systems Fractal Codec</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Iterated_Systems_Fractal_Codec&amp;diff=16087"/>
		<updated>2025-11-09T15:57:25Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Company: [[Iterated Systems]]&lt;br /&gt;
* FourCCs: FVC1, FVF1&lt;br /&gt;
&lt;br /&gt;
This is the only known true fractal codec. It has been licensed to different companies and forms the base of [[FVF]] and [[TMM-Frac]]. Beside slight header variations, all of them have the same bitstream format.&lt;br /&gt;
&lt;br /&gt;
Video internally is coded as 8-bit greyscale or RGB24 but the output is delivered in either paletted or RGB16 format. Frame is split into 320x200 green plane and one plane with 160x100 red and blue planes. Each plane is split into 8x8 blocks that are further split into 4x4 blocks (in zig-zag order) and either individual 4x4 blocks or 8x8 blocks are coded.&lt;br /&gt;
&lt;br /&gt;
Most of the block coding modes are affine transform, which means taking twice as large block from the reference buffer, throw out odd columns and lines, scale pixel values by three fourths, add brightness value (seven-bit value minus 64) and optionally apply an affine transform.&lt;br /&gt;
There are eight possible affine transforms done as a combination of three base transform (if bit 0 is set then mirror block, if bit 1 is set then flip block, if bit 2 is set then transpose block).&lt;br /&gt;
&lt;br /&gt;
== Bitstream organisation ==&lt;br /&gt;
Frame data consists of three parts: 16-bit frame flags, motion offsets (16-bit count followed by 16-bit signed offsets) and block opcodes. Each opcode consists of 1-4 bytes treated as a series of bit fields (LSB first). VfW codec data starts with 32-bit offset to the palette data, other formats are documented at their own pages.&lt;br /&gt;
&lt;br /&gt;
Frame flags:&lt;br /&gt;
* 1 -- fractal frame, data should be decoded 16 times&lt;br /&gt;
* 2 -- palette data present after the frame data&lt;br /&gt;
* 4 -- swap buffers (reference and current output; for fractal frames that's done on each iteration of the decoding) and output new reference buffer&lt;br /&gt;
* 8 -- skip frame (no data is coded)&lt;br /&gt;
&lt;br /&gt;
Opcodes are:&lt;br /&gt;
* 0-3 -- affine transform for 4x4 block. Next 7 bits code brightness adjustment, 14 bits after that code source block index.&lt;br /&gt;
* 4 -- skip block run. Next 5 bits are run length minus one.&lt;br /&gt;
* 5 -- motion block(s). Next bit tells if there's more than one motion block; then 4-bit index of motion offset value from the frame header follows; then (if signalled) an additional number of motion blocks (all with the same motion offset) minus one in eight-bit field.&lt;br /&gt;
* 6 -- raw block. After the first byte sixteen bytes with new block data follow.&lt;br /&gt;
* 7 -- extended opcode is in the next four bits.&lt;br /&gt;
&lt;br /&gt;
Extended opcodes:&lt;br /&gt;
* 0-7 -- affine transform for 8x8 block. Last bit in the first byte is unused, then there's 7-bit brightness, refinement block presence flag, 14-bit source block index flag, and finally 2-bit refined subblock index. In case when refined subblock is present, it is coded as normal block except opcode 7 is not allowed and skip/motion blocks modes apply to that one block only.&lt;br /&gt;
* 12 -- long skip run. Top bit tells whether it's a long run (8-bit value plus 33) or a very long run (16-bit value plus 289).&lt;br /&gt;
* 15 -- small raw block. After the first byte there's 16-bit absolute offset and 4 bytes of block data. This mode does not seem to be used.&lt;br /&gt;
&lt;br /&gt;
[[Category:Video Codecs]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Pixar_codecs&amp;diff=16082</id>
		<title>Pixar codecs</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Pixar_codecs&amp;diff=16082"/>
		<updated>2025-08-24T16:20:09Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill known information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Company: Pixar&lt;br /&gt;
* FOURCCS: pix0, pix1, pix2, pix3, pix4, pix5, pix6, pix7, pixA&lt;br /&gt;
&lt;br /&gt;
These codecs are employed to compress paletted data in [[QuickTime_container|MOV]].&lt;br /&gt;
&lt;br /&gt;
== Pixar codecs 0 and 4 ==&lt;br /&gt;
These codecs store uncompressed image split into 4x4 tiles.&lt;br /&gt;
&lt;br /&gt;
== Pixar codecs 1 and 2 ==&lt;br /&gt;
Not much is known, but they seem to be similar to codec 3.&lt;br /&gt;
&lt;br /&gt;
== Pixar codec 3 ==&lt;br /&gt;
&lt;br /&gt;
This codec employs vector quantisation, so instead of transmitting each frame tile, only the codebook (or its update) plus tile indices are transmitted.&lt;br /&gt;
&lt;br /&gt;
Frame format:&lt;br /&gt;
* 16-bit big-endian number of tiles in codebook (update)&lt;br /&gt;
* codebook update (the number of entries is specified above):&lt;br /&gt;
** 16-bit codebook entry ID&lt;br /&gt;
** 16 bytes of tile data&lt;br /&gt;
* compressed frame description&lt;br /&gt;
&lt;br /&gt;
Frame description consists of 16-bit opcodes specifying the operation:&lt;br /&gt;
* 0-159 - leave that number of tiles unchanged from the previous frame&lt;br /&gt;
* 160-319 - restore (opcode-159) tiles from the initial background frame (note: the frame is not coded in the file but rather provided by the game engine from elsewhere)&lt;br /&gt;
* 320-65535 - paint tile (opcode-320) from the codebook&lt;br /&gt;
&lt;br /&gt;
== Pixar codec 5 ==&lt;br /&gt;
&lt;br /&gt;
This is an extension of codec 3. Now frame data starts with 16-bit big-endian frame number and probably the total number of tiles. If that value is not zero or 0xFFFF, two additional 16-bit values should be read. The rest is the same as in codec 3.&lt;br /&gt;
&lt;br /&gt;
== Pixar codec 6 ==&lt;br /&gt;
Probably similar to codec 5.&lt;br /&gt;
&lt;br /&gt;
== Pixar codec 7 ==&lt;br /&gt;
Unknown, but it seems to employ Huffman compression.&lt;br /&gt;
&lt;br /&gt;
== Pixar codec A ==&lt;br /&gt;
Unknown, but it seems to be not tile-based on the first glance.&lt;br /&gt;
&lt;br /&gt;
== Games using these codecs ==&lt;br /&gt;
&lt;br /&gt;
[https://www.mobygames.com/game/119619/disneys-toy-story-activity-center/ Toy Story Activity Center]&lt;br /&gt;
&lt;br /&gt;
[[Category:Video Codecs]]&lt;br /&gt;
[[Category:Game Formats]]&lt;br /&gt;
[[Category:Incomplete Video Codecs]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Motion_Pixels&amp;diff=16081</id>
		<title>Motion Pixels</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Motion_Pixels&amp;diff=16081"/>
		<updated>2025-08-16T09:43:09Z</updated>

		<summary type="html">&lt;p&gt;Kostya: /* Common things and differences */ add forgotten pixel 0 mention&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* FOURCCs: MVI1, MVI2&lt;br /&gt;
* Company: [[Sirius Publishing]]&lt;br /&gt;
* Samples:&lt;br /&gt;
** MVI1: [http://samples.mplayerhq.hu/game-formats/mvi1-avi/ http://samples.mplayerhq.hu/game-formats/mvi1-avi/]&lt;br /&gt;
** MVI2: [http://samples.mplayerhq.hu/V-codecs/MVI2/ http://samples.mplayerhq.hu/V-codecs/MVI2/]&lt;br /&gt;
** Movie CD: [http://samples.mplayerhq.hu/drivers32/motionpixelsmoviecd/ http://samples.mplayerhq.hu/drivers32/motionpixelsmoviecd/]&lt;br /&gt;
** Movie CD Win32 Codecs: [http://samples.mplayerhq.hu/drivers32/motionpixels/ http://samples.mplayerhq.hu/drivers32/motionpixels/]&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Motion Pixels is a family of codecs that started with its custom [[MVI Container]] format (with MVI extension as well) and later developed into VfW codecs MVI1 and MVI2.&lt;br /&gt;
&lt;br /&gt;
Motion Pixels version 1 (MVI1) was used in a few video games while version 2 (MVI2) was used in a number of Movie CDs. All of these items were published by Sirius Publishing and the Motion Pixels codec is believed to still be owned by the company's CEO, Richard Gnant.&lt;br /&gt;
&lt;br /&gt;
MVI belongs to the &amp;quot;old-school&amp;quot; family of video codecs and relies on interframe differences and adaptive delta-coding for horizontal lines of the picture. Delta coefficients are additionally [[Huffman|Huffman-packed]]. For better compression at the cost of picture quality additional colorspace downsampling may be used. MVI2 adds smoother delta-coding and the ability to dynamically change downsampling for each frame.&lt;br /&gt;
&lt;br /&gt;
== MVI Codec ==&lt;br /&gt;
&lt;br /&gt;
=== Common things and differences ===&lt;br /&gt;
&lt;br /&gt;
Essentially there are four (or even five) flavours of the codec:&lt;br /&gt;
* DOS version in [[MVI Container]]. Format is set in the header flags. Frames are treated either as intra or inter (depending on the flag set).&lt;br /&gt;
* MVI1 codec. Format is set in the flags. The only known flags include flipped frames, single-field coding, and golden frame.&lt;br /&gt;
* MVI2.0 codec. Format is set in the flags. In addition to MVI1 flags it also supports low-resolution mode and frame cropping.&lt;br /&gt;
* MVI2.1 codec. This one is signalled by a certain flag, actual coding format is set in intra frame header. Compared to MVI2.0 it also enables smooth delta coding mode.&lt;br /&gt;
* MVI2.2 codec. This one is signalled by a different flag but the behaviour seems to be identical to MVI2.1&lt;br /&gt;
&lt;br /&gt;
All variations of MVI use the same coding principle: first special rectangular areas are marked on the frame that require special handling; they are processed and the rest of pixels are decoded using Huffman-compressed deltas. For better compression data in most cases is represented in YUV colourspace with some subsampling. See Appendix A for the code to convert between 15-bit RGB and YUV.&lt;br /&gt;
&lt;br /&gt;
Supported colourspace formats are:&lt;br /&gt;
* 0 - RGB&lt;br /&gt;
* 1 - YUV with one chroma pair per 2x1 block&lt;br /&gt;
* 2 - YUV with one chroma pair per 2x2 block&lt;br /&gt;
* 3 - YUV with one chroma pair per 4x2 block&lt;br /&gt;
* 4 - YUV with one chroma pair per 4x4 block&lt;br /&gt;
&lt;br /&gt;
Overall bitstream format looks like this:&lt;br /&gt;
* intra frame flag (not present in DOS version)&lt;br /&gt;
* coding parameters like colourspace, lowres mode and smooth delta coding (only in intra frames and only in MVI2.1/MVI2.2)&lt;br /&gt;
* skip map (not for intra frames)&lt;br /&gt;
* golden frame map (only when the feature is enabled)&lt;br /&gt;
* fill map&lt;br /&gt;
* low-resolution areas map (only when the feature is enabled)&lt;br /&gt;
* Huffman codes description for deltas&lt;br /&gt;
* top left pixel RGB value (in there are delta codes and top left pixel is marked for normal delta decoding)&lt;br /&gt;
* number of delta codes for vertical prediction and first field (if there are delta codes)&lt;br /&gt;
* number of delta codes for the second field (ditto)&lt;br /&gt;
* Huffman-coded deltas&lt;br /&gt;
&lt;br /&gt;
Bit reading is done MSB first using 32-bit little-endian words (e.g. &amp;lt;code&amp;gt;00 00 10 80&amp;lt;/code&amp;gt; is represented as &amp;lt;code&amp;gt;0x80100000&amp;lt;/code&amp;gt; and first read bit will be 1).&lt;br /&gt;
&lt;br /&gt;
=== Compression Flags ===&lt;br /&gt;
&lt;br /&gt;
When video is packaged inside [[AVI]] files, all vital codec's parameters carried in [[BITMAPINFOHEADER]]'s '''biCompression''' field of the video stream. Actual codec type should be retrieved from &amp;lt;code&amp;gt;fccHandler&amp;lt;/code&amp;gt; of AVI stream header. First two bytes of '''biCompression''' for 16-bit little-endian flags value, last two bytes should be &amp;quot;i1&amp;quot; for MVI1 and &amp;quot;i2&amp;quot; for MVI2 correspondingly.&lt;br /&gt;
&lt;br /&gt;
Flag bits meaning:&lt;br /&gt;
&lt;br /&gt;
* 0..3  (0x000F) - colourspace Format (see below)&lt;br /&gt;
* 4 (0x0010) - seems to be recognised but not used by the decoder (MVI2.2 only)&lt;br /&gt;
* 5 (0x0020) - alternative output mode (MVI2.2 only)&lt;br /&gt;
* 6 (0x0040) - seems to be intra-only mode where only intra frames are decoded and inter frames merely repeat them (MVI2.2 only)&lt;br /&gt;
* 7 (0x0080) - MVI2.2 mode&lt;br /&gt;
* 8 (0x0100) - still-frame (or golden frame) mode for MVI2.2&lt;br /&gt;
* 9 (0x0200) - MVI2.1 mode&lt;br /&gt;
* 10 (0x0400) - frame cropping enabled (MVI2 only)&lt;br /&gt;
* 11 (0x0800) - low-resolution mode (MVI2 only)&lt;br /&gt;
* 12 (0x1000) - still-frame (or golden frame) mode&lt;br /&gt;
* 13 (0x2000) - frames are coded upside-down (instead of bottoms-up by default)&lt;br /&gt;
* 14 (0x4000) - video was encoded using trial version of the codec (this flag tells original decoder to put watermark to the frame)&lt;br /&gt;
* 15 (0x8000) - image is single-field, only odd lines are carried&lt;br /&gt;
&lt;br /&gt;
=== Golden frame mode ===&lt;br /&gt;
&lt;br /&gt;
When videos with small amount of changes encoded (ex, 'talking heads' or some static scenery) special trick may be performed. Very first frame contains all the scenery, while all successive frames take this first frame as a base and add necessary changes to it. The tricky part is, that first frame contains such a 'change-frame' as well, so you have two logical frames in one physical. Offset to the base frame is located at ('''biSizeImage''' - 4) in the encoded data buffer. Change-frame located at it's start.&lt;br /&gt;
&lt;br /&gt;
Please note that both of the parts in the first frame still contain the golden frame map.&lt;br /&gt;
&lt;br /&gt;
=== Delta decoding modes ===&lt;br /&gt;
&lt;br /&gt;
Deltas are coded as values in the range -7..7. Since sometimes larger values are needed, there are two ways to deal with it. Motion Pixels before 2.1 used a rule that if delta value is -7 or 7 then next delta value should be doubled before use (and if its original value is -7 or 7 then the next delta value as well etc etc). Smooth delta mode operates differently: if delta value is -7 or 7 then add doubled next delta value to the result (and keep doing it while additional delta values are -7 or 7). &lt;br /&gt;
&lt;br /&gt;
=== Low-resolution mode ===&lt;br /&gt;
&lt;br /&gt;
In this mode half of the pixels are coded using interpolation i.e. when only luma changes are coded then first (interpolated pixel) uses half of that delta value added to the previous pixel and second pixel uses full delta. If exactly one pixel is left between low-res and skip areas, it is interpolated in the same way (luma delta is calculated and half of it is added to the predictor value). If exactly one pixel is left between low-res and and normal area, it uses half of the first delta from the first pixel of that area.&lt;br /&gt;
&lt;br /&gt;
Depending on coding mode and line number full and pixel position may be swapped (e.g. for even lines it may be &amp;quot;interpolated full interpolated full&amp;quot; while for odd lines it is &amp;quot;full interpolated full interpolated&amp;quot;). Additionally in smooth deltas mode luma deltas use limited range unless the very first pixel is full one.&lt;br /&gt;
&lt;br /&gt;
Please note that during vertical prediction stage low-resolution mode pixels are treated as skip pixels.&lt;br /&gt;
&lt;br /&gt;
=== Decompression ===&lt;br /&gt;
&lt;br /&gt;
==== Frame Flags ====&lt;br /&gt;
Each frame begins with sequence of local flag bits. These bits are:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; style=&amp;quot;border-collapse: collapse; border-style: dashed; border-color: #2f6fab;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#f0f0f0&amp;quot; |&lt;br /&gt;
! # of bits !! Present if !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1 || always || KeyframeFlag || non-zero if this frame is a key frame&lt;br /&gt;
|-&lt;br /&gt;
| 3 || flags bit 9 || ColorSpace || colorspace Format for this group of frames&lt;br /&gt;
|-&lt;br /&gt;
| 1 || flags bit 9 || LowRes || low-resolution coding is enabled&lt;br /&gt;
|-&lt;br /&gt;
| 1 || flags bit 9 || SmoothDeltas || use smooth delta-coding&lt;br /&gt;
|-&lt;br /&gt;
| 1 || flags bit 9 || HaveSerial || (see next field)&lt;br /&gt;
|-&lt;br /&gt;
| 20 || flags bit 9 + HaveSerial || SerialNumber || Encoder's serial number&lt;br /&gt;
|-&lt;br /&gt;
| 1 || flags bit 9 || Cropping || frame cropping is enabled&lt;br /&gt;
|-&lt;br /&gt;
| 8 || flags bit 10 or Cropping || CropX || x offset of the frame start&lt;br /&gt;
|-&lt;br /&gt;
| 8 || flags bit 10 or Cropping || CropY || y offset of the frame start&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Maps ====&lt;br /&gt;
Map blocks contain rectangles which should be marked as special on the frame. All versions prior to MVI2.1 use the same format:&lt;br /&gt;
* 12 bits   number of large rectangles&lt;br /&gt;
* 12 bits   number of small rectangles&lt;br /&gt;
* large rectangles&lt;br /&gt;
* small rectangles&lt;br /&gt;
&lt;br /&gt;
Rectangles are stored as &amp;lt;code&amp;gt;&amp;amp;lt;offset, width-1, height-1&amp;amp;gt;&amp;lt;/code&amp;gt; with offset taking &amp;lt;code&amp;gt;ceil(log2(frame width * frame height))&amp;lt;/code&amp;gt; bits and width and height using 8 or 4 bits depending on rectangle size. Rectangles for fill map additionally contain RGB555 fill value.&lt;br /&gt;
&lt;br /&gt;
MVI2.1/MVI2.2 use a different format, they split image into chunks of 8192 bytes and for each of them use 8-bit number of large/small rectangles as well as 13-bit offsets relative to the start of that piece.&lt;br /&gt;
&lt;br /&gt;
==== Deltas Bundle ====&lt;br /&gt;
&lt;br /&gt;
Deltas start with 4-bit code telling how many unique delta values are being coded. Zero means no deltas are present at all, one value means next four bit contain delta value plus seven and all deltas in the frame are the same. Otherwise there's 4-bit value telling the suggested number of bits to look up during Huffman decoding followed by symbol values (delta value plus seven) and bit-coded Huffman tree shape (0 - this is a leaf; 1 - node has children, read description for it).&lt;br /&gt;
&lt;br /&gt;
Then there are two numbers of deltas per field, using 18 or 19 bits (depending on whether image is larger than 320*240 or not) and the actual delta values (when there are two or more unique delta values).&lt;br /&gt;
&lt;br /&gt;
==== Assembling the Frame ====&lt;br /&gt;
* leave areas marked as &amp;quot;skip&amp;quot; (but not &amp;quot;lowres&amp;quot;) unchanged&lt;br /&gt;
* copy image data from the golden frame to the areas marked as such (there is no motion displacement)&lt;br /&gt;
* fill areas marked as &amp;quot;fill&amp;quot; with the provided colour&lt;br /&gt;
* perform vertical prediction for the first column (skip if there are no deltas)&lt;br /&gt;
* perform prediction for odd lines using the rest of deltas from the first part (skip if there are no deltas)&lt;br /&gt;
* perform prediction for even lines using deltas from the second part (skip if there are no deltas)&lt;br /&gt;
&lt;br /&gt;
Please note that while old DOS format used sequential line numbers so field 0 consisted of lines 0,2,4,... newer formats decode lines in permuted order. So for most formats field 0 is lines 1,3,5,... and for 4x4 mode lines for field 0 are decoded in this order: 3,1,7,5,11,9,...&lt;br /&gt;
&lt;br /&gt;
Delta prediction is simple: for the line (or column) skip not predicted pixels, taking last of them as a new predictor, convert it from RGB to YUV, add delta for Y and optionally U and V components, put pixel converted to RGB on frame. Pixels in the same block use the same chroma values. The rules for which pixel is supposed to have U and V deltas depend on pixel position, subsampling mode, low-res mode being employed or not, and codec version. &lt;br /&gt;
&lt;br /&gt;
== Games Using Motion Pixels ==&lt;br /&gt;
* [https://www.mobygames.com/game/windows/treasure-quest Treasure Quest]&lt;br /&gt;
* [https://www.mobygames.com/game/25426/apollo-18-the-moon-missions/ Apollo 18: The Moon Missions]&lt;br /&gt;
&lt;br /&gt;
== Appendix A ==&lt;br /&gt;
&lt;br /&gt;
Code for generating RGB to YUV table (it is done with YUV to RGB conversion, which is used during decoding as well):&lt;br /&gt;
&lt;br /&gt;
   for (y = 0; y &amp;lt;= 31; y++) {&lt;br /&gt;
        for (v = -31; v &amp;lt;= 31; v++) {&lt;br /&gt;
            for (u = -31; u &amp;lt;= 31; u++) {&lt;br /&gt;
                r = (y * 1000 + v * 701) / 1000;&lt;br /&gt;
                g = (y * 1000 - 357 * v - 172 * u) / 1000;&lt;br /&gt;
                b = (y * 1000 + 886 * u) / 1000;&lt;br /&gt;
                if (r &amp;gt;= 0 &amp;amp;&amp;amp; r &amp;lt; 32 &amp;amp;&amp;amp; g &amp;gt;= 0 &amp;amp;&amp;amp; g &amp;lt; 32 &amp;amp;&amp;amp; b &amp;gt;= 0 &amp;amp;&amp;amp; b &amp;lt; 32) {&lt;br /&gt;
                    pix = (r &amp;lt;&amp;lt; 10) | (g &amp;lt;&amp;lt; 5) | b;&lt;br /&gt;
                    if (!rgb2yuv[pix][0] &amp;amp;&amp;amp; !rgb2yuv[pix][1] &amp;amp;&amp;amp; !rgb2yuv[pix][2]) {&lt;br /&gt;
                        rgb2yuv[pix][0] = y;&lt;br /&gt;
                        rgb2yuv[pix][1] = u;&lt;br /&gt;
                        rgb2yuv[pix][2] = v;&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    for (i = 0; i &amp;lt; 32768; i+= 32) {&lt;br /&gt;
        for (j = 0; j &amp;lt; 31; j++) {&lt;br /&gt;
            for (k = 31; k &amp;gt; j; k--) {&lt;br /&gt;
                pix = i + k;&lt;br /&gt;
                if (!rgb2yuv[pix][0] &amp;amp;&amp;amp; !rgb2yuv[pix][1] &amp;amp;&amp;amp; !rgb2yuv[pix][2]) {&lt;br /&gt;
                    rgb2yuv[pix][0] = rgb2yuv[pix - 1][0];&lt;br /&gt;
                    rgb2yuv[pix][1] = rgb2yuv[pix - 1][1];&lt;br /&gt;
                    rgb2yuv[pix][2] = rgb2yuv[pix - 1][2];&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            for (k = 0; k &amp;lt; 31 - j; k++) {&lt;br /&gt;
                pix = i + k;&lt;br /&gt;
                if (!rgb2yuv[pix][0] &amp;amp;&amp;amp; !rgb2yuv[pix][1] &amp;amp;&amp;amp; !rgb2yuv[pix][2]) {&lt;br /&gt;
                    rgb2yuv[pix][0] = rgb2yuv[pix + 1][0];&lt;br /&gt;
                    rgb2yuv[pix][1] = rgb2yuv[pix + 1][1];&lt;br /&gt;
                    rgb2yuv[pix][2] = rgb2yuv[pix + 1][2];&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Video Codecs]]&lt;br /&gt;
[[Category:Game Formats]]&lt;br /&gt;
[[Category:Formats missing in MPlayer]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Motion_Pixels&amp;diff=16080</id>
		<title>Motion Pixels</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Motion_Pixels&amp;diff=16080"/>
		<updated>2025-08-15T13:12:10Z</updated>

		<summary type="html">&lt;p&gt;Kostya: clarify some flags and be done with it&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* FOURCCs: MVI1, MVI2&lt;br /&gt;
* Company: [[Sirius Publishing]]&lt;br /&gt;
* Samples:&lt;br /&gt;
** MVI1: [http://samples.mplayerhq.hu/game-formats/mvi1-avi/ http://samples.mplayerhq.hu/game-formats/mvi1-avi/]&lt;br /&gt;
** MVI2: [http://samples.mplayerhq.hu/V-codecs/MVI2/ http://samples.mplayerhq.hu/V-codecs/MVI2/]&lt;br /&gt;
** Movie CD: [http://samples.mplayerhq.hu/drivers32/motionpixelsmoviecd/ http://samples.mplayerhq.hu/drivers32/motionpixelsmoviecd/]&lt;br /&gt;
** Movie CD Win32 Codecs: [http://samples.mplayerhq.hu/drivers32/motionpixels/ http://samples.mplayerhq.hu/drivers32/motionpixels/]&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Motion Pixels is a family of codecs that started with its custom [[MVI Container]] format (with MVI extension as well) and later developed into VfW codecs MVI1 and MVI2.&lt;br /&gt;
&lt;br /&gt;
Motion Pixels version 1 (MVI1) was used in a few video games while version 2 (MVI2) was used in a number of Movie CDs. All of these items were published by Sirius Publishing and the Motion Pixels codec is believed to still be owned by the company's CEO, Richard Gnant.&lt;br /&gt;
&lt;br /&gt;
MVI belongs to the &amp;quot;old-school&amp;quot; family of video codecs and relies on interframe differences and adaptive delta-coding for horizontal lines of the picture. Delta coefficients are additionally [[Huffman|Huffman-packed]]. For better compression at the cost of picture quality additional colorspace downsampling may be used. MVI2 adds smoother delta-coding and the ability to dynamically change downsampling for each frame.&lt;br /&gt;
&lt;br /&gt;
== MVI Codec ==&lt;br /&gt;
&lt;br /&gt;
=== Common things and differences ===&lt;br /&gt;
&lt;br /&gt;
Essentially there are four (or even five) flavours of the codec:&lt;br /&gt;
* DOS version in [[MVI Container]]. Format is set in the header flags. Frames are treated either as intra or inter (depending on the flag set).&lt;br /&gt;
* MVI1 codec. Format is set in the flags. The only known flags include flipped frames, single-field coding, and golden frame.&lt;br /&gt;
* MVI2.0 codec. Format is set in the flags. In addition to MVI1 flags it also supports low-resolution mode and frame cropping.&lt;br /&gt;
* MVI2.1 codec. This one is signalled by a certain flag, actual coding format is set in intra frame header. Compared to MVI2.0 it also enables smooth delta coding mode.&lt;br /&gt;
* MVI2.2 codec. This one is signalled by a different flag but the behaviour seems to be identical to MVI2.1&lt;br /&gt;
&lt;br /&gt;
All variations of MVI use the same coding principle: first special rectangular areas are marked on the frame that require special handling; they are processed and the rest of pixels are decoded using Huffman-compressed deltas. For better compression data in most cases is represented in YUV colourspace with some subsampling. See Appendix A for the code to convert between 15-bit RGB and YUV.&lt;br /&gt;
&lt;br /&gt;
Supported colourspace formats are:&lt;br /&gt;
* 0 - RGB&lt;br /&gt;
* 1 - YUV with one chroma pair per 2x1 block&lt;br /&gt;
* 2 - YUV with one chroma pair per 2x2 block&lt;br /&gt;
* 3 - YUV with one chroma pair per 4x2 block&lt;br /&gt;
* 4 - YUV with one chroma pair per 4x4 block&lt;br /&gt;
&lt;br /&gt;
Overall bitstream format looks like this:&lt;br /&gt;
* intra frame flag (not present in DOS version)&lt;br /&gt;
* coding parameters like colourspace, lowres mode and smooth delta coding (only in intra frames and only in MVI2.1/MVI2.2)&lt;br /&gt;
* skip map (not for intra frames)&lt;br /&gt;
* golden frame map (only when the feature is enabled)&lt;br /&gt;
* fill map&lt;br /&gt;
* low-resolution areas map (only when the feature is enabled)&lt;br /&gt;
* Huffman codes description for deltas&lt;br /&gt;
* number of delta codes for vertical prediction and first field (if there are delta codes)&lt;br /&gt;
* number of delta codes for the second field (ditto)&lt;br /&gt;
* Huffman-coded deltas&lt;br /&gt;
&lt;br /&gt;
Bit reading is done MSB first using 32-bit little-endian words (e.g. &amp;lt;code&amp;gt;00 00 10 80&amp;lt;/code&amp;gt; is represented as &amp;lt;code&amp;gt;0x80100000&amp;lt;/code&amp;gt; and first read bit will be 1).&lt;br /&gt;
&lt;br /&gt;
=== Compression Flags ===&lt;br /&gt;
&lt;br /&gt;
When video is packaged inside [[AVI]] files, all vital codec's parameters carried in [[BITMAPINFOHEADER]]'s '''biCompression''' field of the video stream. Actual codec type should be retrieved from &amp;lt;code&amp;gt;fccHandler&amp;lt;/code&amp;gt; of AVI stream header. First two bytes of '''biCompression''' for 16-bit little-endian flags value, last two bytes should be &amp;quot;i1&amp;quot; for MVI1 and &amp;quot;i2&amp;quot; for MVI2 correspondingly.&lt;br /&gt;
&lt;br /&gt;
Flag bits meaning:&lt;br /&gt;
&lt;br /&gt;
* 0..3  (0x000F) - colourspace Format (see below)&lt;br /&gt;
* 4 (0x0010) - seems to be recognised but not used by the decoder (MVI2.2 only)&lt;br /&gt;
* 5 (0x0020) - alternative output mode (MVI2.2 only)&lt;br /&gt;
* 6 (0x0040) - seems to be intra-only mode where only intra frames are decoded and inter frames merely repeat them (MVI2.2 only)&lt;br /&gt;
* 7 (0x0080) - MVI2.2 mode&lt;br /&gt;
* 8 (0x0100) - still-frame (or golden frame) mode for MVI2.2&lt;br /&gt;
* 9 (0x0200) - MVI2.1 mode&lt;br /&gt;
* 10 (0x0400) - frame cropping enabled (MVI2 only)&lt;br /&gt;
* 11 (0x0800) - low-resolution mode (MVI2 only)&lt;br /&gt;
* 12 (0x1000) - still-frame (or golden frame) mode&lt;br /&gt;
* 13 (0x2000) - frames are coded upside-down (instead of bottoms-up by default)&lt;br /&gt;
* 14 (0x4000) - video was encoded using trial version of the codec (this flag tells original decoder to put watermark to the frame)&lt;br /&gt;
* 15 (0x8000) - image is single-field, only odd lines are carried&lt;br /&gt;
&lt;br /&gt;
=== Golden frame mode ===&lt;br /&gt;
&lt;br /&gt;
When videos with small amount of changes encoded (ex, 'talking heads' or some static scenery) special trick may be performed. Very first frame contains all the scenery, while all successive frames take this first frame as a base and add necessary changes to it. The tricky part is, that first frame contains such a 'change-frame' as well, so you have two logical frames in one physical. Offset to the base frame is located at ('''biSizeImage''' - 4) in the encoded data buffer. Change-frame located at it's start.&lt;br /&gt;
&lt;br /&gt;
Please note that both of the parts in the first frame still contain the golden frame map.&lt;br /&gt;
&lt;br /&gt;
=== Delta decoding modes ===&lt;br /&gt;
&lt;br /&gt;
Deltas are coded as values in the range -7..7. Since sometimes larger values are needed, there are two ways to deal with it. Motion Pixels before 2.1 used a rule that if delta value is -7 or 7 then next delta value should be doubled before use (and if its original value is -7 or 7 then the next delta value as well etc etc). Smooth delta mode operates differently: if delta value is -7 or 7 then add doubled next delta value to the result (and keep doing it while additional delta values are -7 or 7). &lt;br /&gt;
&lt;br /&gt;
=== Low-resolution mode ===&lt;br /&gt;
&lt;br /&gt;
In this mode half of the pixels are coded using interpolation i.e. when only luma changes are coded then first (interpolated pixel) uses half of that delta value added to the previous pixel and second pixel uses full delta. If exactly one pixel is left between low-res and skip areas, it is interpolated in the same way (luma delta is calculated and half of it is added to the predictor value). If exactly one pixel is left between low-res and and normal area, it uses half of the first delta from the first pixel of that area.&lt;br /&gt;
&lt;br /&gt;
Depending on coding mode and line number full and pixel position may be swapped (e.g. for even lines it may be &amp;quot;interpolated full interpolated full&amp;quot; while for odd lines it is &amp;quot;full interpolated full interpolated&amp;quot;). Additionally in smooth deltas mode luma deltas use limited range unless the very first pixel is full one.&lt;br /&gt;
&lt;br /&gt;
Please note that during vertical prediction stage low-resolution mode pixels are treated as skip pixels.&lt;br /&gt;
&lt;br /&gt;
=== Decompression ===&lt;br /&gt;
&lt;br /&gt;
==== Frame Flags ====&lt;br /&gt;
Each frame begins with sequence of local flag bits. These bits are:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; style=&amp;quot;border-collapse: collapse; border-style: dashed; border-color: #2f6fab;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#f0f0f0&amp;quot; |&lt;br /&gt;
! # of bits !! Present if !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1 || always || KeyframeFlag || non-zero if this frame is a key frame&lt;br /&gt;
|-&lt;br /&gt;
| 3 || flags bit 9 || ColorSpace || colorspace Format for this group of frames&lt;br /&gt;
|-&lt;br /&gt;
| 1 || flags bit 9 || LowRes || low-resolution coding is enabled&lt;br /&gt;
|-&lt;br /&gt;
| 1 || flags bit 9 || SmoothDeltas || use smooth delta-coding&lt;br /&gt;
|-&lt;br /&gt;
| 1 || flags bit 9 || HaveSerial || (see next field)&lt;br /&gt;
|-&lt;br /&gt;
| 20 || flags bit 9 + HaveSerial || SerialNumber || Encoder's serial number&lt;br /&gt;
|-&lt;br /&gt;
| 1 || flags bit 9 || Cropping || frame cropping is enabled&lt;br /&gt;
|-&lt;br /&gt;
| 8 || flags bit 10 or Cropping || CropX || x offset of the frame start&lt;br /&gt;
|-&lt;br /&gt;
| 8 || flags bit 10 or Cropping || CropY || y offset of the frame start&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Maps ====&lt;br /&gt;
Map blocks contain rectangles which should be marked as special on the frame. All versions prior to MVI2.1 use the same format:&lt;br /&gt;
* 12 bits   number of large rectangles&lt;br /&gt;
* 12 bits   number of small rectangles&lt;br /&gt;
* large rectangles&lt;br /&gt;
* small rectangles&lt;br /&gt;
&lt;br /&gt;
Rectangles are stored as &amp;lt;code&amp;gt;&amp;amp;lt;offset, width-1, height-1&amp;amp;gt;&amp;lt;/code&amp;gt; with offset taking &amp;lt;code&amp;gt;ceil(log2(frame width * frame height))&amp;lt;/code&amp;gt; bits and width and height using 8 or 4 bits depending on rectangle size. Rectangles for fill map additionally contain RGB555 fill value.&lt;br /&gt;
&lt;br /&gt;
MVI2.1/MVI2.2 use a different format, they split image into chunks of 8192 bytes and for each of them use 8-bit number of large/small rectangles as well as 13-bit offsets relative to the start of that piece.&lt;br /&gt;
&lt;br /&gt;
==== Deltas Bundle ====&lt;br /&gt;
&lt;br /&gt;
Deltas start with 4-bit code telling how many unique delta values are being coded. Zero means no deltas are present at all, one value means next four bit contain delta value plus seven and all deltas in the frame are the same. Otherwise there's 4-bit value telling the suggested number of bits to look up during Huffman decoding followed by symbol values (delta value plus seven) and bit-coded Huffman tree shape (0 - this is a leaf; 1 - node has children, read description for it).&lt;br /&gt;
&lt;br /&gt;
Then there are two numbers of deltas per field, using 18 or 19 bits (depending on whether image is larger than 320*240 or not) and the actual delta values (when there are two or more unique delta values).&lt;br /&gt;
&lt;br /&gt;
==== Assembling the Frame ====&lt;br /&gt;
* leave areas marked as &amp;quot;skip&amp;quot; (but not &amp;quot;lowres&amp;quot;) unchanged&lt;br /&gt;
* copy image data from the golden frame to the areas marked as such (there is no motion displacement)&lt;br /&gt;
* fill areas marked as &amp;quot;fill&amp;quot; with the provided colour&lt;br /&gt;
* perform vertical prediction for the first column (skip if there are no deltas)&lt;br /&gt;
* perform prediction for odd lines using the rest of deltas from the first part (skip if there are no deltas)&lt;br /&gt;
* perform prediction for even lines using deltas from the second part (skip if there are no deltas)&lt;br /&gt;
&lt;br /&gt;
Please note that while old DOS format used sequential line numbers so field 0 consisted of lines 0,2,4,... newer formats decode lines in permuted order. So for most formats field 0 is lines 1,3,5,... and for 4x4 mode lines for field 0 are decoded in this order: 3,1,7,5,11,9,...&lt;br /&gt;
&lt;br /&gt;
Delta prediction is simple: for the line (or column) skip not predicted pixels, taking last of them as a new predictor, convert it from RGB to YUV, add delta for Y and optionally U and V components, put pixel converted to RGB on frame. Pixels in the same block use the same chroma values. The rules for which pixel is supposed to have U and V deltas depend on pixel position, subsampling mode, low-res mode being employed or not, and codec version. &lt;br /&gt;
&lt;br /&gt;
== Games Using Motion Pixels ==&lt;br /&gt;
* [https://www.mobygames.com/game/windows/treasure-quest Treasure Quest]&lt;br /&gt;
* [https://www.mobygames.com/game/25426/apollo-18-the-moon-missions/ Apollo 18: The Moon Missions]&lt;br /&gt;
&lt;br /&gt;
== Appendix A ==&lt;br /&gt;
&lt;br /&gt;
Code for generating RGB to YUV table (it is done with YUV to RGB conversion, which is used during decoding as well):&lt;br /&gt;
&lt;br /&gt;
   for (y = 0; y &amp;lt;= 31; y++) {&lt;br /&gt;
        for (v = -31; v &amp;lt;= 31; v++) {&lt;br /&gt;
            for (u = -31; u &amp;lt;= 31; u++) {&lt;br /&gt;
                r = (y * 1000 + v * 701) / 1000;&lt;br /&gt;
                g = (y * 1000 - 357 * v - 172 * u) / 1000;&lt;br /&gt;
                b = (y * 1000 + 886 * u) / 1000;&lt;br /&gt;
                if (r &amp;gt;= 0 &amp;amp;&amp;amp; r &amp;lt; 32 &amp;amp;&amp;amp; g &amp;gt;= 0 &amp;amp;&amp;amp; g &amp;lt; 32 &amp;amp;&amp;amp; b &amp;gt;= 0 &amp;amp;&amp;amp; b &amp;lt; 32) {&lt;br /&gt;
                    pix = (r &amp;lt;&amp;lt; 10) | (g &amp;lt;&amp;lt; 5) | b;&lt;br /&gt;
                    if (!rgb2yuv[pix][0] &amp;amp;&amp;amp; !rgb2yuv[pix][1] &amp;amp;&amp;amp; !rgb2yuv[pix][2]) {&lt;br /&gt;
                        rgb2yuv[pix][0] = y;&lt;br /&gt;
                        rgb2yuv[pix][1] = u;&lt;br /&gt;
                        rgb2yuv[pix][2] = v;&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    for (i = 0; i &amp;lt; 32768; i+= 32) {&lt;br /&gt;
        for (j = 0; j &amp;lt; 31; j++) {&lt;br /&gt;
            for (k = 31; k &amp;gt; j; k--) {&lt;br /&gt;
                pix = i + k;&lt;br /&gt;
                if (!rgb2yuv[pix][0] &amp;amp;&amp;amp; !rgb2yuv[pix][1] &amp;amp;&amp;amp; !rgb2yuv[pix][2]) {&lt;br /&gt;
                    rgb2yuv[pix][0] = rgb2yuv[pix - 1][0];&lt;br /&gt;
                    rgb2yuv[pix][1] = rgb2yuv[pix - 1][1];&lt;br /&gt;
                    rgb2yuv[pix][2] = rgb2yuv[pix - 1][2];&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            for (k = 0; k &amp;lt; 31 - j; k++) {&lt;br /&gt;
                pix = i + k;&lt;br /&gt;
                if (!rgb2yuv[pix][0] &amp;amp;&amp;amp; !rgb2yuv[pix][1] &amp;amp;&amp;amp; !rgb2yuv[pix][2]) {&lt;br /&gt;
                    rgb2yuv[pix][0] = rgb2yuv[pix + 1][0];&lt;br /&gt;
                    rgb2yuv[pix][1] = rgb2yuv[pix + 1][1];&lt;br /&gt;
                    rgb2yuv[pix][2] = rgb2yuv[pix + 1][2];&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Video Codecs]]&lt;br /&gt;
[[Category:Game Formats]]&lt;br /&gt;
[[Category:Formats missing in MPlayer]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Motion_Pixels&amp;diff=16079</id>
		<title>Motion Pixels</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Motion_Pixels&amp;diff=16079"/>
		<updated>2025-08-15T12:53:25Z</updated>

		<summary type="html">&lt;p&gt;Kostya: more about deltas&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* FOURCCs: MVI1, MVI2&lt;br /&gt;
* Company: [[Sirius Publishing]]&lt;br /&gt;
* Samples:&lt;br /&gt;
** MVI1: [http://samples.mplayerhq.hu/game-formats/mvi1-avi/ http://samples.mplayerhq.hu/game-formats/mvi1-avi/]&lt;br /&gt;
** MVI2: [http://samples.mplayerhq.hu/V-codecs/MVI2/ http://samples.mplayerhq.hu/V-codecs/MVI2/]&lt;br /&gt;
** Movie CD: [http://samples.mplayerhq.hu/drivers32/motionpixelsmoviecd/ http://samples.mplayerhq.hu/drivers32/motionpixelsmoviecd/]&lt;br /&gt;
** Movie CD Win32 Codecs: [http://samples.mplayerhq.hu/drivers32/motionpixels/ http://samples.mplayerhq.hu/drivers32/motionpixels/]&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Motion Pixels is a family of codecs that started with its custom [[MVI Container]] format (with MVI extension as well) and later developed into VfW codecs MVI1 and MVI2.&lt;br /&gt;
&lt;br /&gt;
Motion Pixels version 1 (MVI1) was used in a few video games while version 2 (MVI2) was used in a number of Movie CDs. All of these items were published by Sirius Publishing and the Motion Pixels codec is believed to still be owned by the company's CEO, Richard Gnant.&lt;br /&gt;
&lt;br /&gt;
MVI belongs to the &amp;quot;old-school&amp;quot; family of video codecs and relies on interframe differences and adaptive delta-coding for horizontal lines of the picture. Delta coefficients are additionally [[Huffman|Huffman-packed]]. For better compression at the cost of picture quality additional colorspace downsampling may be used. MVI2 adds smoother delta-coding and the ability to dynamically change downsampling for each frame.&lt;br /&gt;
&lt;br /&gt;
== MVI Codec ==&lt;br /&gt;
&lt;br /&gt;
=== Common things and differences ===&lt;br /&gt;
&lt;br /&gt;
Essentially there are four (or even five) flavours of the codec:&lt;br /&gt;
* DOS version in [[MVI Container]]. Format is set in the header flags. Frames are treated either as intra or inter (depending on the flag set).&lt;br /&gt;
* MVI1 codec. Format is set in the flags. The only known flags include flipped frames, single-field coding, and golden frame.&lt;br /&gt;
* MVI2.0 codec. Format is set in the flags. In addition to MVI1 flags it also supports low-resolution mode and frame cropping.&lt;br /&gt;
* MVI2.1 codec. This one is signalled by a certain flag, actual coding format is set in intra frame header. Compared to MVI2.0 it also enables smooth delta coding mode.&lt;br /&gt;
* MVI2.2 codec. This one is signalled by a different flag but the behaviour seems to be identical to MVI2.1&lt;br /&gt;
&lt;br /&gt;
All variations of MVI use the same coding principle: first special rectangular areas are marked on the frame that require special handling; they are processed and the rest of pixels are decoded using Huffman-compressed deltas. For better compression data in most cases is represented in YUV colourspace with some subsampling. See Appendix A for the code to convert between 15-bit RGB and YUV.&lt;br /&gt;
&lt;br /&gt;
Supported colourspace formats are:&lt;br /&gt;
* 0 - RGB&lt;br /&gt;
* 1 - YUV with one chroma pair per 2x1 block&lt;br /&gt;
* 2 - YUV with one chroma pair per 2x2 block&lt;br /&gt;
* 3 - YUV with one chroma pair per 4x2 block&lt;br /&gt;
* 4 - YUV with one chroma pair per 4x4 block&lt;br /&gt;
&lt;br /&gt;
Overall bitstream format looks like this:&lt;br /&gt;
* intra frame flag (not present in DOS version)&lt;br /&gt;
* coding parameters like colourspace, lowres mode and smooth delta coding (only in intra frames and only in MVI2.1/MVI2.2)&lt;br /&gt;
* skip map (not for intra frames)&lt;br /&gt;
* golden frame map (only when the feature is enabled)&lt;br /&gt;
* fill map&lt;br /&gt;
* low-resolution areas map (only when the feature is enabled)&lt;br /&gt;
* Huffman codes description for deltas&lt;br /&gt;
* number of delta codes for vertical prediction and first field (if there are delta codes)&lt;br /&gt;
* number of delta codes for the second field (ditto)&lt;br /&gt;
* Huffman-coded deltas&lt;br /&gt;
&lt;br /&gt;
Bit reading is done MSB first using 32-bit little-endian words (e.g. &amp;lt;code&amp;gt;00 00 10 80&amp;lt;/code&amp;gt; is represented as &amp;lt;code&amp;gt;0x80100000&amp;lt;/code&amp;gt; and first read bit will be 1).&lt;br /&gt;
&lt;br /&gt;
=== Compression Flags ===&lt;br /&gt;
&lt;br /&gt;
When video is packaged inside [[AVI]] files, all vital codec's parameters carried in [[BITMAPINFOHEADER]]'s '''biCompression''' field of the video stream. Actual codec type should be retrieved from &amp;lt;code&amp;gt;fccHandler&amp;lt;/code&amp;gt; of AVI stream header. First two bytes of '''biCompression''' for 16-bit little-endian flags value, last two bytes should be &amp;quot;i1&amp;quot; for MVI1 and &amp;quot;i2&amp;quot; for MVI2 correspondingly.&lt;br /&gt;
&lt;br /&gt;
Flag bits meaning:&lt;br /&gt;
&lt;br /&gt;
* 0..3  (0x000F) - colourspace Format (see below)&lt;br /&gt;
* 4 (0x0010) - MVI2.2 only&lt;br /&gt;
* 5 (0x0020) - MVI2.2 only&lt;br /&gt;
* 6 (0x0040) - MVI2.2 only&lt;br /&gt;
* 7 (0x0080) - MVI2.2 only&lt;br /&gt;
* 8 (0x0100) - MVI2.2 only&lt;br /&gt;
* 9 (0x0200) - MVI2.1 mode&lt;br /&gt;
* 10 (0x0400) - frame cropping enabled (MVI2 only)&lt;br /&gt;
* 11 (0x0800) - low-resolution mode (MVI2 only)&lt;br /&gt;
* 12 (0x1000) - still-frame (or golden frame) mode&lt;br /&gt;
* 13 (0x2000) - frames are coded upside-down (instead of bottoms-up by default)&lt;br /&gt;
* 14 (0x4000) - video was encoded using trial version of the codec (this flag tells original decoder to put watermark to the frame)&lt;br /&gt;
* 15 (0x8000) - image is single-field, only odd lines are carried&lt;br /&gt;
&lt;br /&gt;
=== Golden frame mode ===&lt;br /&gt;
&lt;br /&gt;
When videos with small amount of changes encoded (ex, 'talking heads' or some static scenery) special trick may be performed. Very first frame contains all the scenery, while all successive frames take this first frame as a base and add necessary changes to it. The tricky part is, that first frame contains such a 'change-frame' as well, so you have two logical frames in one physical. Offset to the base frame is located at ('''biSizeImage''' - 4) in the encoded data buffer. Change-frame located at it's start.&lt;br /&gt;
&lt;br /&gt;
Please note that both of the parts in the first frame still contain the golden frame map.&lt;br /&gt;
&lt;br /&gt;
=== Delta decoding modes ===&lt;br /&gt;
&lt;br /&gt;
Deltas are coded as values in the range -7..7. Since sometimes larger values are needed, there are two ways to deal with it. Motion Pixels before 2.1 used a rule that if delta value is -7 or 7 then next delta value should be doubled before use (and if its original value is -7 or 7 then the next delta value as well etc etc). Smooth delta mode operates differently: if delta value is -7 or 7 then add doubled next delta value to the result (and keep doing it while additional delta values are -7 or 7). &lt;br /&gt;
&lt;br /&gt;
=== Low-resolution mode ===&lt;br /&gt;
&lt;br /&gt;
In this mode half of the pixels are coded using interpolation i.e. when only luma changes are coded then first (interpolated pixel) uses half of that delta value added to the previous pixel and second pixel uses full delta. If exactly one pixel is left between low-res and skip areas, it is interpolated in the same way (luma delta is calculated and half of it is added to the predictor value). If exactly one pixel is left between low-res and and normal area, it uses half of the first delta from the first pixel of that area.&lt;br /&gt;
&lt;br /&gt;
Depending on coding mode and line number full and pixel position may be swapped (e.g. for even lines it may be &amp;quot;interpolated full interpolated full&amp;quot; while for odd lines it is &amp;quot;full interpolated full interpolated&amp;quot;). Additionally in smooth deltas mode luma deltas use limited range unless the very first pixel is full one.&lt;br /&gt;
&lt;br /&gt;
Please note that during vertical prediction stage low-resolution mode pixels are treated as skip pixels.&lt;br /&gt;
&lt;br /&gt;
=== Decompression ===&lt;br /&gt;
&lt;br /&gt;
==== Frame Flags ====&lt;br /&gt;
Each frame begins with sequence of local flag bits. These bits are:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; style=&amp;quot;border-collapse: collapse; border-style: dashed; border-color: #2f6fab;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#f0f0f0&amp;quot; |&lt;br /&gt;
! # of bits !! Present if !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1 || always || KeyframeFlag || non-zero if this frame is a key frame&lt;br /&gt;
|-&lt;br /&gt;
| 3 || flags bit 9 || ColorSpace || colorspace Format for this group of frames&lt;br /&gt;
|-&lt;br /&gt;
| 1 || flags bit 9 || LowRes || low-resolution coding is enabled&lt;br /&gt;
|-&lt;br /&gt;
| 1 || flags bit 9 || SmoothDeltas || use smooth delta-coding&lt;br /&gt;
|-&lt;br /&gt;
| 1 || flags bit 9 || HaveSerial || (see next field)&lt;br /&gt;
|-&lt;br /&gt;
| 20 || flags bit 9 + HaveSerial || SerialNumber || Encoder's serial number&lt;br /&gt;
|-&lt;br /&gt;
| 1 || flags bit 9 || Cropping || frame cropping is enabled&lt;br /&gt;
|-&lt;br /&gt;
| 8 || flags bit 10 or Cropping || CropX || x offset of the frame start&lt;br /&gt;
|-&lt;br /&gt;
| 8 || flags bit 10 or Cropping || CropY || y offset of the frame start&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Maps ====&lt;br /&gt;
Map blocks contain rectangles which should be marked as special on the frame. All versions prior to MVI2.1 use the same format:&lt;br /&gt;
* 12 bits   number of large rectangles&lt;br /&gt;
* 12 bits   number of small rectangles&lt;br /&gt;
* large rectangles&lt;br /&gt;
* small rectangles&lt;br /&gt;
&lt;br /&gt;
Rectangles are stored as &amp;lt;code&amp;gt;&amp;amp;lt;offset, width-1, height-1&amp;amp;gt;&amp;lt;/code&amp;gt; with offset taking &amp;lt;code&amp;gt;ceil(log2(frame width * frame height))&amp;lt;/code&amp;gt; bits and width and height using 8 or 4 bits depending on rectangle size. Rectangles for fill map additionally contain RGB555 fill value.&lt;br /&gt;
&lt;br /&gt;
MVI2.1/MVI2.2 use a different format, they split image into chunks of 8192 bytes and for each of them use 8-bit number of large/small rectangles as well as 13-bit offsets relative to the start of that piece.&lt;br /&gt;
&lt;br /&gt;
==== Deltas Bundle ====&lt;br /&gt;
&lt;br /&gt;
Deltas start with 4-bit code telling how many unique delta values are being coded. Zero means no deltas are present at all, one value means next four bit contain delta value plus seven and all deltas in the frame are the same. Otherwise there's 4-bit value telling the suggested number of bits to look up during Huffman decoding followed by symbol values (delta value plus seven) and bit-coded Huffman tree shape (0 - this is a leaf; 1 - node has children, read description for it).&lt;br /&gt;
&lt;br /&gt;
Then there are two numbers of deltas per field, using 18 or 19 bits (depending on whether image is larger than 320*240 or not) and the actual delta values (when there are two or more unique delta values).&lt;br /&gt;
&lt;br /&gt;
==== Assembling the Frame ====&lt;br /&gt;
* leave areas marked as &amp;quot;skip&amp;quot; (but not &amp;quot;lowres&amp;quot;) unchanged&lt;br /&gt;
* copy image data from the golden frame to the areas marked as such (there is no motion displacement)&lt;br /&gt;
* fill areas marked as &amp;quot;fill&amp;quot; with the provided colour&lt;br /&gt;
* perform vertical prediction for the first column (skip if there are no deltas)&lt;br /&gt;
* perform prediction for odd lines using the rest of deltas from the first part (skip if there are no deltas)&lt;br /&gt;
* perform prediction for even lines using deltas from the second part (skip if there are no deltas)&lt;br /&gt;
&lt;br /&gt;
Please note that while old DOS format used sequential line numbers so field 0 consisted of lines 0,2,4,... newer formats decode lines in permuted order. So for most formats field 0 is lines 1,3,5,... and for 4x4 mode lines for field 0 are decoded in this order: 3,1,7,5,11,9,...&lt;br /&gt;
&lt;br /&gt;
Delta prediction is simple: for the line (or column) skip not predicted pixels, taking last of them as a new predictor, convert it from RGB to YUV, add delta for Y and optionally U and V components, put pixel converted to RGB on frame. Pixels in the same block use the same chroma values. The rules for which pixel is supposed to have U and V deltas depend on pixel position, subsampling mode, low-res mode being employed or not, and codec version. &lt;br /&gt;
&lt;br /&gt;
== Games Using Motion Pixels ==&lt;br /&gt;
* [https://www.mobygames.com/game/windows/treasure-quest Treasure Quest]&lt;br /&gt;
* [https://www.mobygames.com/game/25426/apollo-18-the-moon-missions/ Apollo 18: The Moon Missions]&lt;br /&gt;
&lt;br /&gt;
== Appendix A ==&lt;br /&gt;
&lt;br /&gt;
Code for generating RGB to YUV table (it is done with YUV to RGB conversion, which is used during decoding as well):&lt;br /&gt;
&lt;br /&gt;
   for (y = 0; y &amp;lt;= 31; y++) {&lt;br /&gt;
        for (v = -31; v &amp;lt;= 31; v++) {&lt;br /&gt;
            for (u = -31; u &amp;lt;= 31; u++) {&lt;br /&gt;
                r = (y * 1000 + v * 701) / 1000;&lt;br /&gt;
                g = (y * 1000 - 357 * v - 172 * u) / 1000;&lt;br /&gt;
                b = (y * 1000 + 886 * u) / 1000;&lt;br /&gt;
                if (r &amp;gt;= 0 &amp;amp;&amp;amp; r &amp;lt; 32 &amp;amp;&amp;amp; g &amp;gt;= 0 &amp;amp;&amp;amp; g &amp;lt; 32 &amp;amp;&amp;amp; b &amp;gt;= 0 &amp;amp;&amp;amp; b &amp;lt; 32) {&lt;br /&gt;
                    pix = (r &amp;lt;&amp;lt; 10) | (g &amp;lt;&amp;lt; 5) | b;&lt;br /&gt;
                    if (!rgb2yuv[pix][0] &amp;amp;&amp;amp; !rgb2yuv[pix][1] &amp;amp;&amp;amp; !rgb2yuv[pix][2]) {&lt;br /&gt;
                        rgb2yuv[pix][0] = y;&lt;br /&gt;
                        rgb2yuv[pix][1] = u;&lt;br /&gt;
                        rgb2yuv[pix][2] = v;&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    for (i = 0; i &amp;lt; 32768; i+= 32) {&lt;br /&gt;
        for (j = 0; j &amp;lt; 31; j++) {&lt;br /&gt;
            for (k = 31; k &amp;gt; j; k--) {&lt;br /&gt;
                pix = i + k;&lt;br /&gt;
                if (!rgb2yuv[pix][0] &amp;amp;&amp;amp; !rgb2yuv[pix][1] &amp;amp;&amp;amp; !rgb2yuv[pix][2]) {&lt;br /&gt;
                    rgb2yuv[pix][0] = rgb2yuv[pix - 1][0];&lt;br /&gt;
                    rgb2yuv[pix][1] = rgb2yuv[pix - 1][1];&lt;br /&gt;
                    rgb2yuv[pix][2] = rgb2yuv[pix - 1][2];&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            for (k = 0; k &amp;lt; 31 - j; k++) {&lt;br /&gt;
                pix = i + k;&lt;br /&gt;
                if (!rgb2yuv[pix][0] &amp;amp;&amp;amp; !rgb2yuv[pix][1] &amp;amp;&amp;amp; !rgb2yuv[pix][2]) {&lt;br /&gt;
                    rgb2yuv[pix][0] = rgb2yuv[pix + 1][0];&lt;br /&gt;
                    rgb2yuv[pix][1] = rgb2yuv[pix + 1][1];&lt;br /&gt;
                    rgb2yuv[pix][2] = rgb2yuv[pix + 1][2];&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Video Codecs]]&lt;br /&gt;
[[Category:Undiscovered Video Codecs]]&lt;br /&gt;
[[Category:Undiscovered Game Formats]]&lt;br /&gt;
[[Category:Game Formats]]&lt;br /&gt;
[[Category:Formats missing in MPlayer]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Motion_Pixels&amp;diff=16078</id>
		<title>Motion Pixels</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Motion_Pixels&amp;diff=16078"/>
		<updated>2025-08-15T10:47:40Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill some information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* FOURCCs: MVI1, MVI2&lt;br /&gt;
* Company: [[Sirius Publishing]]&lt;br /&gt;
* Samples:&lt;br /&gt;
** MVI1: [http://samples.mplayerhq.hu/game-formats/mvi1-avi/ http://samples.mplayerhq.hu/game-formats/mvi1-avi/]&lt;br /&gt;
** MVI2: [http://samples.mplayerhq.hu/V-codecs/MVI2/ http://samples.mplayerhq.hu/V-codecs/MVI2/]&lt;br /&gt;
** Movie CD: [http://samples.mplayerhq.hu/drivers32/motionpixelsmoviecd/ http://samples.mplayerhq.hu/drivers32/motionpixelsmoviecd/]&lt;br /&gt;
** Movie CD Win32 Codecs: [http://samples.mplayerhq.hu/drivers32/motionpixels/ http://samples.mplayerhq.hu/drivers32/motionpixels/]&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Motion Pixels is a family of codecs that started with its custom [[MVI Container]] format (with MVI extension as well) and later developed into VfW codecs MVI1 and MVI2.&lt;br /&gt;
&lt;br /&gt;
Motion Pixels version 1 (MVI1) was used in a few video games while version 2 (MVI2) was used in a number of Movie CDs. All of these items were published by Sirius Publishing and the Motion Pixels codec is believed to still be owned by the company's CEO, Richard Gnant.&lt;br /&gt;
&lt;br /&gt;
MVI belongs to the &amp;quot;old-school&amp;quot; family of video codecs and relies on interframe differences and adaptive delta-coding for horizontal lines of the picture. Delta coefficients are additionally [[Huffman|Huffman-packed]]. For better compression at the cost of picture quality additional colorspace downsampling may be used. MVI2 adds smoother delta-coding and the ability to dynamically change downsampling for each frame.&lt;br /&gt;
&lt;br /&gt;
== MVI Codec ==&lt;br /&gt;
&lt;br /&gt;
=== Common things and differences ===&lt;br /&gt;
&lt;br /&gt;
Essentially there are four (or even five) flavours of the codec:&lt;br /&gt;
* DOS version in [[MVI Container]]. Format is set in the header flags. Frames are treated either as intra or inter (depending on the flag set).&lt;br /&gt;
* MVI1 codec. Format is set in the flags. The only known flags include flipped frames, single-field coding, and golden frame.&lt;br /&gt;
* MVI2.0 codec. Format is set in the flags. In addition to MVI1 flags it also supports low-resolution mode and frame cropping.&lt;br /&gt;
* MVI2.1 codec. This one is signalled by a certain flag, actual coding format is set in intra frame header. Compared to MVI2.0 it also enables smooth delta coding mode.&lt;br /&gt;
* MVI2.2 codec. This one is signalled by a different flag but the behaviour seems to be identical to MVI2.1&lt;br /&gt;
&lt;br /&gt;
All variations of MVI use the same coding principle: first special rectangular areas are marked on the frame that require special handling; they are processed and the rest of pixels are decoded using Huffman-compressed deltas. For better compression data in most cases is represented in YUV colourspace with some subsampling. See Appendix A for the code to convert between 15-bit RGB and YUV.&lt;br /&gt;
&lt;br /&gt;
Supported colourspace formats are:&lt;br /&gt;
* 0 - RGB&lt;br /&gt;
* 1 - YUV with one chroma pair per 2x1 block&lt;br /&gt;
* 2 - YUV with one chroma pair per 2x2 block&lt;br /&gt;
* 3 - YUV with one chroma pair per 4x2 block&lt;br /&gt;
* 4 - YUV with one chroma pair per 4x4 block&lt;br /&gt;
&lt;br /&gt;
Overall bitstream format looks like this:&lt;br /&gt;
* intra frame flag (not present in DOS version)&lt;br /&gt;
* coding parameters like colourspace, lowres mode and smooth delta coding (only in intra frames and only in MVI2.1/MVI2.2)&lt;br /&gt;
* skip map (not for intra frames)&lt;br /&gt;
* golden frame map (only when the feature is enabled)&lt;br /&gt;
* fill map&lt;br /&gt;
* low-resolution areas map (only when the feature is enabled)&lt;br /&gt;
* Huffman codes description for deltas&lt;br /&gt;
* number of delta codes for vertical prediction and first field (if there are delta codes)&lt;br /&gt;
* number of delta codes for the second field (ditto)&lt;br /&gt;
* Huffman-coded deltas&lt;br /&gt;
&lt;br /&gt;
Bit reading is done MSB first using 32-bit little-endian words (e.g. &amp;lt;code&amp;gt;00 00 10 80&amp;lt;/code&amp;gt; is represented as &amp;lt;code&amp;gt;0x80100000&amp;lt;/code&amp;gt; and first read bit will be 1).&lt;br /&gt;
&lt;br /&gt;
=== Compression Flags ===&lt;br /&gt;
&lt;br /&gt;
When video is packaged inside [[AVI]] files, all vital codec's parameters carried in [[BITMAPINFOHEADER]]'s '''biCompression''' field of the video stream. Actual codec type should be retrieved from &amp;lt;code&amp;gt;fccHandler&amp;lt;/code&amp;gt; of AVI stream header. First two bytes of '''biCompression''' for 16-bit little-endian flags value, last two bytes should be &amp;quot;i1&amp;quot; for MVI1 and &amp;quot;i2&amp;quot; for MVI2 correspondingly.&lt;br /&gt;
&lt;br /&gt;
Flag bits meaning:&lt;br /&gt;
&lt;br /&gt;
* 0..3  (0x000F) - colourspace Format (see below)&lt;br /&gt;
* 4 (0x0010) - MVI2.2 only&lt;br /&gt;
* 5 (0x0020) - MVI2.2 only&lt;br /&gt;
* 6 (0x0040) - MVI2.2 only&lt;br /&gt;
* 7 (0x0080) - MVI2.2 only&lt;br /&gt;
* 8 (0x0100) - MVI2.2 only&lt;br /&gt;
* 9 (0x0200) - MVI2.1 mode&lt;br /&gt;
* 10 (0x0400) - frame cropping enabled (MVI2 only)&lt;br /&gt;
* 11 (0x0800) - low-resolution mode (MVI2 only)&lt;br /&gt;
* 12 (0x1000) - still-frame (or golden frame) mode&lt;br /&gt;
* 13 (0x2000) - frames are coded upside-down (instead of bottoms-up by default)&lt;br /&gt;
* 14 (0x4000) - video was encoded using trial version of the codec (this flag tells original decoder to put watermark to the frame)&lt;br /&gt;
* 15 (0x8000) - image is single-field, only odd lines are carried&lt;br /&gt;
&lt;br /&gt;
=== Golden frame mode ===&lt;br /&gt;
&lt;br /&gt;
When videos with small amount of changes encoded (ex, 'talking heads' or some static scenery) special trick may be performed. Very first frame contains all the scenery, while all successive frames take this first frame as a base and add necessary changes to it. The tricky part is, that first frame contains such a 'change-frame' as well, so you have two logical frames in one physical. Offset to the base frame is located at ('''biSizeImage''' - 4) in the encoded data buffer. Change-frame located at it's start.&lt;br /&gt;
&lt;br /&gt;
Please note that both of the parts in the first frame still contain the golden frame map.&lt;br /&gt;
&lt;br /&gt;
=== Low-resolution mode ===&lt;br /&gt;
&lt;br /&gt;
In this mode half of the pixels are coded using interpolation i.e. when only luma changes are coded then first (interpolated pixel) uses half of that delta value added to the previous pixel and second pixel uses full delta. If exactly one pixel is left between low-res and skip areas, it is interpolated in the same way (luma delta is calculated and half of it is added to the predictor value). If exactly one pixel is left between low-res and and normal area, it uses half of the first delta from the first pixel of that area.&lt;br /&gt;
&lt;br /&gt;
Depending on coding mode and line number full and pixel position may be swapped (e.g. for even lines it may be &amp;quot;interpolated full interpolated full&amp;quot; while for odd lines it is &amp;quot;full interpolated full interpolated&amp;quot;). Additionally in smooth deltas mode luma deltas use limited range unless the very first pixel is full one.&lt;br /&gt;
&lt;br /&gt;
Please note that during vertical prediction stage low-resolution mode pixels are treated as skip pixels.&lt;br /&gt;
&lt;br /&gt;
=== Decompression ===&lt;br /&gt;
&lt;br /&gt;
==== Frame Flags ====&lt;br /&gt;
Each frame begins with sequence of local flag bits. These bits are:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; style=&amp;quot;border-collapse: collapse; border-style: dashed; border-color: #2f6fab;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#f0f0f0&amp;quot; |&lt;br /&gt;
! # of bits !! Present if !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1 || always || KeyframeFlag || non-zero if this frame is a key frame&lt;br /&gt;
|-&lt;br /&gt;
| 3 || flags bit 9 || ColorSpace || colorspace Format for this group of frames&lt;br /&gt;
|-&lt;br /&gt;
| 1 || flags bit 9 || LowRes || low-resolution coding is enabled&lt;br /&gt;
|-&lt;br /&gt;
| 1 || flags bit 9 || SmoothDeltas || use smooth delta-coding&lt;br /&gt;
|-&lt;br /&gt;
| 1 || flags bit 9 || HaveSerial || (see next field)&lt;br /&gt;
|-&lt;br /&gt;
| 20 || flags bit 9 + HaveSerial || SerialNumber || Encoder's serial number&lt;br /&gt;
|-&lt;br /&gt;
| 1 || flags bit 9 || Cropping || frame cropping is enabled&lt;br /&gt;
|-&lt;br /&gt;
| 8 || flags bit 10 or Cropping || CropX || x offset of the frame start&lt;br /&gt;
|-&lt;br /&gt;
| 8 || flags bit 10 or Cropping || CropY || y offset of the frame start&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Maps ====&lt;br /&gt;
Map blocks contain rectangles which should be marked as special on the frame. All versions prior to MVI2.1 use the same format:&lt;br /&gt;
* 12 bits   number of large rectangles&lt;br /&gt;
* 12 bits   number of small rectangles&lt;br /&gt;
* large rectangles&lt;br /&gt;
* small rectangles&lt;br /&gt;
&lt;br /&gt;
Rectangles are stored as &amp;lt;code&amp;gt;&amp;amp;lt;offset, width-1, height-1&amp;amp;gt;&amp;lt;/code&amp;gt; with offset taking &amp;lt;code&amp;gt;ceil(log2(frame width * frame height))&amp;lt;/code&amp;gt; bits and width and height using 8 or 4 bits depending on rectangle size. Rectangles for fill map additionally contain RGB555 fill value.&lt;br /&gt;
&lt;br /&gt;
MVI2.1/MVI2.2 use a different format, they split image into chunks of 8192 bytes and for each of them use 8-bit number of large/small rectangles as well as 13-bit offsets relative to the start of that piece.&lt;br /&gt;
&lt;br /&gt;
==== Deltas Bundle ====&lt;br /&gt;
&lt;br /&gt;
'''TODO'''&lt;br /&gt;
&lt;br /&gt;
==== Assembling the Frame ====&lt;br /&gt;
* leave areas marked as &amp;quot;skip&amp;quot; (but not &amp;quot;lowres&amp;quot;) unchanged&lt;br /&gt;
* copy image data from the golden frame to the areas marked as such (there is no motion displacement)&lt;br /&gt;
* fill areas marked as &amp;quot;fill&amp;quot; with the provided colour&lt;br /&gt;
* perform vertical prediction for the first column (skip if there are no deltas)&lt;br /&gt;
* perform prediction for odd lines using the rest of deltas from the first part (skip if there are no deltas)&lt;br /&gt;
* perform prediction for even lines using deltas from the second part (skip if there are no deltas)&lt;br /&gt;
&lt;br /&gt;
'''TODO'''&lt;br /&gt;
&lt;br /&gt;
== Games Using Motion Pixels ==&lt;br /&gt;
* [https://www.mobygames.com/game/windows/treasure-quest Treasure Quest]&lt;br /&gt;
* [https://www.mobygames.com/game/25426/apollo-18-the-moon-missions/ Apollo 18: The Moon Missions]&lt;br /&gt;
&lt;br /&gt;
== Appendix A ==&lt;br /&gt;
&lt;br /&gt;
Code for generating RGB to YUV table (it is done with YUV to RGB conversion, which is used during decoding as well):&lt;br /&gt;
&lt;br /&gt;
   for (y = 0; y &amp;lt;= 31; y++) {&lt;br /&gt;
        for (v = -31; v &amp;lt;= 31; v++) {&lt;br /&gt;
            for (u = -31; u &amp;lt;= 31; u++) {&lt;br /&gt;
                r = (y * 1000 + v * 701) / 1000;&lt;br /&gt;
                g = (y * 1000 - 357 * v - 172 * u) / 1000;&lt;br /&gt;
                b = (y * 1000 + 886 * u) / 1000;&lt;br /&gt;
                if (r &amp;gt;= 0 &amp;amp;&amp;amp; r &amp;lt; 32 &amp;amp;&amp;amp; g &amp;gt;= 0 &amp;amp;&amp;amp; g &amp;lt; 32 &amp;amp;&amp;amp; b &amp;gt;= 0 &amp;amp;&amp;amp; b &amp;lt; 32) {&lt;br /&gt;
                    pix = (r &amp;lt;&amp;lt; 10) | (g &amp;lt;&amp;lt; 5) | b;&lt;br /&gt;
                    if (!rgb2yuv[pix][0] &amp;amp;&amp;amp; !rgb2yuv[pix][1] &amp;amp;&amp;amp; !rgb2yuv[pix][2]) {&lt;br /&gt;
                        rgb2yuv[pix][0] = y;&lt;br /&gt;
                        rgb2yuv[pix][1] = u;&lt;br /&gt;
                        rgb2yuv[pix][2] = v;&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    for (i = 0; i &amp;lt; 32768; i+= 32) {&lt;br /&gt;
        for (j = 0; j &amp;lt; 31; j++) {&lt;br /&gt;
            for (k = 31; k &amp;gt; j; k--) {&lt;br /&gt;
                pix = i + k;&lt;br /&gt;
                if (!rgb2yuv[pix][0] &amp;amp;&amp;amp; !rgb2yuv[pix][1] &amp;amp;&amp;amp; !rgb2yuv[pix][2]) {&lt;br /&gt;
                    rgb2yuv[pix][0] = rgb2yuv[pix - 1][0];&lt;br /&gt;
                    rgb2yuv[pix][1] = rgb2yuv[pix - 1][1];&lt;br /&gt;
                    rgb2yuv[pix][2] = rgb2yuv[pix - 1][2];&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            for (k = 0; k &amp;lt; 31 - j; k++) {&lt;br /&gt;
                pix = i + k;&lt;br /&gt;
                if (!rgb2yuv[pix][0] &amp;amp;&amp;amp; !rgb2yuv[pix][1] &amp;amp;&amp;amp; !rgb2yuv[pix][2]) {&lt;br /&gt;
                    rgb2yuv[pix][0] = rgb2yuv[pix + 1][0];&lt;br /&gt;
                    rgb2yuv[pix][1] = rgb2yuv[pix + 1][1];&lt;br /&gt;
                    rgb2yuv[pix][2] = rgb2yuv[pix + 1][2];&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Video Codecs]]&lt;br /&gt;
[[Category:Undiscovered Video Codecs]]&lt;br /&gt;
[[Category:Undiscovered Game Formats]]&lt;br /&gt;
[[Category:Game Formats]]&lt;br /&gt;
[[Category:Formats missing in MPlayer]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=LMS&amp;diff=16063</id>
		<title>LMS</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=LMS&amp;diff=16063"/>
		<updated>2025-06-17T10:40:09Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Extension: lms&lt;br /&gt;
* Samples: [http://samples.mplayerhq.hu/game-formats/segacd/ecco-lms/ http://samples.mplayerhq.hu/game-formats/segacd/ecco-lms/]&lt;br /&gt;
&lt;br /&gt;
LMS is a multimedia format used on the [[Sega CD]] game [http://www.mobygames.com/game/sega-cd/ecco-the-dolphin Ecco The Dolphin]. It is a raw grayscale video  plus audio format. Frames are grouped into larger blocks in the following format:&lt;br /&gt;
  2048 bytes - unused?&lt;br /&gt;
  8820 bytes - left channel PCM&lt;br /&gt;
  1420 bytes - padding&lt;br /&gt;
  2048 bytes - unused?&lt;br /&gt;
  8820 bytes - right channel PCM&lt;br /&gt;
  1420 bytes - padding&lt;br /&gt;
  12x8192 bytes - twelve video frames&lt;br /&gt;
&lt;br /&gt;
Video frames are stored in the console format (two 4-bit palette indices in one byte, 32 bytes per one 8x8 tile) except that tiles are arranged in a special order: first frame is divided into strips 4 tiles high and strips are filled column by column. Palette indices seem to correspond to grayscale shades, palettes do not seem to be stored anywhere.&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=YQS&amp;diff=16062</id>
		<title>YQS</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=YQS&amp;diff=16062"/>
		<updated>2025-06-17T10:22:22Z</updated>

		<summary type="html">&lt;p&gt;Kostya: create an alias for YQS to make it easier to find&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[EGG]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=ICOM_video&amp;diff=16061</id>
		<title>ICOM video</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=ICOM_video&amp;diff=16061"/>
		<updated>2025-06-17T10:12:32Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Company: ICOM Simulations Inc.&lt;br /&gt;
* Extension: imv&lt;br /&gt;
&lt;br /&gt;
This is a format used in the original version of [https://www.mobygames.com/group/10092/sherlock-holmes-consulting-detective-series/ Sherlock Holmes: Consulting Detective] series. The files consists of blocks forming logical groups with video for one scene.&lt;br /&gt;
&lt;br /&gt;
Blocks start with 32-bit size, 32-bit previous block size (useful for seeking backwards), and 16-bit block type. Known block types are:&lt;br /&gt;
* 0x01 - global header (first 6 bytes meaning is unknown then there are 2-byte width, height and fps)&lt;br /&gt;
* 0x02 - logical group (scene) start, it contains total group size in multiple of CD sectors&lt;br /&gt;
* 0x04 - audio plus delta frame. First 4-byte value is block number, followed by 2-byte audio data size, followed by audio and video data&lt;br /&gt;
* 0x08 - audio plus raw frame (with the same header)&lt;br /&gt;
* 0x20 - audio plus raw frame plus palette update. First 4-byte value is block number, followed by 2-byte audio data size and video data size, followed by audio and video data, ending with palette update. Palette update starts with 2-byte values for start colour index and number of colours followed by partial VGA palette&lt;br /&gt;
* 0x40 - palette update&lt;br /&gt;
&lt;br /&gt;
Delta frames are coded as a mix of update mask bytes followed by pixel values. E.g. &amp;lt;code&amp;gt;0x7A 0x01 0x02 0x03 0x04 0x05&amp;lt;/code&amp;gt; means skipping one pixel, setting next four pixels to &amp;lt;code&amp;gt;0x01 0x02 0x03 0x04&amp;lt;/code&amp;gt;, skipping one pixel, setting next pixel to &amp;lt;code&amp;gt;0x05&amp;lt;/code&amp;gt; and skipping last pixel. Mask value &amp;lt;code&amp;gt;0x05&amp;lt;/code&amp;gt; is used as an escape value: if it is followed by &amp;lt;code&amp;gt;0x02&amp;lt;/code&amp;gt; then 16-bit number of 8-pixel groups to skip follows, otherwise just ignore that following byte.&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Klondike_Moon_FMV&amp;diff=16060</id>
		<title>Klondike Moon FMV</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Klondike_Moon_FMV&amp;diff=16060"/>
		<updated>2025-06-16T15:01:02Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Extension: SEQ, SFX, VID&lt;br /&gt;
* Samples: http://samples.mplayerhq.hu/game-formats/klondike-moon-fmv/&lt;br /&gt;
&lt;br /&gt;
The DOS game Klondike Moon contains a VIDEOS/ directory that has triplets of files that likely correspond to full motion video files. The SFX files apparently contain unsigned 8-bit PCM. The SEQ files likely contain header/control information to indicate how to play the files.&lt;br /&gt;
&lt;br /&gt;
VID files start with VGA palette and uncompressed 320x200 image followed by non-delimited RLE-coded delta frames.&lt;br /&gt;
&lt;br /&gt;
Those frames actually consist of update chunks starting with 16-bit absolute image offset followed by RLE opcodes:&lt;br /&gt;
* 0xFF 0xFF -- end&lt;br /&gt;
* 0xFF nn ll -- run of pixel &amp;lt;code&amp;gt;nn&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ll&amp;lt;/code&amp;gt; times&lt;br /&gt;
* nn -- single pixel value&lt;br /&gt;
&lt;br /&gt;
[[Category:Video Codecs]]&lt;br /&gt;
[[Category:Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Maelstrom_ANM&amp;diff=16059</id>
		<title>Maelstrom ANM</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Maelstrom_ANM&amp;diff=16059"/>
		<updated>2025-06-16T14:55:17Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Extension: anm&lt;br /&gt;
* Samples: [http://samples.mplayerhq.hu/game-formats/anm-maeldemo/ http://samples.mplayerhq.hu/game-formats/anm-maeldemo/]&lt;br /&gt;
* Samples: {{DexvertSamples|video/maelstromANM}}&lt;br /&gt;
* Game: [https://www.mobygames.com/game/1864/maelstrom/ Maelstrom]&lt;br /&gt;
&lt;br /&gt;
This is an animation format used in the strategy game from early 1990s. It employs chunked format with &amp;lt;code&amp;gt;ANIM&amp;lt;/code&amp;gt; being the root chunk, &amp;lt;code&amp;gt;BPIC&amp;lt;/code&amp;gt; used for the first (intra) frame and &amp;lt;code&amp;gt;DFRM&amp;lt;/code&amp;gt; used for the delta frames.&lt;br /&gt;
&lt;br /&gt;
Intra frame has the following header:&lt;br /&gt;
  1 byte  - unknown&lt;br /&gt;
  1 byte  - mode (0 - raw, 1 - RLE)&lt;br /&gt;
  2 bytes - height&lt;br /&gt;
  2 bytes - width&lt;br /&gt;
  1 byte  - depth (should be 8)&lt;br /&gt;
  1 byte  - number of palette colours&lt;br /&gt;
  N*3 bytes - palette&lt;br /&gt;
&lt;br /&gt;
RLE opcodes are trivial: 0-127 means read 1-128 pixels, 128-255 means run of 129-2 pixels.&lt;br /&gt;
&lt;br /&gt;
Delta frames use RLE compression which is employed per column. For each column there's a byte telling the number of RLE opcodes followed by those opcodes and data:&lt;br /&gt;
* 0 - run, read byte for run length and byte for colour value&lt;br /&gt;
* 1-127 - skip 1-127 lines&lt;br /&gt;
* 128-255 - read 128-1 pixels&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=EGG&amp;diff=16058</id>
		<title>EGG</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=EGG&amp;diff=16058"/>
		<updated>2025-06-16T14:40:04Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fix inaccuracies from confusion with YQS&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Extension: egg ([[Sega Saturn]] port), yqs (PC port)&lt;br /&gt;
* Samples: [http://samples.mplayerhq.hu/game-formats/egg/ http://samples.mplayerhq.hu/game-formats/egg/]&lt;br /&gt;
* Game: [http://www.mobygames.com/game/saturn/independence-day Independence Day]&lt;br /&gt;
&lt;br /&gt;
The format employs YUV frames coded per-plane and [[IMA ADPCM]]-encoded audio. Data is aligned to CD sector size (2048 bytes)&lt;br /&gt;
&lt;br /&gt;
Egg does not have audio stream and has slightly different coding but the differences are minimal.&lt;br /&gt;
&lt;br /&gt;
EGG header:&lt;br /&gt;
  4 bytes - &amp;quot;EGG\0&amp;quot;&lt;br /&gt;
  4 bytes - always 0x350?&lt;br /&gt;
  4 bytes - number of frames&lt;br /&gt;
  2036 bytes - padding&lt;br /&gt;
&lt;br /&gt;
EGG frame header:&lt;br /&gt;
  4x2x3 bytes - offsets to each plane pixel and mode data&lt;br /&gt;
&lt;br /&gt;
EGG frames are always 20kB long.&lt;br /&gt;
&lt;br /&gt;
YQS header:&lt;br /&gt;
  2 bytes - number of frames&lt;br /&gt;
  4 bytes - audio sample rate&lt;br /&gt;
  2042 bytes - padding&lt;br /&gt;
&lt;br /&gt;
YQS frame header:&lt;br /&gt;
  4 bytes - size&lt;br /&gt;
  4x2x3 bytes - offsets to each plane pixel and mode data&lt;br /&gt;
  4 bytes - audio data offset&lt;br /&gt;
  4 bytes - audio data size&lt;br /&gt;
&lt;br /&gt;
Video coding employs quadtree coding and vector quantisation: before actual image data there's an array of possible 2x2 block values which may be used during luma decoding.&lt;br /&gt;
&lt;br /&gt;
Luma plane is coded as 8x8 blocks with mode flags telling how to decode them (fill/skip/split). Chroma plane is coded in similar manner using 4x4 blocks.&lt;br /&gt;
&lt;br /&gt;
Luma coding:&lt;br /&gt;
  if (get_bit() == 0) {&lt;br /&gt;
    raw block - read 64 pixels from pixel data to fill it&lt;br /&gt;
  } else {&lt;br /&gt;
    //split block&lt;br /&gt;
    for (blk_no = 0; blk_no &amp;lt; 4; blk_no++) {&lt;br /&gt;
      if (get_bit() == 1)&lt;br /&gt;
        decode_luma_4x4_block();&lt;br /&gt;
      // otherwise leave it unchanged&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
4x4 luma blocks are coded in the same manner, 2x2 blocks depend on the format.&lt;br /&gt;
&lt;br /&gt;
EGG uses bit pattern (highest bit is the one read first) to determine coding mode:&lt;br /&gt;
* 00 - skip&lt;br /&gt;
* 01 - fill&lt;br /&gt;
* 10 - raw&lt;br /&gt;
* 11xx - VQ with possible transformation (00 - as is, 01 - flip horizontally, 10 - flip vertically, 11 - flip in both directions)&lt;br /&gt;
&lt;br /&gt;
YQS simply uses 2-bit mode for that:&lt;br /&gt;
* 0 - fill&lt;br /&gt;
* 1 - raw&lt;br /&gt;
* 2 - VQ (followed by index in the header table of 2x2 blocks)&lt;br /&gt;
* 3 - VQ flipped vertically&lt;br /&gt;
&lt;br /&gt;
Chroma coding:&lt;br /&gt;
  if (get_bit() == 1) { // otherwise skip&lt;br /&gt;
    if (get_bit() == 0) {&lt;br /&gt;
      fill 4x4 block with single colour&lt;br /&gt;
    } else {&lt;br /&gt;
      for (blk_no = 0; blk_no &amp;lt; 4; blk_no++) {&lt;br /&gt;
        if (get_bit() == 1) {&lt;br /&gt;
          // decode 2x2 chroma block&lt;br /&gt;
          if (get_bit() == 0)&lt;br /&gt;
            fill 2x2 block&lt;br /&gt;
          else&lt;br /&gt;
            raw 2x2 block&lt;br /&gt;
        }&lt;br /&gt;
        // otherwise leave it unchanged&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=EGG&amp;diff=16057</id>
		<title>EGG</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=EGG&amp;diff=16057"/>
		<updated>2025-06-16T14:18:05Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Extension: egg&lt;br /&gt;
* Samples: [http://samples.mplayerhq.hu/game-formats/egg/ http://samples.mplayerhq.hu/game-formats/egg/]&lt;br /&gt;
* Game: [http://www.mobygames.com/game/saturn/independence-day Independence Day] ([[Sega Saturn]] port)&lt;br /&gt;
&lt;br /&gt;
The format employs YUV frames coded per-plane and [[IMA ADPCM]]-encoded audio. Data is aligned to CD sector size (2048 bytes)&lt;br /&gt;
&lt;br /&gt;
Header:&lt;br /&gt;
  2 bytes - number of frames&lt;br /&gt;
  4 bytes - audio sample rate&lt;br /&gt;
  2042 bytes - padding&lt;br /&gt;
&lt;br /&gt;
Frame header:&lt;br /&gt;
  4 bytes - size&lt;br /&gt;
  4x2x3 bytes - offsets to each plane pixel and mode data&lt;br /&gt;
  4 bytes - audio data offset&lt;br /&gt;
  4 bytes - audio data size&lt;br /&gt;
&lt;br /&gt;
Video coding employs quadtree coding and vector quantisation: before actual image data there's an array of possible 2x2 block values which may be used during decoding.&lt;br /&gt;
&lt;br /&gt;
Luma plane is coded as 8x8 blocks with mode flags telling how to decode them:&lt;br /&gt;
  if (get_bit() == 0) {&lt;br /&gt;
    raw block - read 64 pixels from pixel data to fill it&lt;br /&gt;
  } else {&lt;br /&gt;
    //split block&lt;br /&gt;
    for (blk_no = 0; blk_no &amp;lt; 4; blk_no++) {&lt;br /&gt;
      if (get_bit() == 1)&lt;br /&gt;
        decode_luma_4x4_block();&lt;br /&gt;
      // otherwise leave it unchanged&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
4x4 luma blocks are coded in the same manner, 2x2 blocks though use 2-bit mode to determine fill pattern:&lt;br /&gt;
* 0 - fill&lt;br /&gt;
* 1 - raw&lt;br /&gt;
* 2 - VQ index for the blocks from the header&lt;br /&gt;
* 3 - same but flipped vertically&lt;br /&gt;
&lt;br /&gt;
Chroma coding is similar:&lt;br /&gt;
  if (get_bit() == 1) { // otherwise skip&lt;br /&gt;
    if (get_bit() == 0) {&lt;br /&gt;
      fill 4x4 block with single colour&lt;br /&gt;
    } else {&lt;br /&gt;
      for (blk_no = 0; blk_no &amp;lt; 4; blk_no++) {&lt;br /&gt;
        if (get_bit() == 1) {&lt;br /&gt;
          // decode 2x2 chroma block&lt;br /&gt;
          if (get_bit() == 0)&lt;br /&gt;
            fill 2x2 block&lt;br /&gt;
          else&lt;br /&gt;
            raw 2x2 block&lt;br /&gt;
        }&lt;br /&gt;
        // otherwise leave it unchanged&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Savage_Warriors_ANM&amp;diff=16056</id>
		<title>Savage Warriors ANM</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Savage_Warriors_ANM&amp;diff=16056"/>
		<updated>2025-06-16T14:01:28Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Extension: anm&lt;br /&gt;
* Samples: [http://samples.mplayerhq.hu/game-formats/anm-savagewarriors/ http://samples.mplayerhq.hu/game-formats/anm-savagewarriors/]&lt;br /&gt;
* Game: [http://www.mobygames.com/game/dos/savage-warriors Savage Warriors]&lt;br /&gt;
&lt;br /&gt;
This is a format that employs LZ77 compression from Diet (Japanese executable compressor). Additionally there are two flavours of the format, the version used in demo version of the game and lacks &amp;quot;CHCK&amp;quot; header, and the one used in the full version (with the header and 32-bit checksum inserted after every 4kB of the file data).&lt;br /&gt;
&lt;br /&gt;
Beside the 4-byte header the rest are video frame chunks:&lt;br /&gt;
&lt;br /&gt;
  1 byte  - mode (0 - Diet packed image data, 1 - RLE, 0xFF - end of file)&lt;br /&gt;
  1 byte  - palette present&lt;br /&gt;
  2 bytes - unknown&lt;br /&gt;
  2 bytes - width&lt;br /&gt;
  2 bytes - height&lt;br /&gt;
  2 bytes - X offset&lt;br /&gt;
  2 bytes - Y offset&lt;br /&gt;
  4 bytes - frame size&lt;br /&gt;
  (if palette is present) 768 bytes - palette&lt;br /&gt;
  N bytes - frame size&lt;br /&gt;
&lt;br /&gt;
RLE compression codes segments in form of &amp;lt;code&amp;gt;(skip, opcode, data)&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;skip&amp;lt;/code&amp;gt; is the number of pixels to skip, &amp;lt;code&amp;gt;opcode&amp;lt;/code&amp;gt; tells what operations to perform (skip=opcode=0 means image end, 1-127 means copying 1-127 pixels from the stream, 128-255 means run of 128-1 pixels).&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Castles_II_video&amp;diff=16055</id>
		<title>Castles II video</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Castles_II_video&amp;diff=16055"/>
		<updated>2025-06-16T13:39:53Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Game: [https://www.mobygames.com/game/1874/castles-ii-siege-conquest/ Castles II]&lt;br /&gt;
* Extension: .M&lt;br /&gt;
&lt;br /&gt;
This is a simple animation format presumably created by [https://www.mobygames.com/person/7626/byon-garrabrant/ Byon Garrabrant] and used in game to show a grayscale film footage (for other animations [[Interplay MVE]] is used).&lt;br /&gt;
&lt;br /&gt;
Header:&lt;br /&gt;
  10 bytes - &amp;quot;BYON PIZZA&amp;quot;&lt;br /&gt;
  2  bytes - height&lt;br /&gt;
  2  bytes - width&lt;br /&gt;
  2  bytes - unknown&lt;br /&gt;
&lt;br /&gt;
Then video frames follow, each starting with 16-bit size.&lt;br /&gt;
&lt;br /&gt;
Frames are split into 2x2 tiles and use the following opcodes to decode them:&lt;br /&gt;
* 0-63 -- this is the first pixel value, other three pixel value follow&lt;br /&gt;
* 64-127 -- fill tile with the value of low 6 bits of the opcode&lt;br /&gt;
* 128-255 -- skip 0-127 tiles&lt;br /&gt;
&lt;br /&gt;
Video uses 64 greyscale shades with 0 corresponding to white and 63 corresponding to black.&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Shadowcaster_cutscene&amp;diff=16054</id>
		<title>Shadowcaster cutscene</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Shadowcaster_cutscene&amp;diff=16054"/>
		<updated>2025-06-16T13:29:52Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fill information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Game: [https://www.mobygames.com/game/550/shadowcaster/ Shadowcaster]&lt;br /&gt;
* Extension: DAT&lt;br /&gt;
&lt;br /&gt;
This cutscene format combines compressed video data with other commands like starting/stopping external music.&lt;br /&gt;
&lt;br /&gt;
Header:&lt;br /&gt;
  2 bytes -- 0x105&lt;br /&gt;
  2 bytes -- width&lt;br /&gt;
  2 bytes -- height&lt;br /&gt;
  2 bytes -- fps&lt;br /&gt;
  48 bytes -- unknown/unused&lt;br /&gt;
&lt;br /&gt;
The rest of file is organised into chunks with 16-bit tag, 32-bit size and payload. Known chunk types are:&lt;br /&gt;
* 1 -- intra RLE frame (negative value - copy, positive value - run)&lt;br /&gt;
* 2 -- optionally LZSS-packed inter RLE frame (each line containing start position and the number of RLE segments to update)&lt;br /&gt;
* 3 -- unpacked or LZSS-packed frame&lt;br /&gt;
* 4 -- palette update&lt;br /&gt;
* 16-21 -- unknown commands&lt;br /&gt;
* 22 -- palette selection command (one byte is palette index)&lt;br /&gt;
* 23-24 -- unknown commands&lt;br /&gt;
* 25 -- repeat frame command (one byte tells how many times)&lt;br /&gt;
* 32 -- set palette to all black&lt;br /&gt;
* 33 -- fade in command (one byte is target palette index)&lt;br /&gt;
* 34 -- fade out command &lt;br /&gt;
* 35 -- unknown&lt;br /&gt;
&lt;br /&gt;
Palette data is stored as the palette index followed by the number of palette segments and actual segments (number of colours to skip from previous segment, number of colours in the segment modulo 256, actual colour data).&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Formats]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Talk:Engines/XPAT&amp;diff=15945</id>
		<title>Talk:Engines/XPAT</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Talk:Engines/XPAT&amp;diff=15945"/>
		<updated>2025-05-10T12:53:27Z</updated>

		<summary type="html">&lt;p&gt;Kostya: Created page with &amp;quot;== FLX ==  This one looks like a slightly extended Flic Video with sub-chunk 21 containing audio data and sub-chunk 22 containing some kind of back-references to that audio (and they're always 10 bytes long). --~~~~&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== FLX ==&lt;br /&gt;
&lt;br /&gt;
This one looks like a slightly extended [[Flic Video]] with sub-chunk 21 containing audio data and sub-chunk 22 containing some kind of back-references to that audio (and they're always 10 bytes long). --[[User:Kostya|Kostya]] ([[User talk:Kostya|talk]]) 05:53, 10 May 2025 (PDT)&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Microsoft_Camcorder_Video&amp;diff=15875</id>
		<title>Microsoft Camcorder Video</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Microsoft_Camcorder_Video&amp;diff=15875"/>
		<updated>2025-04-16T11:34:40Z</updated>

		<summary type="html">&lt;p&gt;Kostya: Fill the details at last.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* FourCC: CGDI&lt;br /&gt;
* Company: [[Microsoft]]&lt;br /&gt;
* Samples: http://samples.mplayerhq.hu/V-codecs/CGDI/&lt;br /&gt;
* References: http://support.microsoft.com/support/office/content/office97/camcorder.asp&lt;br /&gt;
&lt;br /&gt;
According to Microsoft's documentation, Camcorder Video allows users of Microsoft Office 97 to record video of their desktop. This would make it a screen capture codec if not for the fact that it actually records GDI and WINUSER API calls so in order to reconstruct image one has to implement those GDI calls.&lt;br /&gt;
&lt;br /&gt;
Each frame consists of records containing GDI/WINUSER commands:&lt;br /&gt;
&lt;br /&gt;
  bytes 0-3   size of record including this field&lt;br /&gt;
  bytes 4-5   command code&lt;br /&gt;
  bytes 6-9   unknown&lt;br /&gt;
  bytes 10-... command arguments, usually 16-bit integers&lt;br /&gt;
&lt;br /&gt;
The internal state keeps a list of GDI objects in an internal array and references them by ID so that the command e.g. for drawing a rectangle sends as parameters rectangle coordinates (left, top, right, bottom) as well as the brush ID that will be selected before rectangle will be drawn. In general the commands that have brush, pen IDs or such send those IDs at the end of the list but before the variable-length part (e.g. points to draw polyline).&lt;br /&gt;
&lt;br /&gt;
Known opcodes are:&lt;br /&gt;
* &amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt; -- fill region using region and brush IDs&lt;br /&gt;
* &amp;lt;code&amp;gt;0x01&amp;lt;/code&amp;gt; -- draw a border around region; parameters are region/brush IDs plus stroke width/height&lt;br /&gt;
* &amp;lt;code&amp;gt;0x02&amp;lt;/code&amp;gt; -- invert region&lt;br /&gt;
* &amp;lt;code&amp;gt;0x03&amp;lt;/code&amp;gt; -- paint region using the provided region/brush IDs&lt;br /&gt;
* &amp;lt;code&amp;gt;0x04&amp;lt;/code&amp;gt; -- draw an arc using provided coordinates and brush ID&lt;br /&gt;
* &amp;lt;code&amp;gt;0x05&amp;lt;/code&amp;gt; -- draw a line to the provided point using brush ID&lt;br /&gt;
* &amp;lt;code&amp;gt;0x06&amp;lt;/code&amp;gt; -- moveto (parameters are point coordinates)&lt;br /&gt;
* &amp;lt;code&amp;gt;0x07&amp;lt;/code&amp;gt; -- not present&lt;br /&gt;
* &amp;lt;code&amp;gt;0x08&amp;lt;/code&amp;gt; -- polyline (first parameter is number of points, second parameter is brush ID, the rest are line points)&lt;br /&gt;
* &amp;lt;code&amp;gt;0x09&amp;lt;/code&amp;gt; -- draw a chord (same parameters as for arc)&lt;br /&gt;
* &amp;lt;code&amp;gt;0x0A&amp;lt;/code&amp;gt; -- draw focused rectangle (parameters are rectangle coordinates)&lt;br /&gt;
* &amp;lt;code&amp;gt;0x0B&amp;lt;/code&amp;gt; -- draw an ellipse (parameters are bounding rectangle plus pen and brush IDs)&lt;br /&gt;
* &amp;lt;code&amp;gt;0x0C&amp;lt;/code&amp;gt; -- draw filled rectangle (WINUSER; parameters are its coordinates and brush ID)&lt;br /&gt;
* &amp;lt;code&amp;gt;0x0D&amp;lt;/code&amp;gt; -- draw frame rectangle (same parameters)&lt;br /&gt;
* &amp;lt;code&amp;gt;0x0E&amp;lt;/code&amp;gt; -- invert rectangle at the provided coordinates&lt;br /&gt;
* &amp;lt;code&amp;gt;0x0F&amp;lt;/code&amp;gt; -- draw a pie (parameters are coordinates passed to the GDI function plus brush and pen IDs)&lt;br /&gt;
* &amp;lt;code&amp;gt;0x10&amp;lt;/code&amp;gt; -- draw a polygon (parameters are number of points, brush/pen IDs and vertices coordinates)&lt;br /&gt;
* &amp;lt;code&amp;gt;0x11&amp;lt;/code&amp;gt; -- draw a series of polygons (essentially the same parameters)&lt;br /&gt;
* &amp;lt;code&amp;gt;0x12&amp;lt;/code&amp;gt; -- draw a rectangle (GDI) using provided coordinates and brush/pen IDs&lt;br /&gt;
* &amp;lt;code&amp;gt;0x13&amp;lt;/code&amp;gt; -- draw a rounded rectangle using provided coordinates, corner radius and brush/pen IDs&lt;br /&gt;
* &amp;lt;code&amp;gt;0x14&amp;lt;/code&amp;gt; -- blit bitmap using the provided arguments to &amp;lt;code&amp;gt;BitBlt&amp;lt;/code&amp;gt; and bitmap ID&lt;br /&gt;
* &amp;lt;code&amp;gt;0x15&amp;lt;/code&amp;gt; -- blit (optionally stretched bitmap)&lt;br /&gt;
* &amp;lt;code&amp;gt;0x16&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;ExtFloodFill&amp;lt;/code&amp;gt; using provided coordinates, colour, mode and brush ID&lt;br /&gt;
* &amp;lt;code&amp;gt;0x17&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;PatBlt&amp;lt;/code&amp;gt; using provided coordinates, mode and brush ID&lt;br /&gt;
* &amp;lt;code&amp;gt;0x18&amp;lt;/code&amp;gt; -- set pixel at the provided coordinates to the provided colour value&lt;br /&gt;
* &amp;lt;code&amp;gt;0x19&amp;lt;/code&amp;gt; -- stretched blit using provided coordinates, mode and bitmap ID&lt;br /&gt;
* &amp;lt;code&amp;gt;0x1A&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;SetDIBitsToDevice&amp;lt;/code&amp;gt; using provided bitmap data&lt;br /&gt;
* &amp;lt;code&amp;gt;0x1B&amp;lt;/code&amp;gt; -- &amp;lt;code&amp;gt;StretchDIBits&amp;lt;/code&amp;gt; using provided bitmap data&lt;br /&gt;
* &amp;lt;code&amp;gt;0x1C&amp;lt;/code&amp;gt; -- draw provided text using specified pen/brush IDs&lt;br /&gt;
* &amp;lt;code&amp;gt;0x1D&amp;lt;/code&amp;gt; -- same but using &amp;lt;code&amp;gt;TextOut&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;ExtTextOut&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;0x1E&amp;lt;/code&amp;gt; -- draw text with WINUSER function&lt;br /&gt;
* &amp;lt;code&amp;gt;0x1F&amp;lt;/code&amp;gt; -- WINUSER TabbedTextOut&lt;br /&gt;
* &amp;lt;code&amp;gt;0x20&amp;lt;/code&amp;gt; -- draw window frame&lt;br /&gt;
* &amp;lt;code&amp;gt;0x21&amp;lt;/code&amp;gt; -- create new palette using provided data&lt;br /&gt;
* &amp;lt;code&amp;gt;0x22&amp;lt;/code&amp;gt; -- delete requested GDI object by ID&lt;br /&gt;
* &amp;lt;code&amp;gt;0x23&amp;lt;/code&amp;gt; -- unused&lt;br /&gt;
* &amp;lt;code&amp;gt;0x24&amp;lt;/code&amp;gt; -- init window parameters (origin and viewport)&lt;br /&gt;
* &amp;lt;code&amp;gt;0x25&amp;lt;/code&amp;gt; -- something similar&lt;br /&gt;
* &amp;lt;code&amp;gt;0x26&amp;lt;/code&amp;gt;-&amp;lt;code&amp;gt;0x32&amp;lt;/code&amp;gt; -- unused&lt;br /&gt;
* &amp;lt;code&amp;gt;0x33&amp;lt;/code&amp;gt; -- set mapping mode to the provided argument&lt;br /&gt;
* &amp;lt;code&amp;gt;0x34&amp;lt;/code&amp;gt; -- set window and viewport extents&lt;br /&gt;
* &amp;lt;code&amp;gt;0x35&amp;lt;/code&amp;gt; -- set viewport origin&lt;br /&gt;
* &amp;lt;code&amp;gt;0x36&amp;lt;/code&amp;gt; -- set window origin&lt;br /&gt;
* &amp;lt;code&amp;gt;0x37&amp;lt;/code&amp;gt; -- set background mix mode&lt;br /&gt;
* &amp;lt;code&amp;gt;0x38&amp;lt;/code&amp;gt; -- set background colour&lt;br /&gt;
* &amp;lt;code&amp;gt;0x39&amp;lt;/code&amp;gt; -- set foreground mix mode&lt;br /&gt;
* &amp;lt;code&amp;gt;0x3A&amp;lt;/code&amp;gt; -- set text colour&lt;br /&gt;
* &amp;lt;code&amp;gt;0x3B&amp;lt;/code&amp;gt; -- set text align mode&lt;br /&gt;
* &amp;lt;code&amp;gt;0x3C&amp;lt;/code&amp;gt; -- set text justification&lt;br /&gt;
* &amp;lt;code&amp;gt;0x3D&amp;lt;/code&amp;gt; -- set brush origin&lt;br /&gt;
* &amp;lt;code&amp;gt;0x3E&amp;lt;/code&amp;gt; -- set polygon fill mode&lt;br /&gt;
* &amp;lt;code&amp;gt;0x3F&amp;lt;/code&amp;gt; -- create new brush with the provided parameters as store it at the provided ID&lt;br /&gt;
* &amp;lt;code&amp;gt;0x40&amp;lt;/code&amp;gt; -- create new font using the provided parameters and destination ID&lt;br /&gt;
* &amp;lt;code&amp;gt;0x41&amp;lt;/code&amp;gt; -- create patterned brush&lt;br /&gt;
* &amp;lt;code&amp;gt;0x42&amp;lt;/code&amp;gt; -- create new pen&lt;br /&gt;
* &amp;lt;code&amp;gt;0x43&amp;lt;/code&amp;gt; -- create memory object (some kind of bitmap?) by copying data from the stream to the given ID object&lt;br /&gt;
* &amp;lt;code&amp;gt;0x44&amp;lt;/code&amp;gt; -- init some window parameters&lt;br /&gt;
* &amp;lt;code&amp;gt;0x45&amp;lt;/code&amp;gt; -- unused&lt;br /&gt;
* &amp;lt;code&amp;gt;0x46&amp;lt;/code&amp;gt; -- create new bitmap using data from the stream&lt;br /&gt;
* &amp;lt;code&amp;gt;0x47&amp;lt;/code&amp;gt; -- init some window parameters&lt;br /&gt;
* &amp;lt;code&amp;gt;0x48&amp;lt;/code&amp;gt; -- set default parameters to the drawing system (usually the very first opcode in the first frame)&lt;br /&gt;
* &amp;lt;code&amp;gt;0x49&amp;lt;/code&amp;gt; -- clear drawing system from used objects&lt;br /&gt;
* &amp;lt;code&amp;gt;0x4A&amp;lt;/code&amp;gt; -- set some flag, probably for custom window clipping&lt;br /&gt;
* &amp;lt;code&amp;gt;0x4B&amp;lt;/code&amp;gt; -- delete requested object&lt;br /&gt;
&lt;br /&gt;
[[Category:Video Codecs]]&lt;br /&gt;
[[Category:Screen Capture Video Codecs]]&lt;br /&gt;
[[Category:Formats missing in MPlayer]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=PI-Video&amp;diff=15874</id>
		<title>PI-Video</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=PI-Video&amp;diff=15874"/>
		<updated>2025-04-05T14:20:02Z</updated>

		<summary type="html">&lt;p&gt;Kostya: fix some details&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* FOURCC: &amp;lt;code&amp;gt;PIVC&amp;lt;/code&amp;gt;&lt;br /&gt;
* Company: Nordic Company&lt;br /&gt;
&lt;br /&gt;
This is a rather simple quadtree-based paletted video codec with its name probably coming from its developer initials.&lt;br /&gt;
&lt;br /&gt;
The image is split into squares of 4&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt;x4&amp;lt;sup&amp;gt;n&amp;lt;/sup&amp;gt; pixels large for the closest match with frame dimensions (e.g. 256x256 squares for 320x240 video) that get divided into 16 parts with a flag telling if the part is fill/skip or should be further subdivided (or coded as raw for 4x4 squares). Flags and pixel data are grouped into separate data chunks inside the frame.&lt;br /&gt;
&lt;br /&gt;
Frame consists of the following data: 32-bit frame flags, 32-bit frame size (not counting frame flags), tile flags data (starting with 32-bit size), and pixel data. There are two known frame flags: bit 0 signals inter frame coding and bit 1 signals that pixel data is LZW-compressed.&lt;br /&gt;
&lt;br /&gt;
Simplified decoding process:&lt;br /&gt;
&lt;br /&gt;
  tile_size = 0x4000;&lt;br /&gt;
  do {&lt;br /&gt;
    tile_size &amp;gt;&amp;gt;= 2;&lt;br /&gt;
  } while (tile_size &amp;gt;= max(width, height))&lt;br /&gt;
  tile_size &amp;lt;&amp;lt;= 2;&lt;br /&gt;
  &lt;br /&gt;
  cur_tile_size = tile_size;&lt;br /&gt;
  for each tile in image&lt;br /&gt;
    decode_tile(tile_pos, cur_tile_size);&lt;br /&gt;
  &lt;br /&gt;
  decode_tile(pos, cur_tile_size) {&lt;br /&gt;
    flags = get_16bit_le(flags_data);&lt;br /&gt;
    for each one of 16 subparts in tile {&lt;br /&gt;
      if part is inside the image area {&lt;br /&gt;
        if ((flag &amp;amp; 1) == 0) {&lt;br /&gt;
           pix = get_byte(pixel_data);&lt;br /&gt;
           if (intra || pix != 0) {&lt;br /&gt;
               fill subpart with pix value&lt;br /&gt;
           }&lt;br /&gt;
        } else if (cur_tile_size &amp;gt; 4) {&lt;br /&gt;
           decode_tile(subpart, cur_tile_size &amp;gt;&amp;gt; 2);&lt;br /&gt;
        } else {&lt;br /&gt;
           fill 4x4 block with 16 values read from pixel data&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
      flags &amp;gt;&amp;gt;= 1;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
LZW differs from the conventional algorithm used e.g. in GIF. First, there is single escape code 256 which is followed by two-bit mode (0 - end of stream, 1 - restart, 2 - increase current index bits). Second, index bits increase is manual because inter-frames keep using previous LZW dictionary to decode pixel data, so while they start decoding with 9-bit indices, they may bump it a couple of time and start reading e.g. 11-bit indices.&lt;br /&gt;
&lt;br /&gt;
Additionally codec uses fixed palette stored in the middle of its extradata (first 32-bit word of it seems to be the header size before actual palette starts).&lt;br /&gt;
&lt;br /&gt;
[[Category:Video Codecs]]&lt;/div&gt;</summary>
		<author><name>Kostya</name></author>
	</entry>
</feed>