# HG changeset patch # User ivo # Date 1178731760 0 # Node ID 1bd2f5e63da53028f8c55b623ce3ce89a80b380a # Parent 427075ffb413047d4763db9f8f7fe2d4bd441c26 Fix rgb15ToUV. Correct order of components and use one shift less. diff -r 427075ffb413 -r 1bd2f5e63da5 libswscale/swscale_template.c --- a/libswscale/swscale_template.c Wed May 09 17:16:59 2007 +0000 +++ b/libswscale/swscale_template.c Wed May 09 17:29:20 2007 +0000 @@ -2265,14 +2265,11 @@ int d0= ((uint32_t*)src1)[i]; int dl= (d0&0x03E07C1F); - int dh= ((d0>>5)&0x03E0F81F); + int d= dl + (((d0>>16) + (d0<<16))&0x03E07C1F); - int dh2= (dh>>11) + (dh<<21); - int d= dh2 + dl; - - int g= d&0x7F; - int r= (d>>10)&0x7F; - int b= d>>21; + int r= d&0x3F; + int b= (d>>10)&0x3F; + int g= d>>21; dstU[i]= ((RU*r + GU*g + BU*b)>>(RGB2YUV_SHIFT+1-3)) + 128; dstV[i]= ((RV*r + GV*g + BV*b)>>(RGB2YUV_SHIFT+1-3)) + 128; }