M95: Difference between revisions

From MultimediaWiki
Jump to navigation Jump to search
(intro edits)
(→‎File Stucture: clean up)
Line 5: Line 5:


== 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):
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


dword frame_offset[14] - offset of the particular frame
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.
dword unk_offset_1    - points to something after palette, useless (?)
dword unknown
dword sound_offset    - offset of the sound portion
dword unknown[3]
dword palette_offset  - offset of the palette
dword unk_offset_2    -
dword unk_offset_3    - both fields, when non-zero, also offsets of something
 
* Sound stored as a complete WAV file.
* Palette begins with a byte, indicates (in-block) frame number it belongs to, and followed by 256 BGR triplets.


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

Revision as of 22:09, 13 July 2006

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 2 bytes value from the stream. If it's non-zero, perform extra dictionary unpacking, located at offset (frame + value). Then continue frame decoding. Dictionary contains variable number of 8x8 blocks packed using simple LZ-like algorithm. To decompress:

repeat
  read 16-bits 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 compression methods:

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

  • 3

Copy 8x8 block from the previous frame.

  • 4

Paint next 8x8 pixels from the dictionary.

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

  • C

Same as 9, but for 4x4 subblocks.