<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multimedia.cx/index.php?action=history&amp;feed=atom&amp;title=Highlander_FMV</id>
	<title>Highlander FMV - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multimedia.cx/index.php?action=history&amp;feed=atom&amp;title=Highlander_FMV"/>
	<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Highlander_FMV&amp;action=history"/>
	<updated>2026-04-26T12:46:55Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://wiki.multimedia.cx/index.php?title=Highlander_FMV&amp;diff=15671&amp;oldid=prev</id>
		<title>Kostya: fill description</title>
		<link rel="alternate" type="text/html" href="https://wiki.multimedia.cx/index.php?title=Highlander_FMV&amp;diff=15671&amp;oldid=prev"/>
		<updated>2022-10-15T09:27:47Z</updated>

		<summary type="html">&lt;p&gt;fill description&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;* Company: Lore Design Limited&lt;br /&gt;
&lt;br /&gt;
This in an FMV format used in an unpublished PC game [https://www.mobygames.com/game/jaguar/highlander-the-last-of-the-macleods Highlander: The Last of the MacLeods]. It contains 320x240 frames using fixed palette and 22kHz 8-bit PCM audio.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
FMV file contains a sequence of chunks prefixed with 4-byte chunk type and 32-bit little-endian chunk size. There are only four known chunk types:&lt;br /&gt;
* &amp;lt;code&amp;gt;FMV*&amp;lt;/code&amp;gt; - file header (no data)&lt;br /&gt;
* &amp;lt;code&amp;gt;AUD1&amp;lt;/code&amp;gt; - PCM data&lt;br /&gt;
* &amp;lt;code&amp;gt;VID3&amp;lt;/code&amp;gt; - video frame&lt;br /&gt;
* &amp;lt;code&amp;gt;END*&amp;lt;/code&amp;gt; - end of data&lt;br /&gt;
&lt;br /&gt;
== Video compression ==&lt;br /&gt;
&lt;br /&gt;
Frame data is compressed twice with history-based compression (first 32 bits of the frame data are the size of compressed data) and contains commands to paint 4x4 blocks of the frame.&lt;br /&gt;
&lt;br /&gt;
=== History-based compression ===&lt;br /&gt;
&lt;br /&gt;
This is a simple compression method that reads flags (one byte at once, LSB first) and depending on flag value either reads new output value from the stream or reuses a value from history buffer:&lt;br /&gt;
&lt;br /&gt;
  prev = 0;&lt;br /&gt;
  pprev = 0;&lt;br /&gt;
  while there's still data {&lt;br /&gt;
    flags = *src++;&lt;br /&gt;
    for (i = 0; i &amp;lt; 8; i++) {&lt;br /&gt;
      hist_idx = (pprev &amp;lt;&amp;lt; 7) ^ prev;&lt;br /&gt;
      if ((flags &amp;gt;&amp;gt; i) &amp;amp; 1)&lt;br /&gt;
        hist[hist_idx] = *src++;&lt;br /&gt;
      *dst++ = hist[hist_idx];&lt;br /&gt;
      pprev = prev;&lt;br /&gt;
      prev = hist[hist_idx];&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
=== Block painting commands ===&lt;br /&gt;
There are nine commands to paint blocks in rather dithered form. First byte of the stream is command index, the following 1-16 bytes are pixel values:&lt;br /&gt;
&lt;br /&gt;
* 0 - read pixel value, fill block with it&lt;br /&gt;
* 1 - read two pixel values, paint block as&lt;br /&gt;
  0 1 0 1&lt;br /&gt;
  1 0 1 0&lt;br /&gt;
  0 1 0 1&lt;br /&gt;
  1 0 1 0&lt;br /&gt;
* 2 - read two pixel values, paint block as&lt;br /&gt;
  0 1 0 1&lt;br /&gt;
  1 1 1 1&lt;br /&gt;
  0 1 0 1&lt;br /&gt;
  1 1 1 1&lt;br /&gt;
* 3 - read two pixel values, paint block as&lt;br /&gt;
  0 1 0 1&lt;br /&gt;
  0 0 0 0&lt;br /&gt;
  0 1 0 1&lt;br /&gt;
  0 0 0 0&lt;br /&gt;
* 4 - read two pixel values, paint block as&lt;br /&gt;
  0 0 0 0&lt;br /&gt;
  0 1 0 1&lt;br /&gt;
  0 0 0 0&lt;br /&gt;
  0 1 0 1&lt;br /&gt;
* 5 - read two pixel values, paint block as&lt;br /&gt;
  1 1 1 1&lt;br /&gt;
  0 1 0 1&lt;br /&gt;
  1 1 1 1&lt;br /&gt;
  0 1 0 1&lt;br /&gt;
* 6 - read five pixel values, paint block as&lt;br /&gt;
  0 1 0 2&lt;br /&gt;
  1 3 1 4&lt;br /&gt;
  0 1 0 2&lt;br /&gt;
  2 4 2 4&lt;br /&gt;
* 7 - read eight pixel values, paint block as&lt;br /&gt;
  0 1 2 3&lt;br /&gt;
  1 0 3 2&lt;br /&gt;
  4 5 6 7&lt;br /&gt;
  5 4 7 6&lt;br /&gt;
* 8 - read 16 pixels for block contents&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>
</feed>