Factor 5 VID1

From MultimediaWiki
Jump to navigation Jump to search

This is a format used in at least one Gamecube game. VID1 format is not merely a container format but a proprietary video codec used in that container as well.

Container format

This a typical chunked format starting with "VID1" header chunk, "HEAD" chunk containing stream headers, and "FRAM" chunks containing both video ("VIDD") and audio ("AUDD") data.

Audio codecs include PCM, variations of IMA ADPCM, or Vorbis.

Video codec

VID1 video codec is a modification of MPEG-4 ASP.

Picture header:

  • 16 bits -- ignored (sync marker?)
  • 2 bits -- frame type (0 - I, 1 - P, 2 - B, 3 - S)
  • 1 bit -- extended information present
  • (extended information if present)
  • 1 bit -- rounding control
  • 3 bits -- DC quantiser threshold index (intra_dc_vlc_thr)
  • 5 bits -- quantiser
  • (non-I frames) 3 bits -- vop_fcode_forward
  • (B-frame only) 3 bits -- vop_fcode_backward
  • 32 bits -- timecode
  • (S-frame only) GMC/sprite information
  • alignment to byte boundary

Extended information:

  • 1 bit -- sprite information is present
  • (if sprite information is present) 2 bits -- number of sprites?
  • (if sprite information is present) 2 bits -- sprite MV resolution?
  • 1 bit -- extended quantisation
  • (if extended quantisation) 1 bit -- luma qmat present
  • (if extended quantisation and luma qmat present) 8x8 bits -- luma qmat
  • (if extended quantisation) 1 bit -- chroma qmat present
  • (if extended quantisation and chroma qmat present) 8x8 bits -- chroma qmat
  • 1 bit -- ignored
  • 1 bit -- ignored

I-frames consists of macroblocks with the following layout:

  • standard I MCBPC
  • 1 bit -- AC prediction enabled
  • I CBPY
  • (if dquant is signalled) 2 bits -- dquant
  • block data (likely just like ISO 14496-2 defines it)

P-frame macroblock layout:

  • 1 bit -- skip flag (if set, no further information is transmitted for the MB)
  • standard P MCBPC
  • (for I-type MBs decoding is the same as in I-frames)
  • 1 bit -- mcsel?
  • P CBPY
  • (for MB type 1 only) 2 bits -- dquant
  • 1 or 4 motion vectors (with residual, just like ISO 14496-2)
  • block data

B-frame macroblock layout:

  • 1 bit -- skip flag (if set, no further information is transmitted for the MB)
  • 1 bit -- coded MB
  • 1-4 bits -- macroblock type (as in table B-4 of ISO 14496-2)
  • (if MB is coded) 6 bits -- CBP
  • (if not direct MB and CBP is non-zero) 1-2 bits -- dbquant
  • (if applicable) forward/backward MV
  • block data

Motion compensation is normal halfpel.