M95: Difference between revisions

From MultimediaWiki
Jump to navigation Jump to search
(fill in)
 
(Add to Formats missing in FFmpeg category.)
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
Quite predictable, Cyberia 2 comes with a bit extended movies, now stored within m95 files. While all existing codecs remains unchanged, several new were added and frames layout revised. Please refer to the original [[C93]] description, as this document covers only changes between m95-c93.
* Extension: m95
* Samples: http://samples.mplayerhq.hu/game-formats/cyberia2-m95/
 
M95 files are [[FMV]] files used in the game [http://www.mobygames.com/game/cyberia-2-resurrection Cyberia 2: Resurrection]. Quite predictably, M95 files are an extension of the [[C93]] FMV files found on the predecessor game, [http://www.mobygames.com/game/dos/cyberia Cyberia]. M95 files can use all of the coding modes present in C93 and adds several new modes. The frame layout is also revised. Please refer to the original [[C93]] description for more details on that original format, as this page covers only changes between C93 and M95.


== File Stucture ==
== File Stucture ==
Multi-byte numbers are little endian. The contents table remains the same as in C93, but holds 1024 records vs. 512.


* Contents table remain the same, but holds 1024 records now.
The frame descriptor, however, is greatly changed (all offsets are relative to the block):
 
* Frame descriptor, however, greatly changed (all offsets are relative to the block):


  dword frame_offset[14] - offset of the particular frame
  4 bytes  frame_offset[14] - offset of the particular frame
  dword unk_offset_1    - points to something after palette, useless (?)
  4 bytes  unk_offset_1    - points to something after palette, useless (?)
  dword unknown
  4 bytes  unknown
  dword sound_offset    - offset of the sound portion
  4 bytes  sound_offset    - offset of the sound portion
  dword unknown[3]
  12 bytes  unknown
  dword palette_offset  - offset of the palette
  4 bytes  palette_offset  - offset of the palette
  dword unk_offset_2    -  
  4 bytes  unk_offset_2    -  
  dword unk_offset_3    - both fields, when non-zero, also offsets of something
  4 bytes  unk_offset_3    - both fields, when non-zero, also offsets of something


* Sound stored as a complete WAV file.
Sound is stored as a complete [[WAV]] file. The palette begins with a byte indicating which (in-block) frame number it belongs to, and is followed by 256 BGR triplets.
* Palette begins with a byte, indicates (in-block) frame number it belongs to, and followed by 256 BGR triplets.


== Video Compression ==
== Video Compression ==


Before proceeding to the decoding, read 2 bytes value from the stream. If it's non-zero, perform extra dictionary unpacking, located at offset (frame + value). Then continue frame decoding.
Before proceeding to the decoding, read a 2-byte value from the stream. If it is non-zero, perform extra dictionary unpacking, located at offset (frame + value). Then continue frame decoding. The dictionary contains a variable number of 8x8 blocks packed using a simple [[LZ]]-like algorithm. To decompress:
Dictionary contains variable number of 8x8 blocks packed using simple LZ-like algorithm. To decompress:


  repeat
  repeat
   read 16-bits tag value
   read 16-bit tag value
   for each bit of tag (low to high)
   for each bit of tag (low to high)
     if bit is set
     if bit is set
Line 37: Line 37:
         output count bytes located at output - offset
         output count bytes located at output - offset


New compression methods:
New video compression modes, in addition to the methods supported in C93:
* 1
 
Read 8 color bytes from the stream. Paint pixels by reading 3 bits from the stream and selecting one of 8 colors by these bits.
=== Mode 1 ===
Read 8 color bytes from the stream. Paint pixels by reading 3 bits from the stream and selecting one of 8 colors as indexed by these bits.


* 3
=== Mode 3 ===
Copy 8x8 block from the previous frame.
Copy 8x8 block from the previous frame.


* 4
=== Mode 4 ===
Paint next 8x8 pixels from the dictionary.
Paint next 8x8 pixels from the dictionary.


* 9
=== Mode 9 ===
Motion block. For each of 2x2 subblock read 4 bits of x delta, then 4 bits of y delta. If bit 3 of delta is set, then delta = delta - 16. Copy block from the previous frame shifted by that delta relatively current position.
Motion block. For each 2x2 subblock read 4 bits of x delta, then 4 bits of y delta. The deltas are 4-bit 2s complement signed quantities; if bit 3 of delta is set, then delta = delta - 16. Copy subblock from the previous frame shifted by that delta relatively current position.
 
=== Mode C ===
Same as mode 9, but operating 4x4 subblocks.


* C
[[Category:Video Codecs]]
Same as 9, but for 4x4 subblocks.
[[Category:Game Formats]]
[[Category:Formats missing in FFmpeg]]

Latest revision as of 06:38, 13 November 2007

M95 files are FMV files used in the game Cyberia 2: Resurrection. Quite predictably, M95 files are an extension of the C93 FMV files found on the predecessor game, Cyberia. M95 files can use all of the coding modes present in C93 and adds several new modes. The frame layout is also revised. Please refer to the original C93 description for more details on that original format, as this page covers only changes between C93 and M95.

File Stucture

Multi-byte numbers are little endian. The contents table remains the same as in C93, but holds 1024 records vs. 512.

The frame descriptor, however, is greatly changed (all offsets are relative to the block):

4 bytes   frame_offset[14] - offset of the particular frame
4 bytes   unk_offset_1     - points to something after palette, useless (?)
4 bytes   unknown
4 bytes   sound_offset     - offset of the sound portion
12 bytes  unknown
4 bytes   palette_offset   - offset of the palette
4 bytes   unk_offset_2     - 
4 bytes   unk_offset_3     - both fields, when non-zero, also offsets of something

Sound is stored as a complete WAV file. The palette begins with a byte indicating which (in-block) frame number it belongs to, and is followed by 256 BGR triplets.

Video Compression

Before proceeding to the decoding, read a 2-byte value from the stream. If it is non-zero, perform extra dictionary unpacking, located at offset (frame + value). Then continue frame decoding. The dictionary contains a variable number of 8x8 blocks packed using a simple LZ-like algorithm. To decompress:

repeat
  read 16-bit tag value
  for each bit of tag (low to high)
    if bit is set
      output = next byte of the stream
    else
      offset = 10 bits of the stream
      count = next 6 bits of the stream + 3
      if offset is zero
        finish the unpacking
      else
        output count bytes located at output - offset

New video compression modes, in addition to the methods supported in C93:

Mode 1

Read 8 color bytes from the stream. Paint pixels by reading 3 bits from the stream and selecting one of 8 colors as indexed by these bits.

Mode 3

Copy 8x8 block from the previous frame.

Mode 4

Paint next 8x8 pixels from the dictionary.

Mode 9

Motion block. For each 2x2 subblock read 4 bits of x delta, then 4 bits of y delta. The deltas are 4-bit 2s complement signed quantities; if bit 3 of delta is set, then delta = delta - 16. Copy subblock from the previous frame shifted by that delta relatively current position.

Mode C

Same as mode 9, but operating 4x4 subblocks.