summaryrefslogtreecommitdiff
path: root/libswscale/swscale.c
diff options
context:
space:
mode:
authorRamiro Polla <ramiro.polla@gmail.com>2010-09-06 02:02:53 +0000
committerRamiro Polla <ramiro.polla@gmail.com>2010-09-06 02:02:53 +0000
commita1899e0adc0761eec627fa53eda49a4912bb46ae (patch)
tree40ad9cc555530049b5af7e7b0422afe49983373d /libswscale/swscale.c
parente778e50f63dcd48f3daad865fd25dc8020bcf405 (diff)
swscale: fix internal rgb->yv12 chroma conversion used by the main scaler path
The shift must be applied before the masking. Originally committed as revision 32051 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
Diffstat (limited to 'libswscale/swscale.c')
-rw-r--r--libswscale/swscale.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 118816a5df..6ceddfd550 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -1069,9 +1069,9 @@ static inline void name(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, const
{\
int i;\
for (i=0; i<width; i++) {\
- int b= (((const type*)src)[i]&maskb)>>(shb+shp);\
- int g= (((const type*)src)[i]&maskg)>>(shg+shp);\
- int r= (((const type*)src)[i]&maskr)>>(shr+shp);\
+ int b= ((((const type*)src)[i]>>shp)&maskb)>>shb;\
+ int g= ((((const type*)src)[i]>>shp)&maskg)>>shg;\
+ int r= ((((const type*)src)[i]>>shp)&maskr)>>shr;\
\
dstU[i]= ((RU)*r + (GU)*g + (BU)*b + (257<<((S)-1)))>>(S);\
dstV[i]= ((RV)*r + (GV)*g + (BV)*b + (257<<((S)-1)))>>(S);\