[ogg-dev] OggPCM2 : chunked vs interleaved data

John Koleszar jkoleszar at on2.com
Tue Nov 15 06:30:46 PST 2005

Michael Smith wrote:

>Whilst I accept that there are many good uses for chunked data, I
>think the transformation is trivial, particularly given certain
>characteristics of the Ogg container. Remember, the data, if you read
>an ogg stream into memory, is _already_ likely to be non-contiguous,
>due to ogg's structure. It's trivial, and has insignificant additional
>overhead, to de-interleave as you read it into a packet buffer.
Could you elaborate on this? I'm not familiar enough with the ogg API, 
but as far as I can tell, the way you'd do this would be to get the 
whole interleaved packet out with ogg_stream_packetout and then walk 
through it to de-interleave it into another buffer (or in place, I suppose).

My feeling is that if you're working with files, the time it takes to 
interleave/deinterleave is probably negligible with respect to the i/o 
time, but if you're working with pipes or some other low latency 
transport, it's more significant. I proposed it because it didn't seem 
like it was a big deal to store it either way and frequently use both in 
the video world, but I defer to others as to whether it makes sense 
here. Out of curiosity, do more people object because there isn't a 
clean way to specify that the data is non-interleaved, or is it just 
that the data's harder to use because you could potentially have to 
interleave it? The latter issue seems to me like it should be taken care 
of by a good library API to me and that it shouldn't matter to most 

To clarify, I'm okay with sticking to interleaved, this just seemed like 
low hanging fruit that could be useful to somebody, the gstreamer and 
JACK folks in particular.


More information about the ogg-dev mailing list