On Thu, Jun 30, 2005 at 09:00:49AM +0200, Luc Saillard wrote:
> No the format is the YUV420 Planar mode. So you have all Y value, then all U
> value then all V value. To get pointer to Y, it's the begin of the buffer, to
> 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.
> Because U and V is coded with half bit than Y.
> I don't know if i'm clear, but here a little code to show how to calculate
> offset
>
> n = width * height;
>
> /* offset in Y plane */
> pout_planar_y = dst;
>
> /* offsets in U/V planes */
> pout_planar_u = dst + n;
> 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;
(or am I still abit at sleep due waking just up)
// jouni
_______________________________________________
pwc mailing list
http://lists.saillard.org/mailman/listinfo/pwc
|