[Theora] problems understanding yuv_buffer format

Michael Smith msmith at xiph.org
Wed Sep 28 07:43:51 PDT 2005


> this would mean the pixels are not in a perfect row (like expected from
> e.g. a raw RGB buffer). so i need to find out how they are positioned.
> can i at least assume that a straight line of pixels (euqaling a stride,
> so exactly the frames width) is always non-interrupted, so i can take it
> the way it is without modifying?

Each row is indeed contiguous in memory, with buffer->y_width pixels
in each row. Note that this (the frame width) is NOT equal to the
stride. The stride gives you the offset between each row.

Additionally, note that the actual picture is, in the general case, a
subset of this total size. You need to look at theora_info->offset_x
and offset_y, and frame_width and frame_height (this is so that you
can specify an arbitrary size, even though the format requires that
the dimensions be a multiple of 16.

Mike


More information about the Theora mailing list