summaryrefslogtreecommitdiffstats
path: root/libswscale
diff options
context:
space:
mode:
authorivo <ivo@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-05-09 17:29:20 +0000
committerivo <ivo@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-05-09 17:29:20 +0000
commit4d9f279a6685c65dfe85c0a11b53983a005e4827 (patch)
treee01748aea6d07c2dab1f9f699e908bee74866e17 /libswscale
parent22546a03512f37fe7f9fecc8628dc9a05d520e0d (diff)
downloadmpv-4d9f279a6685c65dfe85c0a11b53983a005e4827.tar.bz2
mpv-4d9f279a6685c65dfe85c0a11b53983a005e4827.tar.xz
Fix rgb15ToUV. Correct order of components and use one shift less.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23279 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/swscale_template.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c
index 96d30afa0b..21fb4e8f16 100644
--- a/libswscale/swscale_template.c
+++ b/libswscale/swscale_template.c
@@ -2265,14 +2265,11 @@ static inline void RENAME(rgb15ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1
int d0= ((uint32_t*)src1)[i];
int dl= (d0&0x03E07C1F);
- int dh= ((d0>>5)&0x03E0F81F);
-
- int dh2= (dh>>11) + (dh<<21);
- int d= dh2 + dl;
+ int d= dl + (((d0>>16) + (d0<<16))&0x03E07C1F);
- 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;
}