ETV

From MultimediaWiki
Jump to navigation Jump to search

ETV is a multimedia format found on the computer game Disney's Hercules. It is suspected to be from eTreppid Technologies.

Video compression heavily relies on RNC ProPack compression. Random noise filter is used as a part of decoding process. Apparently, movies can be only up to 200 seconds long.

File Format

File begins with a header, followed by frame blobs. All numbers are little-endian.

s8     signature[4]      -- "ETV\x0A"
s32    width
s32    height
s32    frames
s32    framerate
s32    soundchannels
s32    soundrate
s32    soundbits
s32    unknown1
s32    unknown2
s32    seconds[200]      -- size of one-second frame blob

Frames grouped in one-second blobs (so, up to framerate frames per blob.) Each blob begins with one-second audio data (soundrate * soundchannels * soundbits / 8) bytes total. Then followed by framerate (or less, for the last second) video chunks.

Video chunk format:

s32    chunksize         -- including this field
s8     new_palette       -- new palette flag
-- if new_palette
 RGB   palette[256]      -- new movie palette
 s8    noise[256*256/8]  -- used to set up noise filter
--
s32    len               -- may be inconsistent with chunksize
s8     videodata[len]    -- RNC-packed

Video Decompression

Video decompression operates on already RNC-unpacked videodata. Each frame is encoded using 4x4 blocks. Encoded stream starts with block type tags array. Each tag has 2 bits, first tag in bits 1-0 of byte, then 3-2 and so on. Remainder carries actual pixel values.

For each block:

 if tag is 0: Draw block using next 4x4 bytes of video data.
 if tag is 2: Fill block using next byte of video data.
 otherwise  : Left block unchanged.


Noise Filter

TODO Not really neccessary, works fine without it anyway. Applied only to tag-2 blocks.