Motion Pixels: Difference between revisions

From MultimediaWiki
Jump to navigation Jump to search
(")
(found another game that uses Motion Pixels)
 
(11 intermediate revisions by 6 users not shown)
Line 2: Line 2:
* Company: [[Sirius Publishing]]
* Company: [[Sirius Publishing]]
* Samples:
* Samples:
** MVI1: [http://www.mplayerhq.hu/MPlayer/samples/game-formats/mvi1-avi/ http://www.mplayerhq.hu/MPlayer/samples/game-formats/mvi1-avi/]
** MVI1: [http://samples.mplayerhq.hu/game-formats/mvi1-avi/ http://samples.mplayerhq.hu/game-formats/mvi1-avi/]
** MVI2: [http://www.mplayerhq.hu/MPlayer/samples/V-codecs/MVI2/ http://www.mplayerhq.hu/MPlayer/samples/V-codecs/MVI2/]
** MVI2: [http://samples.mplayerhq.hu/V-codecs/MVI2/ http://samples.mplayerhq.hu/V-codecs/MVI2/]
** Movie CD: [http://samples.mplayerhq.hu/drivers32/motionpixelsmoviecd/ http://samples.mplayerhq.hu/drivers32/motionpixelsmoviecd/]
** Movie CD Win32 Codecs: [http://samples.mplayerhq.hu/drivers32/motionpixels/ http://samples.mplayerhq.hu/drivers32/motionpixels/]


Motion Pixels version 1 (MVI1) was used in a single PC game, [http://www.mobygames.com/game/windows/treasure-quest Treasure Quest] 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.
== Introduction ==
 
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.
 
MVI belongs to the "old-school" 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.
 
Compressed MVI1 video may be carried in the custom [[MVI Container]] format.
 
== Documentation Notes ==
 
As MVI2 version is merely an addition to MVI1, both formats will be documented together, where MVI2-specific features will be marked with '''V2''' symbol.
 
== MVI Codec ==
 
=== Compression Flags ===
 
When video is packaged inside [[AVI]] files, all vital codec's parameters carried in [[BITMAPINFOHEADER]]'s '''biCompression''' field of the video stream. These flag bits are:
 
* 0..3  (0x000F) - Colorspace Format (see below)
* '''V2'''  9 (0x0200) - ...
* '''V2''' 10 (0x0400) - ...
* 11 - (0x0800) ...
* 12 - (0x1000) Still-Frame mode
* 13 - (0x2000) Frames are upside-down
* 14 - (0x4000) Video was encoded using trial version of the codec (this flag tells original decoder to put watermark to the frame)
* 15 - (0x8000) Image is interlaced (single-field, in MP's terminology), only odd lines carried
 
=== Colorspace Formats ===
 
Output always RGB, but as an extra compression feature, source image may be initially converted to one of listed formats:
 
* 0 - RGB
* 1 - YUV 4:2:2
* 2 - YUV 4:1:1
* 3 - YUV 8:1:1
* 4 - YUV 16:1:1
 
 
=== Normal mode VS Still-Frame mode ===
 
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 neccessary 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.
 
=== Bit Reader ===
 
Compressed data stored using binary stream. Bitreader operates with internal 32-bits queue and pops bits starting from the highest. '''TODO''' : Add sample
 
=== Decompression ===
 
==== General Frame Structure ====
 
* Frame Flags
* Mask Block
* Motion Block
* Fill Block
* '''V2''' Extra Block
* Deltas Bundle
** Initial Position
** Color Deltas
** Huffman Tree
** Packed Deltas Indicies
 
==== Frame Flags ====
Each frame begins with sequence of local flag bits. These bits are:
{| border="1" cellpadding="5" style="border-collapse: collapse; border-style: dashed; border-color: #2f6fab;"
|- bgcolor="#f0f0f0" |
! # of bits !! Present if !! Name !! Description
|-
| 1 || always || KeyframeFlag || Non-zero if this frame is a key frame (for Still-Frame mode this DOES NOT mean base frame change!)
|-
| '''V2''' 3 || flags bit 9 || ColorSpace || Colorspace Format for this frame
|-
| '''V2''' 1 || flags bit 9 || ... || ...
|-
| '''V2''' 1 || flags bit 9 || SmoothDeltas || Use smooth delta-coding
|-
|'''V2''' 1 || flags bit 9 || HaveSerial || (see next field)
|-
| '''V2''' 20 || flags bit 9 + HaveSerial || SerialNumber || Encoder's serial number
|-
| '''V2''' 1 || flags bit 9 || ... || ...
|-
| '''V2''' 8 || flags bit 10 || ... || ...
|-
| '''V2''' 8 || flags bit 10 || ... || ...
|}
 
==== Mask Block ====
Mask block contains changes since the last frame. There are two types of masks - general masks, which tell what rectangular area has changed since last frame, and fill masks, which also specify colour value to fill that rectangle.
If bit (buf[1]&2) is set then general masks are present along with fill mask, otherwise only fill masks are present.
 
Masks bistream:
 
    12 bits    count of masks with dimensions <= 256x256
    12 bits    count of masks with dimensions <= 16x16
    masks
 
Mask data is stored as <offset, width, height, [color]>. Offset size = ceil(log2(frame width * frame height)), width and height take 4 or 8 bits depending on mask max dimension, color value is present only for fill masks and takes 15 bits.
 
==== Motion Block ====
==== Fill Block ====
==== Extra Block ====
==== Color Deltas Bundle ====
==== Assembling the Frame ====
 
== Games Using Motion Pixels ==
* [https://www.mobygames.com/game/windows/treasure-quest Treasure Quest]
* [https://www.mobygames.com/game/25426/apollo-18-the-moon-missions/ Apollo 18: The Moon Missions]


[[Category:Video Codecs]]
[[Category:Video Codecs]]
Line 11: Line 119:
[[Category:Undiscovered Game Formats]]
[[Category:Undiscovered Game Formats]]
[[Category:Game Formats]]
[[Category:Game Formats]]
 
[[Category:Formats missing in MPlayer]]
 
 
 
<div id="nolabel" style="overflow:auto;height:1px;">
Pharmacy:
You wouldn't be asking [http://buy-cheap-xanax.umaxnet.com/ buy cheap xanax]  [http://www.zorpia.com/xfarm tramadol online] How did not sold and he! It seemed unaware
[http://www.geocities.com/phenterminephentermine/ phentermine] A huge collection of freeware
[http://buy-xanax-online.umaxnet.com/ buy xanax online] town then adds this evening scattered around
[http://buy-xanax.umaxnet.com/ buy xanax]
[http://xanax-on-line.umaxnet.com/ xanax on line]  
[http://2mg-xanax.umaxnet.com/ 2mg xanax] [http://generic-xanax.umaxnet.com/ generic xanax]  
</div>

Latest revision as of 22:11, 5 October 2023

Introduction

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.

MVI belongs to the "old-school" family of video codecs and relies on interframe differences and adaptive delta-coding for horizontal lines of the picture. Delta coefficients are additionally 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.

Compressed MVI1 video may be carried in the custom MVI Container format.

Documentation Notes

As MVI2 version is merely an addition to MVI1, both formats will be documented together, where MVI2-specific features will be marked with V2 symbol.

MVI Codec

Compression Flags

When video is packaged inside AVI files, all vital codec's parameters carried in BITMAPINFOHEADER's biCompression field of the video stream. These flag bits are:

  • 0..3 (0x000F) - Colorspace Format (see below)
  • V2 9 (0x0200) - ...
  • V2 10 (0x0400) - ...
  • 11 - (0x0800) ...
  • 12 - (0x1000) Still-Frame mode
  • 13 - (0x2000) Frames are upside-down
  • 14 - (0x4000) Video was encoded using trial version of the codec (this flag tells original decoder to put watermark to the frame)
  • 15 - (0x8000) Image is interlaced (single-field, in MP's terminology), only odd lines carried

Colorspace Formats

Output always RGB, but as an extra compression feature, source image may be initially converted to one of listed formats:

  • 0 - RGB
  • 1 - YUV 4:2:2
  • 2 - YUV 4:1:1
  • 3 - YUV 8:1:1
  • 4 - YUV 16:1:1


Normal mode VS Still-Frame mode

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 neccessary 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.

Bit Reader

Compressed data stored using binary stream. Bitreader operates with internal 32-bits queue and pops bits starting from the highest. TODO : Add sample

Decompression

General Frame Structure

  • Frame Flags
  • Mask Block
  • Motion Block
  • Fill Block
  • V2 Extra Block
  • Deltas Bundle
    • Initial Position
    • Color Deltas
    • Huffman Tree
    • Packed Deltas Indicies

Frame Flags

Each frame begins with sequence of local flag bits. These bits are:

# of bits Present if Name Description
1 always KeyframeFlag Non-zero if this frame is a key frame (for Still-Frame mode this DOES NOT mean base frame change!)
V2 3 flags bit 9 ColorSpace Colorspace Format for this frame
V2 1 flags bit 9 ... ...
V2 1 flags bit 9 SmoothDeltas Use smooth delta-coding
V2 1 flags bit 9 HaveSerial (see next field)
V2 20 flags bit 9 + HaveSerial SerialNumber Encoder's serial number
V2 1 flags bit 9 ... ...
V2 8 flags bit 10 ... ...
V2 8 flags bit 10 ... ...

Mask Block

Mask block contains changes since the last frame. There are two types of masks - general masks, which tell what rectangular area has changed since last frame, and fill masks, which also specify colour value to fill that rectangle. If bit (buf[1]&2) is set then general masks are present along with fill mask, otherwise only fill masks are present.

Masks bistream:

   12 bits     count of masks with dimensions <= 256x256
   12 bits     count of masks with dimensions <= 16x16
   masks

Mask data is stored as <offset, width, height, [color]>. Offset size = ceil(log2(frame width * frame height)), width and height take 4 or 8 bits depending on mask max dimension, color value is present only for fill masks and takes 15 bits.

Motion Block

Fill Block

Extra Block

Color Deltas Bundle

Assembling the Frame

Games Using Motion Pixels