[ogg-dev] OggPCM format description, rev 3

jkoleszar at on2.com jkoleszar at on2.com
Sun Nov 13 15:13:30 PST 2005


Hi all,

I updated the wiki with another rev of this format. Updates include
support for 43 formats in 14 coding schemes, as derived from the ALSA API.
This seemed like a good way to get a list of what the formats in common
use out there are, so it should be fairly comprehensive.

Modifications to the "rev 2" format:
1. Expanded the 'id' field to support more than 7 formats. Format id is
now 16 bits, but the lower 6 bits are reserved to describe the storage
packing.

2. Removed the ID word on the data packets and added a "number of
comments" field to the header packet. This was done to preserve the
alignment of the data payload.

3. Changed the byte ordering in the header packet to be big endian, to be
consistent with network byte order.

New since "rev 2":
1. Added the notion of chunked vs interleaved storage.

For discussion:
1. How useful is the 6 reserved bits in the format id? I'm a little
uncomfortable with it, since it's only 70% (45/64) efficient, and I can't
think of anything really useful to do with the data, but maybe someone
else can. On the other hand, support for 1024 different coding types in
the upper 10 bits seems sufficient to me, and you could in theory create a
flag in a later minor rev to use some of the reserved space in the flags
field as extra bits for the coding type, so it may not be too bad to keep
it.

2. Does supporting both chunked and interleaved storage place too much of
a burden on the applications? There are definite performance related
advantages to storing data in a chunked format for some operations.

3. Does Ogg support zero length data packets? This was something I added
as an afterthought, to support the case where an application might not
know that the packet it just stuffed into the stream was actually the last
packet, so I thought it might be useful to be able to store a zero length
data packet with the EOS flag set that an application could use to
finalize the stream.

Anyway, have at it, and thanks in advance for the feedback.

Cheers,

John




More information about the ogg-dev mailing list