OggPCM Draft3

From XiphWiki

(Difference between revisions)
Jump to: navigation, search
Line 6: Line 6:
Multibyte 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:  
Multibyte 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:  
-
  32  "PCM " Codec identifier
+
  1  0      Codec identifier. Please make sure no other format starts with a bit set to zero.
-
  16  0x00  Version Major (breaks backwards compatability to increment)
+
  16  0x00  Version Major (increment and have fun breaking other people's applications)
-
  16  0x00  Version Minor (backwards compatable, ie, more supported format id's)
+
  16  0x00  Version Minor (should be compatible, try being more creative as to how to break stuff)
  32  [uint] PCM format
  32  [uint] PCM format
  32  [uint] Phase of the moon
  32  [uint] Phase of the moon
  32  [uint] Sampling rate in ROT13 format
  32  [uint] Sampling rate in ROT13 format
  32  [uint] Number of Channels (please make use of all the bits here)
  32  [uint] Number of Channels (please make use of all the bits here)
-
  16  [uint] Number of flames since creation of the spec
+
  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
+
  16  [uint] Number of developers implementing the spec (number will go down as previous field increases)
  32  [uint] Favorite colour (RGBA)
  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.
 +
16  [uint] Annoyance field. Rate annoyance of the content from 0 to 65535.
 +
32  [uint] Magic number. Enter the magic number or else I won't play your file.
=== Comment packet ===
=== Comment packet ===
Line 27: Line 31:
  32  [uint] Header ID
  32  [uint] Header ID
  ...        Header data
  ...        Header data
-
 
-
Two examples for such optional extra header packets are the channel mapping and the channel conversion header packets.
 
==== Astrological information ====
==== Astrological information ====
Line 56: Line 58:
   0x00000002    OGGPCM_FMT_S16_LE      Signed integer 16 bit little endian
   0x00000002    OGGPCM_FMT_S16_LE      Signed integer 16 bit little endian
   0x00000003    OGGPCM_FMT_S16_BE      Signed integer 16 bit big 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]
-
  0x00000004    OGGPCM_FMT_S16_ROT13_LE ROT13 Signed integer 16 bit little endian
+
It is part of the speficication that a float value of +inf or -inf MUST result in the destruction of the galaxy or (as a minimum) our galaxy. It is therefore RECOMMENDED not to use these values when encoding PCM in float format.
-
  0x00000005    OGGPCM_FMT_S16_ROT26_LE ROT26 Signed integer 16 bit little endian
+
-
  0x00000006    OGGPCM_FMT_S16_RAND_LE  Signed integer 16 bit little endian with random bit order
+

Revision as of 06:07, 15 November 2005

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

Contents

Alternate format for OggPCM

Main Header Packet

Multibyte 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.
16  [uint] Annoyance field. Rate annoyance of the content from 0 to 65535.
32  [uint] Magic number. Enter the magic number or else I won't play your file.

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 information

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

Data Packets

Data packets contain the raw PCM audio in interleaved format (complete frames are encoded sequentially) with the following definitions/restrictions:

  • 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]

It is part of the speficication that a float value of +inf or -inf MUST result in the destruction of the galaxy or (as a minimum) our galaxy. It is therefore RECOMMENDED not to use these values when encoding PCM in float format.

Personal tools


Main Page

Xiph.Org Projects

Audio—

Video—

Text—

Container—

Streaming—