Commit a1899e0a authored by Ramiro Polla's avatar Ramiro Polla

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
parent e778e50f
...@@ -1069,9 +1069,9 @@ static inline void name(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, const ...@@ -1069,9 +1069,9 @@ static inline void name(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, const
{\ {\
int i;\ int i;\
for (i=0; i<width; i++) {\ for (i=0; i<width; i++) {\
int b= (((const type*)src)[i]&maskb)>>(shb+shp);\ int b= ((((const type*)src)[i]>>shp)&maskb)>>shb;\
int g= (((const type*)src)[i]&maskg)>>(shg+shp);\ int g= ((((const type*)src)[i]>>shp)&maskg)>>shg;\
int r= (((const type*)src)[i]&maskr)>>(shr+shp);\ int r= ((((const type*)src)[i]>>shp)&maskr)>>shr;\
\ \
dstU[i]= ((RU)*r + (GU)*g + (BU)*b + (257<<((S)-1)))>>(S);\ dstU[i]= ((RU)*r + (GU)*g + (BU)*b + (257<<((S)-1)))>>(S);\
dstV[i]= ((RV)*r + (GV)*g + (BV)*b + (257<<((S)-1)))>>(S);\ dstV[i]= ((RV)*r + (GV)*g + (BV)*b + (257<<((S)-1)))>>(S);\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment