changeset 23263:f85d8e62735d

remove the need of one extra shift in rgb16ToUV
author ivo
date Wed, 09 May 2007 21:34:05 +0000
parents a08c4d770870
children dc12bca7d4b5
files libswscale/swscale_template.c
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libswscale/swscale_template.c	Wed May 09 20:10:14 2007 +0000
+++ b/libswscale/swscale_template.c	Wed May 09 21:34:05 2007 +0000
@@ -2229,13 +2229,10 @@
         int d0= ((uint32_t*)src1)[i];
 
         int dl= (d0&0x07E0F81F);
-        int dh= ((d0>>5)&0x07C0F83F);
+        int d= dl + (((d0>>16) + (d0<<16))&0x07E0F81F);
 
-        int dh2= (dh>>11) + (dh<<21);
-        int d= dh2 + dl;
-
-        int r= d&0x7F;
-        int b= (d>>11)&0x7F;
+        int r= d&0x3F;
+        int b= (d>>11)&0x3F;
         int g= d>>21;
         dstU[i]= ((2*RU*r + GU*g + 2*BU*b)>>(RGB2YUV_SHIFT+1-2)) + 128;
         dstV[i]= ((2*RV*r + GV*g + 2*BV*b)>>(RGB2YUV_SHIFT+1-2)) + 128;