# HG changeset patch # User ramiro # Date 1283738573 0 # Node ID 45e6a4af3006949646d0df365ceec14dfdd22e30 # Parent 6fd0de7a6fd22cf36d8fe4e84755aedde2940dca swscale: fix internal rgb->yv12 chroma conversion used by the main scaler path The shift must be applied before the masking. diff -r 6fd0de7a6fd2 -r 45e6a4af3006 libswscale/swscale.c --- 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>(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);\