Total Multimedia PH

From MultimediaWiki
Jump to navigation Jump to search
  • Company: Total Multimedia Inc.
  • Extension: .ph

This is a video format used in certain interactive video CDs.

The file is split into larger chunks with 16-byte header starting with PH and followed by 32-bit previous chunk size, current chunk size, 16-bit following chunk size, some 16-bit number and 16-bit number of sub-chunks in the chunk.

Sub-chunks start with 16-bit sub-chunk ID and 16-bit size. Known types are:

  • 0x1010—always 12 bytes, probably frame timestamp and duration information;
  • 0xA016, 0xA024, 0xA032, 0xA044, 0xA0A8, 0xA116, 0xA124, 0xA132, 0xA144, 0xA1A8—raw U8 PCM data (0 means mono, 1—stereo, last two hex digits mark sampling frequency—16, 24, 32, 44 or 8 kHz);
  • 0xB0B0—probably some marker;
  • 0xB0B2—VGA palette (first byte meaning is unknown, second one is the number of colours to load at the end of palette, e.g. 0x70 means 112 new colours starting from colour 144);
  • 0xB0B3—some marker, always empty;
  • 0xC0C1—unknown video frame;
  • 0xC0C2—RLE-packed video frame;
  • 0xC0C3—RLE-packed video frame.

Chunk 0xC0C2 starts with four 16-bit values (zero, width, height, another zero) followed by RLE data.

RLE data is packed transmitting pairs of colours. Each colour should have its high bit set, clear high bit signals it is a run value (which should have its high bit set before output) with run length minus one stored in a nibble. Run length nibbles are stored in a single byte (the second nibble is saved for whenever the another run occurs).