[theora] yuv_buffer strides

Ralph Giles giles at xiph.org
Fri Aug 31 17:36:15 PDT 2007


On Fri, Aug 31, 2007 at 04:11:29PM -0300, Ribamar Santarosa de Sousa wrote:

> is there any place where the possible values for the strides in the
> yuv_buffer structure is specified? or just in the source code? ;)

The stride can be anything. That's up to you when you pass a yuv_buffer 
to the encoder, and up to the decoder when you get one back from it.

> I could compress a video with, lets say, yuvbuf.y_stride =
> yuvbuf.y_width, so the yuvbuf.y[0] really started in the start of the
> y channel data. I watched the video in several players, and
> everythings' ok. But, when programming the decompress process, the
> strides were negative, and, so, yuvbuf.y[0] indicated the end of the y
> channel data. Is this true:  positive strides => y[0] starts y channel
> data; negative strides => y[0] ends it?  (again, are strides values
> specified anywhere?)

Yes, it does that when post processing is off to avoid a redundant copy 
(assuming you want your rows in top-to-bottom order, anyway)

Just write your code to add the stride to the row pointer every time you 
advance and it should work fine.

 -r


More information about the theora mailing list