[theora-dev] Legalese. What is stride?

Dan Miller dan at on2.com
Mon Jul 7 16:00:44 PDT 2003



good questions.

1) legalese.  I'll let someone else post a definitive answer, but the only real requirement of our license is that you give proper credit.  Check out the license stuff at xiph.org.

<p>2) Stride (Also sometimes called pitch) is the number of bytes (or pixels, same in most YUV cases) between one horizontal line of pixels and the next.  This number *might* be equal to width -- in the simplest case, that would be so.  However there are often times when it is convenient or necessary to have stride > width.  An example would be when your destination memory represents physical video memory of some sort (direct screen memory or, more often these days, an 'overlay').  Say your destination memory is 512 x 512 bytes, but your image is only 320 x 240.  Height is no problem (just compute an offset into the destination memory), but width cannot equal stride or the image will look like a scrambled strip of pixels.  In this case, width=320 and stride=512.

This is why many video API's include stride as a separate parameter -- it often reduces the need for intermediate buffers and extra copy routines.

3) aspect ratio -- that's an important issue.  My assumption is that we mean the aspect ratio of the pixels as opposed to the actual frame, but this should definitely be clarified.

 ___  Dan Miller
(++,) Founder, On2 Technologies 

> -----Original Message-----
> From: Philip Jägenstedt [mailto:philipj at telia.com]
> Sent: Monday, July 07, 2003 6:47 PM
> To: theora-dev at xiph.org
> Subject: [theora-dev] Legalese. What is stride?
> 
> 
> Hello all.
> 
> I've been playing around with theora since it first entered CVS, and I
> like what I'm seeing. Today I've been fixing xine's theoraplugin to
> understand theora_info.frame_{width,height} and
> theora_info.offset_{x,y}. I only got it working after some 
> experimenting
> and basically copying the code from player_example. A few questions
> related to this:
> 
> 1. What are the legal requirement in regard to copying code from your
> BSD-style license to xine, which is under the GPL. It would seem that
> the original author made no mention that he had used code from
> player_example (which it is obvious he had), so I'd like for 
> everything
> to be in order. Is it enough if there is a comment beside the relevant
> code, or perhaps in the header section of the source file?
> 
> 2. Getting said plugin to work was basically possible only because I'm
> good at using emacs copying functions, using your code for
> clipping+offset. I couldn't really understand why it worked, because
> there was one relevant concept which I simply can't understand --
> stride. There's y_stride and uv_stride. Everything works now, but I'd
> rather understand _why_ it works, so if someone could explain what
> stride is (from a little googling it seems to be a concept 
> which exists
> in most YUV codecs), I'd be very greatful.
> 
> Other stuff: I was talking to meu on #theora about the aspect 
> values. I
> wanted to add support to encoder_example to set these values, and he
> voluntered to do it for me (because I could easily make a mess of it).
> We agreed that the two values probably indicated pixel ratio, not the
> aspect ratio for the whole image, but it doesn't appear to be clearly
> defined in any docs yet that this is the case. Hence, I file a RFD
> (request for documentation) in the general direction of the theora
> developers, to include this in the spec. When it's clearly 
> defined what
> they are supposed to do, I will attempt to add support for it to the
> xine plugin.
> 
> That is all, thank you for doing cool stuff.
>   // Philip Jägenstedt
> --- >8 ----
> List archives:  http://www.xiph.org/archives/
> Ogg project homepage: http://www.xiph.org/ogg/
> To unsubscribe from this list, send a message to 
> 'theora-dev-request at xiph.org'
> containing only the word 'unsubscribe' in the body.  No 
> subject is needed.
> Unsubscribe messages sent to the list will be ignored/filtered.
> 
--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'theora-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Theora-dev mailing list