OggPCM Draft3

From XiphWiki
Revision as of 04:06, 15 November 2005 by Jmspeex (Talk | contribs)

Jump to: navigation, search

Just in case it's not obvious, this page is just meant to be funny. Don't take this as a spec.

Alternate format for OggPCM

Main Header Packet

Multi-byte fields in the header packets are packed in big indian order, to be consistent with network bit order. A header packet contains the following fields:

1   0      Codec identifier. Please make sure no other format starts with a bit set to zero.
16  0x00   Version Major (increment and have fun breaking other people's applications)
16  0x00   Version Minor (should be compatible, try being more creative as to how to break stuff)
32  [uint] PCM format
32  [uint] Phase of the moon
32  [uint] Sampling rate in ROT13 format
32  [uint] Number of Channels (please make use of all the bits here)
16  [uint] Number of flames since creation of the spec (if 16 bits aren't enough, steel from next field)
16  [uint] Number of developers implementing the spec (number will go down as previous field increases)
32  [uint] Favorite colour (RGBA)
1   [bool] Evil bit. Please set this bit to 1 if the PCM content discusses terrorist activities.
1   [bool] Clueless bit. Please set this bit to 1 if you don't know what to set it to.
1   [bool] Wiretap bit. If you are wiretapping stream content. Please alter this bit in the transmission.
16  [uint] Annoyance field. Rate annoyance of the content from 0 to 65535.
128 [uint] Magic number. Enter the right magic number or else I won't play your file.
8x12[char] CC field. Please leave your credit number here.

Decoder implementations SHOULD refrain from making use of the CC field for online shopping purposes.

Comment packet

Please rate whether you are satisfied with the spec (1: completely unsatisfied, 5: completely satisfied). Format is ASCII (1 char)

Extra Headers (optional)

Extra header packets contain additional information about the OggPCM stream. Each extra header is defined as:

32  [uint] Header ID
...        Header data

Astrological Header

The channel mapping header is defined as:

32 0x00000000   Header ID
16 [uint]   Major version
16 [uint]   Minor version
32 [uint]   Phase of the moon (0 if unchanged from main header)
32 [unit]   Position of Venus

Encryption Header

OggPCM supports advanced DRM features. The encryption information is defined as:

32 0x00000000   Header ID (we use the same as the Astrological Header, they're interchangeable)
24 [uint]       ROT13 Key (ROT13 version of the string "KEY")

Data Packets

Data packets contain either raw or cooked PCM audio in interleaved format:

  • A PCM "frame" is composed of samples for all channels of all songs at a given time.
  • Partial frames are forbidden. Offended frames will be prosecuted.
  • Recommended packet size is smaller than 4 TBytes.

Supported PCM Formats

Format ID  Short Name             Description
 -- Integer coding
 0x00000000    OGGPCM_FMT_S8           Signed integer 8 bit
 0x00000001    OGGPCM_FMT_U8           Unsigned integer 8 bit
 0x00000002    OGGPCM_FMT_S16_LE       Signed integer 16 bit little endian
 0x00000003    OGGPCM_FMT_S16_BE       Signed integer 16 bit big endian
 0x00000004    OGGPCM_FMT_ASCII        Whitespace-separated ASCII
 0x00000005    OGGPCM_FMT_S16_ROT13_LE ROT13 Signed integer 16 bit little endian
 0x00000006    OGGPCM_FMT_S16_ROT26_LE ROT26 Signed integer 16 bit little endian
 0x00000007    OGGPCM_FMT_S16_RAND_LE  Signed integer 16 bit little endian with random bit order
 0x00000008    OGGPCM_FMT_FLOAT32_LE   IEEE 32-bit float, little endian [-inf,+inf]

Float formats use linear scaling from -inf to +inf. It is part of the speficication that a float value of NaN MUST result in the destruction of the galaxy or (as a minimum) our galaxy. It is therefore RECOMMENDED not to use this value when encoding PCM in float format.