Mercurial > mplayer.hg
comparison libvo/vo_directx.c @ 8490:ac40496c7d9e
1000l! I have no idea how this code worked at all before. I guess no
one tests win32 much anyway... :)
author | rfelker |
---|---|
date | Wed, 18 Dec 2002 07:34:32 +0000 |
parents | 5b39e79af5fe |
children | a23489e72ef0 |
comparison
equal
deleted
inserted
replaced
8489:2dd791127398 | 8490:ac40496c7d9e |
---|---|
994 | 994 |
995 static uint32_t draw_slice(uint8_t *src[], int stride[], int w,int h,int x,int y ) | 995 static uint32_t draw_slice(uint8_t *src[], int stride[], int w,int h,int x,int y ) |
996 { | 996 { |
997 uint8_t *s; | 997 uint8_t *s; |
998 uint8_t *d; | 998 uint8_t *d; |
999 uint32_t i=0; | 999 uint32_t i=0, uvstride=dstride/2; |
1000 | 1000 |
1001 // copy Y | 1001 // copy Y |
1002 d=image+dstride*y+x; | 1002 d=image+dstride*y+x; |
1003 s=src[0]; | 1003 s=src[0]; |
1004 for(i=0;i<h;i++){ | 1004 for(i=0;i<h;i++){ |
1005 memcpy(d,s,w); | 1005 memcpy(d,s,w); |
1006 s+=stride[0]; | 1006 s+=stride[0]; |
1007 d+=stride[0]; | 1007 d+=dstride; |
1008 } | 1008 } |
1009 | 1009 |
1010 w/=2;h/=2;x/=2;y/=2; | 1010 w/=2;h/=2;x/=2;y/=2; |
1011 | 1011 |
1012 // copy U | 1012 // copy U |
1013 d=image+image_width*image_height + dstride*y/2+x; | 1013 d=image+dstride*image_height + uvstride*y+x; |
1014 if(swap)s=src[2]; | 1014 if(swap)s=src[2]; |
1015 else s=src[1]; | 1015 else s=src[1]; |
1016 for(i=0;i<h;i++){ | 1016 for(i=0;i<h;i++){ |
1017 memcpy(d,s,w); | 1017 memcpy(d,s,w); |
1018 s+=stride[1]; | 1018 s+=stride[1]; |
1019 d+=stride[1]; | 1019 d+=uvstride; |
1020 } | 1020 } |
1021 | 1021 |
1022 // copy V | 1022 // copy V |
1023 d=image+image_width*image_height +image_width*image_height/4 + dstride*y/2+x; | 1023 d=image+dstride*image_height +uvstride*(image_height/2) + uvstride*y+x; |
1024 if(swap)s=src[1]; | 1024 if(swap)s=src[1]; |
1025 else s=src[2]; | 1025 else s=src[2]; |
1026 for(i=0;i<h;i++){ | 1026 for(i=0;i<h;i++){ |
1027 memcpy(d,s,w); | 1027 memcpy(d,s,w); |
1028 s+=stride[2]; | 1028 s+=stride[2]; |
1029 d+=stride[2]; | 1029 d+=uvstride; |
1030 } | 1030 } |
1031 return 0; | 1031 return 0; |
1032 } | 1032 } |
1033 | 1033 |
1034 static void flip_page(void) | 1034 static void flip_page(void) |