10l (C code was buggy and untested)
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 21 Mar 2009 23:52:34 +0000 (23:52 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 21 Mar 2009 23:52:34 +0000 (23:52 +0000)
Originally committed as revision 29030 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale

libswscale/rgb2rgb_template.c

index 0b3b2aa..09a57ca 100644 (file)
@@ -2825,8 +2825,8 @@ static void RENAME(extract_even2avg)(const uint8_t *src0, const uint8_t *src1, u
     }
 #endif
     while(count<0){
-        dst0[count]= src0[4*count+0]+src1[4*count+0];
-        dst1[count]= src0[4*count+2]+src1[4*count+2];
+        dst0[count]= (src0[4*count+0]+src1[4*count+0])>>1;
+        dst1[count]= (src0[4*count+2]+src1[4*count+2])>>1;
         count++;
     }
 }
@@ -2872,6 +2872,7 @@ static void RENAME(extract_odd2)(const uint8_t *src, uint8_t *dst0, uint8_t *dst
         count -= 7;
     }
 #endif
+    src++;
     while(count<0){
         dst0[count]= src[4*count+0];
         dst1[count]= src[4*count+2];
@@ -2925,9 +2926,11 @@ static void RENAME(extract_odd2avg)(const uint8_t *src0, const uint8_t *src1, ui
         count -= 7;
     }
 #endif
+    src0++;
+    src1++;
     while(count<0){
-        dst0[count]= src0[4*count+0]+src1[4*count+0];
-        dst1[count]= src0[4*count+2]+src1[4*count+2];
+        dst0[count]= (src0[4*count+0]+src1[4*count+0])>>1;
+        dst1[count]= (src0[4*count+2]+src1[4*count+2])>>1;
         count++;
     }
 }