Re: ogg segmentation
[email protected] Sun, 17 Aug 2014 15:42:40 -0700
| Newsgroups | gmane.comp.multimedia.ogg.vorbis.devel |
|---|---|
| Message-ID | <CACrD=+9Bh66SsM+8e8CZcvDP_F+-uN+oTSmxhgGCbGdVq0s8Gg@mail.gmail.com> |
I'll try to be a bit more complete describing the structure of Ogg's interleave and segmentation, and why it's constructed that way. I think you've gotten a bit confused by the lacing-value encoding using runs of 255; that's not segmentation, it's the way packet length is encoded. An Ogg stream is divided into and interleaved in units of pages. It's designed as a streaming format with a guaranteed stream capture within 64kB. Start reading anywhere in the stream, and you know that if it's Ogg, you'll find, sync to and be able to navigate the stream structure after seeing at most 64kB go past. In most practical streams, that bound is actually set lower (4kB or so) to reduce capture latency and buffering requirements. Ogg pages consist of a header that provides a capture pattern, checksum, stream metadata, and then encoded lengths of the packets (the payloads) in that page. There may be no packets at all, there may be zero length packets, multiple packets, or even fractional packets. If you consider some packets may be larger than the maximum size of an Ogg page, you can see that sometimes a packet will need to be split across multiple pages. Ogg does not restrict the allowed sizes of packets (the payloads) it carries. In streams with lots of very small, variable-sized packets (eg, low-bitrate audio where packets are typically 50-200 bytes or so), the packet length encoding can be a significant portion of the stream overhead. Ogg uses a near-constant-overhead encoding where packet length is encoded in a single byte with '255' indicating the size is >=255 bytes, and the next byte is a continuation of the length encoding. This process repeats until the value is < 255. If the last byte is 255, then the packet is continued on the next page. This encoding has constant overhead of about half a percent regardless of packet size. Monty On Wed, Aug 13, 2014 at 9:37 PM, Ajinkya Deshmukh <[email protected]> wrote: > Hi Ralph, > I am sorry, posted wrong question. > Could you please elaborate the answer of "What is the need of segmentation?" > I am not able to understand how segmentation helps in interleaving and > packing. > > > On Thu, Aug 14, 2014 at 10:02 AM, Ajinkya Deshmukh > <[email protected]> wrote: >> >> Hi Ralph, >> Could you please elaborate the answer of "why"? I am not able to >> understand how does segmentation help in interleaving and packing. >> >> >> >> >> -- >> Thanks & Regards, >> Ajinkya Deshmukh. > > > > > -- > Thanks & Regards, > Ajinkya Deshmukh. > > _______________________________________________ > Vorbis-dev mailing list > [email protected] > http://lists.xiph.org/mailman/listinfo/vorbis-dev >