diff x86/dsputil_mmx.c @ 9445:41245484dc0b libavcodec

avg_ pixel functions need to use (dst+pix+1)>>1 to average with existing pixels, not (dst+pix)>>1. This makes the mmx functions bitexact with the C functions.
author conrad
date Wed, 15 Apr 2009 19:10:16 +0000
parents e14cd3ac3806
children 89270a3bc4a0
line wrap: on
line diff
--- a/x86/dsputil_mmx.c	Wed Apr 15 06:23:40 2009 +0000
+++ b/x86/dsputil_mmx.c	Wed Apr 15 19:10:16 2009 +0000
@@ -155,6 +155,7 @@
 #define SET_RND  MOVQ_WONE
 #define PAVGBP(a, b, c, d, e, f)        PAVGBP_MMX_NO_RND(a, b, c, d, e, f)
 #define PAVGB(a, b, c, e)               PAVGB_MMX_NO_RND(a, b, c, e)
+#define OP_AVG(a, b, c, e)              PAVGB_MMX(a, b, c, e)
 
 #include "dsputil_mmx_rnd_template.c"
 
@@ -176,17 +177,20 @@
 #undef SET_RND
 #undef PAVGBP
 #undef PAVGB
+#undef OP_AVG
 
 /***********************************/
 /* 3Dnow specific */
 
 #define DEF(x) x ## _3dnow
 #define PAVGB "pavgusb"
+#define OP_AVG PAVGB
 
 #include "dsputil_mmx_avg_template.c"
 
 #undef DEF
 #undef PAVGB
+#undef OP_AVG
 
 /***********************************/
 /* MMX2 specific */
@@ -195,11 +199,13 @@
 
 /* Introduced only in MMX2 set */
 #define PAVGB "pavgb"
+#define OP_AVG PAVGB
 
 #include "dsputil_mmx_avg_template.c"
 
 #undef DEF
 #undef PAVGB
+#undef OP_AVG
 
 #define put_no_rnd_pixels16_mmx put_pixels16_mmx
 #define put_no_rnd_pixels8_mmx put_pixels8_mmx