Mercurial > libavcodec.hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
9444:fe17033a79ed | 9445:41245484dc0b |
---|---|
153 /* MMX no rounding */ | 153 /* MMX no rounding */ |
154 #define DEF(x, y) x ## _no_rnd_ ## y ##_mmx | 154 #define DEF(x, y) x ## _no_rnd_ ## y ##_mmx |
155 #define SET_RND MOVQ_WONE | 155 #define SET_RND MOVQ_WONE |
156 #define PAVGBP(a, b, c, d, e, f) PAVGBP_MMX_NO_RND(a, b, c, d, e, f) | 156 #define PAVGBP(a, b, c, d, e, f) PAVGBP_MMX_NO_RND(a, b, c, d, e, f) |
157 #define PAVGB(a, b, c, e) PAVGB_MMX_NO_RND(a, b, c, e) | 157 #define PAVGB(a, b, c, e) PAVGB_MMX_NO_RND(a, b, c, e) |
158 #define OP_AVG(a, b, c, e) PAVGB_MMX(a, b, c, e) | |
158 | 159 |
159 #include "dsputil_mmx_rnd_template.c" | 160 #include "dsputil_mmx_rnd_template.c" |
160 | 161 |
161 #undef DEF | 162 #undef DEF |
162 #undef SET_RND | 163 #undef SET_RND |
174 | 175 |
175 #undef DEF | 176 #undef DEF |
176 #undef SET_RND | 177 #undef SET_RND |
177 #undef PAVGBP | 178 #undef PAVGBP |
178 #undef PAVGB | 179 #undef PAVGB |
180 #undef OP_AVG | |
179 | 181 |
180 /***********************************/ | 182 /***********************************/ |
181 /* 3Dnow specific */ | 183 /* 3Dnow specific */ |
182 | 184 |
183 #define DEF(x) x ## _3dnow | 185 #define DEF(x) x ## _3dnow |
184 #define PAVGB "pavgusb" | 186 #define PAVGB "pavgusb" |
187 #define OP_AVG PAVGB | |
185 | 188 |
186 #include "dsputil_mmx_avg_template.c" | 189 #include "dsputil_mmx_avg_template.c" |
187 | 190 |
188 #undef DEF | 191 #undef DEF |
189 #undef PAVGB | 192 #undef PAVGB |
193 #undef OP_AVG | |
190 | 194 |
191 /***********************************/ | 195 /***********************************/ |
192 /* MMX2 specific */ | 196 /* MMX2 specific */ |
193 | 197 |
194 #define DEF(x) x ## _mmx2 | 198 #define DEF(x) x ## _mmx2 |
195 | 199 |
196 /* Introduced only in MMX2 set */ | 200 /* Introduced only in MMX2 set */ |
197 #define PAVGB "pavgb" | 201 #define PAVGB "pavgb" |
202 #define OP_AVG PAVGB | |
198 | 203 |
199 #include "dsputil_mmx_avg_template.c" | 204 #include "dsputil_mmx_avg_template.c" |
200 | 205 |
201 #undef DEF | 206 #undef DEF |
202 #undef PAVGB | 207 #undef PAVGB |
208 #undef OP_AVG | |
203 | 209 |
204 #define put_no_rnd_pixels16_mmx put_pixels16_mmx | 210 #define put_no_rnd_pixels16_mmx put_pixels16_mmx |
205 #define put_no_rnd_pixels8_mmx put_pixels8_mmx | 211 #define put_no_rnd_pixels8_mmx put_pixels8_mmx |
206 #define put_pixels16_mmx2 put_pixels16_mmx | 212 #define put_pixels16_mmx2 put_pixels16_mmx |
207 #define put_pixels8_mmx2 put_pixels8_mmx | 213 #define put_pixels8_mmx2 put_pixels8_mmx |