On Thu, Jun 30, 2005 at 02:27:11PM +0300, wrote:
> On Thu, Jun 30, 2005 at 09:00:49AM +0200, Luc Saillard wrote:
> > get the pointer to U, you add the size of the image (640*480), to get the
> > pointer to V, you add the size of the image(640x480) and size of the
> > image/2.
> > pout_planar_v = dst + n + n / 4;
>
> Why there is "n/4" there, if you also say "to get the pointer to V, you
> add the size of the image (x+y) and size of the image/2".
> Shouldn't it then be:
> pout_planar_v = dst + n + n /2;
> /* or rather optimized */
> pout_planar_v = dst + 3 * n / 2;
Got it.
< http://en.wikipedia.org/wiki/Chroma_subsampling#4:2:0 >
So the "n/4" is the correct. Both Y and V channels are only a quarter of the
image resolution. For every 2 luminance (Y) pixels there is only one U
value horizontally BUT ALSO vertically making the amount "1/4" of W*H in
2D plane.
=> pout_planar_v = dst + 5 * n / 4;
// jouni
_______________________________________________
pwc mailing list
http://lists.saillard.org/mailman/listinfo/pwc
|