Log in

View Full Version : YV12 questions


Wilbert
19th February 2004, 10:52
I'd like to ask some dumb questions about YV12. (I was looking at YV12 support for WarpEnterprises' new plugin.)

Suppose you got a 2x2 YV12 pixel (progressive). As I understand it, every pixel has a Y value, and the UV values are shared among the four pixels. Thus:

Y00 Y01
Y10 Y11 (four bytes)

and

U0 (one byte)

and

V0 (one byte)

They are lying separately in the memory. This means that the first four bytes will be: Y00, Y01, Y10, Y11, fifth byte: U0 and sixth byte: V0.

This means 6 bytes for four pixels, and thus "1.5" byte for one pixel.

Is this anywhere near the truth?

sh0dan
19th February 2004, 12:42
Close but no cigar. ;)

Every line in the Y-plane is stored separately. This means that :

Y1Y2Y3Y4 .... (rest of line 1, until pitch is reached)
Y1Y2Y3Y4 .... (rest of line 2, until ...)
Y1Y2Y3Y4 .... (rest of line 3)

U & V are stored the same way. This will enable you to use the same routines on Y, U and V planes - and it will also enable you to use the same routines for different subsamplings - currently AviSynth only supports 4:2:0 subsampling (YV12), though.

The hard thing about planar processing is however when YUV are interdependant, as you need to maintain several pointers.