Motion Pixels: Difference between revisions

From MultimediaWiki
Jump to navigation Jump to search
m (let's start it slowly...)
m (frame flags)
Line 23: Line 23:
=== Compression Flags ===
=== 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 flags are:
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:


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




Line 46: Line 44:
* 3 - YUV 8:1:1
* 3 - YUV 8:1:1
* 4 - YUV 16:1:1
* 4 - YUV 16:1:1


=== Normal mode VS Still-Frame mode ===
=== 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.
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.


=== Decompression ===
=== Decompression ===
==== 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 below)
'''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  ...          ...


==== Starting Pixels ====
==== Starting Pixels ====
==== Color Deltas Bundle ====
==== Color Deltas Bundle ====
==== Assembling the Frame ====
==== Assembling the Frame ====

Revision as of 15:55, 11 March 2007

Introduction

Motion Pixels version 1 (MVI1) was used in a single PC game, 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.

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.


Decompression

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 below)
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  ...           ...

Starting Pixels

Color Deltas Bundle

Assembling the Frame

TO DO