aboutsummaryrefslogtreecommitdiffhomepage
path: root/libswscale
diff options
context:
space:
mode:
authorGravatar kostya <kostya@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-03-09 17:25:43 +0000
committerGravatar kostya <kostya@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-03-09 17:25:43 +0000
commit72304af23b416364e5e500f699b7c2daf9708c8f (patch)
tree87ccd3f19d4e0868dbfd8ea31282e92c84ff14ad /libswscale
parent37e7934dcebe04a3ae6ecacf386ff0eb0b928438 (diff)
Mask all unused bits for packed pixel format instead of green and alpha mask only.
That fixes the case when converting 15-bit RGB/BGR to YUV and high bit is set for input value(s). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28916 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/swscale_template.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c
index 6f2e243052..da6278d80c 100644
--- a/libswscale/swscale_template.c
+++ b/libswscale/swscale_template.c
@@ -1663,7 +1663,7 @@ static inline void RENAME(name ## _half)(uint8_t *dstU, uint8_t *dstV, uint8_t *
{\
int pix0= ((type*)src)[2*i+0];\
int pix1= ((type*)src)[2*i+1];\
- int g= (pix0&(maskg|maska))+(pix1&(maskg|maska));\
+ int g= (pix0&~(maskr|maskb))+(pix1&~(maskr|maskb));\
int b= ((pix0+pix1-g)&(maskb|(2*maskb)))>>shb;\
int r= ((pix0+pix1-g)&(maskr|(2*maskr)))>>shr;\
g&= maskg|(2*maskg);\