[xiph-rtp] Updated Vorbis and new Theora I-D's

Ralph Giles giles at xiph.org
Thu Feb 3 15:43:51 PST 2005


On Thu, Feb 03, 2005 at 02:03:18PM +0000, Phil Kerr wrote:

> Do you mean that it isn't clear that each Vorbis payload needs a VDT 
> octet?  There is only one VDT per packet, but after working on the 
> Theora I-D (which uses an 8 bit field) it became clear that it is 
> possible to have a VDT for each payload packet.  What do other think, 
> stick with only allowing one payload type per packet or allow mixed?  
> There will be complications for fragmented packets though of the mixed 
> route is taken.

As with theora, you can determine the packet type by checking bits in 
the initial octet of the payload data. I think just documenting this 
in the RTP mapping is sufficient for packet sorting purposes and removes 
the confusion over whether this flag is duplicated in the VDT field or 
trimmed from the packet data.

For vorbis:

  (first octet) & 0x01 = 0 : Vorbis Audio payload, else
                       = 1 : Vorbis header payload

  (first octet) & 0x07 = 1 : Vorbis Info header payload
                       = 3 : Vorbis Metadata payload
                       = 5 : Vorbis Setup/Codebook payload

Not having a separate VDT field mean you don't know the packet type
on the continuation of fragmented packets, but if you don't have the
start of those they're not helpful anyway. But you do have to check
that you don't have a continued payload packet before checking the type.

For theora:

  (first octet) & 0x80 = 0    : Theora Video payload, else
		       = 0x80 : Theora header payload

  for video data (if the MSb is not set):
  (first octet) & 0x40 = 1 : keyframe
                       = 0 : difference frame

  for headers (if the MSb is set):
  (first octet) & 0x03 = 0 : Theora Info payload
                       = 1 : Theora Metadata payload
                       = 2 : Theora Setup/Codebook payload

The difference between the two codecs has to do with their differing 
native endianness.

  -r


More information about the xiph-rtp mailing list