changeset 31967:45e6a4af3006

swscale: fix internal rgb->yv12 chroma conversion used by the main scaler path The shift must be applied before the masking.
author ramiro
date Mon, 06 Sep 2010 02:02:53 +0000
parents 6fd0de7a6fd2
children 5c9310a4d2e9
files libswscale/swscale.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libswscale/swscale.c	Sun Sep 05 09:41:24 2010 +0000
+++ b/libswscale/swscale.c	Mon Sep 06 02:02:53 2010 +0000
@@ -1069,9 +1069,9 @@
 {\
     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);\