Difference between revisions of "AVF"

From MultimediaWiki
Jump to navigation Jump to search
 
(→‎Frame compression: add a fact about LZSS data obfuscation)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
* Company: [[Her Interactive]]
* Company: [[Her Interactive]]
* Extension: AVF
* Extension: AVF
* Samples: [http://www.mplayerhq.hu/MPlayer/samples/game-formats/avf/ http://www.mplayerhq.hu/MPlayer/samples/game-formats/avf/]
* Samples: [http://samples.mplayerhq.hu/game-formats/avf/ http://samples.mplayerhq.hu/game-formats/avf/]


AVF is suspected to be a multimedia format used in the game [http://www.mobygames.com/game/windows/nancy-drew-stay-tuned-for-danger Nancy Drew: Stay Tuned For Danger]. It may be used in other games in the ''Nancy Drew'' series.
AVF is a multimedia format used in the games like [https://www.mobygames.com/game/windows/vampire-diaries The Vampire Diaries] (old 8-bit format) and  [http://www.mobygames.com/game/windows/nancy-drew-stay-tuned-for-danger Nancy Drew: Stay Tuned For Danger] (new 15-bit format). It may be used in other games in the ''Nancy Drew'' series.
 
=== Header ===
 
Old format:
  3 bytes - "ALG"
  7 bytes - unknown
  2 bytes - major version
  2 bytes - minor version
 
New format:
  15 bytes - "AVF WayneSikes"
  2 bytes  - major version
  2 bytes  - minor version
  1 byte  - unknown
 
Known versions are 1.0 and 2.0.
 
Common header:
  2 bytes - number of frames
  2 bytes - width
  2 bytes - height
  1 byte  - depth (8 for old format, 16 for new format)
  4 bytes - frame time
  1 byte  - compression (should be 2; compression 0 is for unpacked data)
  1 byte (version 1.0 only) - unknown
 
Old format uses 8-bit format with an external palette, new format uses RGB555 video. Additionally old format is stored bottom-up while new format is top to bottom.
 
=== Table of contents entries format ===
Table of contents entry for version 1.0:
  9 bytes - name
  4 bytes - index
  4 bytes - unknown
  4 bytes - offset
  4 bytes - compressed size
 
Table of contents entry for version 2.0:
  2 bytes - index
  4 bytes - offset
  4 bytes - compressed size
  4 bytes - uncompressed size
  1 byte  - type
  4 bytes - unknown
 
=== Frame compression ===
Compression type 2 means that frame data is first compressed with LZSS scheme that groups flags into bytes and has spaces as the window fill value. Also it uses rolling obfuscation scheme by subtracting byte index (truncated to low 8 bits of course) from its value.
 
Type 0 is raw data (old format frames are always raw data). Types 1 and 2 employ additional RLE-based compression (or can be empty frames).
 
The compression method works by issuing one-byte commands for skipping or writing 16-bit pixels:
* 0x20 - read 32-bit <code>skip</code> value and 32-bit <code>length</code> value, skip <code>skip</code> pixels and read <code>length</code> new 16-bit pixels
* 0x40 - read a pixel (2 bytes), 32-bit <code>skip</code> value and 32-bit <code>length</code> value, skip <code>skip</code> pixels and output new pixel <code>length</code> times
* 0x80 - read 8-bit <code>length</code> value, read 32-bit number of skip+put operations, read <code>length</code> new pixels into buffer, and then for the number of skip+put operations read 32-bit <code>skip</code> value, skip <code>skip</code> pixels and output <code>length</code> pixels from the buffer


[[Category:Game Formats]]
[[Category:Game Formats]]

Latest revision as of 08:48, 21 July 2021

AVF is a multimedia format used in the games like The Vampire Diaries (old 8-bit format) and Nancy Drew: Stay Tuned For Danger (new 15-bit format). It may be used in other games in the Nancy Drew series.

Header

Old format:

 3 bytes - "ALG"
 7 bytes - unknown
 2 bytes - major version
 2 bytes - minor version

New format:

 15 bytes - "AVF WayneSikes"
 2 bytes  - major version
 2 bytes  - minor version
 1 byte   - unknown

Known versions are 1.0 and 2.0.

Common header:

 2 bytes - number of frames
 2 bytes - width
 2 bytes - height
 1 byte  - depth (8 for old format, 16 for new format)
 4 bytes - frame time
 1 byte  - compression (should be 2; compression 0 is for unpacked data)
 1 byte (version 1.0 only) - unknown

Old format uses 8-bit format with an external palette, new format uses RGB555 video. Additionally old format is stored bottom-up while new format is top to bottom.

Table of contents entries format

Table of contents entry for version 1.0:

 9 bytes - name
 4 bytes - index
 4 bytes - unknown
 4 bytes - offset
 4 bytes - compressed size

Table of contents entry for version 2.0:

 2 bytes - index
 4 bytes - offset
 4 bytes - compressed size
 4 bytes - uncompressed size
 1 byte  - type
 4 bytes - unknown

Frame compression

Compression type 2 means that frame data is first compressed with LZSS scheme that groups flags into bytes and has spaces as the window fill value. Also it uses rolling obfuscation scheme by subtracting byte index (truncated to low 8 bits of course) from its value.

Type 0 is raw data (old format frames are always raw data). Types 1 and 2 employ additional RLE-based compression (or can be empty frames).

The compression method works by issuing one-byte commands for skipping or writing 16-bit pixels:

  • 0x20 - read 32-bit skip value and 32-bit length value, skip skip pixels and read length new 16-bit pixels
  • 0x40 - read a pixel (2 bytes), 32-bit skip value and 32-bit length value, skip skip pixels and output new pixel length times
  • 0x80 - read 8-bit length value, read 32-bit number of skip+put operations, read length new pixels into buffer, and then for the number of skip+put operations read 32-bit skip value, skip skip pixels and output length pixels from the buffer