How to calculate the video overlay size? (xf86-video-geode & xf86-video-ati)

Cui, Hunk Hunk.Cui at amd.com
Wed Aug 11 01:14:51 PDT 2010


Hi, guys, 

In xf86-video-geode:	
	lx_video.c -> LXCopyPlanar function, some codes make me confuse,

(
http://cgit.freedesktop.org/xorg/driver/xf86-video-geode/tree/src/lx_vid
eo.c#n224 )
    YSrcPitch = (width + 3) & ~3;
    YDstPitch = (width + 31) & ~31;

    UVSrcPitch = ((width >> 1) + 3) & ~3;
    UVDstPitch = ((width >> 1) + 15) & ~15;

    USrcOffset = YSrcPitch * height;
    VSrcOffset = USrcOffset + (UVSrcPitch * (height >> 1));

    UDstOffset = YDstPitch * height;
    VDstOffset = UDstOffset + (UVDstPitch * (height >> 1));

    size = YDstPitch * height;
    size += UVDstPitch * height;	

What is the formula for reference?  
How to define and calculate the YDstPitch and UVDstPitch?

And in xf86-video-ati: 
http://cgit.freedesktop.org/xorg/driver/xf86-video-ati/tree/src/radeon_v
ideo.c#n2940
The new_size(ATI) have same principle with size(Geode), how to explain
it?

Thanks,
Hunk Cui 



More information about the xorg-devel mailing list