[theora] Aspect ratio question

Philip Jägenstedt philipj at telia.com
Wed Jul 23 14:34:52 PDT 2003


DISCLAIMER: I'm not a theora developer or anything, but happen to have
tinkered with aspect ratio in another player -- xine.

On 23 Jul 2003 21:21:17 +0200
Markus Meyer <meyer at mesw.de> wrote:

> (1) width/height
> (2) offset x/y and frame width/frame height
> (3) aspect ratio numerator / denominator
> Can you enlighten me on how (1) and (2) fit together? I see that
> width/height isn't used at all by splayer at the moment. What should it
> do in a complete implementation?

(1) Is the encoded width/height, both will always be a multiple of 16.
Since it's nice sometimes to have video of other sizes, (2) frame_width
and frame_height are the "real" width/height and offset_{x,y} give the
offset into the encoded frame. Currently what the encoder does is to
simply pad the video with black borders to a a 16x16-ish size. A player
should do cropping do the frame_width/frame_height, so there's nothing
wrong in the player not apparently using width/height.

> Also, concerning (3), one can encode files at the moment where one of
> the numerator and the denominator is zero. Does this case have any
> special semantics or is it just so that either both must be zero or both
> must have a positive value?

This should probably be fixed. My suggestion to anyone who's listening
is that if the aspect is read from yuv4mpeg file that if either value is
zero, 1:1 should be used. If the user puts a 0 on the command line,
refuse to encode.

One important thing to realize is that aspect here is pixel aspect, not
frame aspect. So if you have 320x480 video which you want to show at 4:3
(640x480), you'll use aspect 2:1, not 4:3. This is generally cool, but
may cause some confusion.

I've implemented aspect scaling in xines theora plugin, and those
changes should be commited to xine CVS after xine rc1 is released (there
were alot of other changes which may or may not have introduced subtle
bugs -- unsuitable to introduce just before rc1). After rc1, you can
have a look at xine, which I now use to play with theora with aspect
scaling :)

// 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-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 mailing list