summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorivo <ivo@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-05-09 21:34:05 +0000
committerivo <ivo@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-05-09 21:34:05 +0000
commitfba7257f2d911e0114c734ebd95871399d6ba789 (patch)
tree0c098d1c1ba95596e3e74d3b03338d51880bc96c
parent1e4b9a95b786fe4ff08704e4694b46d873c90a2c (diff)
downloadmpv-fba7257f2d911e0114c734ebd95871399d6ba789.tar.bz2
mpv-fba7257f2d911e0114c734ebd95871399d6ba789.tar.xz
remove the need of one extra shift in rgb16ToUV
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23281 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--libswscale/swscale_template.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c
index 21fb4e8f16..8cd51e94d2 100644
--- a/libswscale/swscale_template.c
+++ b/libswscale/swscale_template.c
@@ -2229,13 +2229,10 @@ static inline void RENAME(rgb16ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1
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;