X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fmodules%2Fmod_libavcodec%2Flibavcodec%2Fi386%2Fmotion_est_mmx.c;fp=synfig-core%2Ftrunk%2Fsrc%2Fmodules%2Fmod_libavcodec%2Flibavcodec%2Fi386%2Fmotion_est_mmx.c;h=9e88ce2ce1b5f360e75e0f02aba968584e73a607;hb=16b3beced25134bef064705568ecb893a6be4e79;hp=0000000000000000000000000000000000000000;hpb=5a1d028f56182922addfed8f1f1c28fdde12756c;p=synfig.git diff --git a/synfig-core/trunk/src/modules/mod_libavcodec/libavcodec/i386/motion_est_mmx.c b/synfig-core/trunk/src/modules/mod_libavcodec/libavcodec/i386/motion_est_mmx.c new file mode 100644 index 0000000..9e88ce2 --- /dev/null +++ b/synfig-core/trunk/src/modules/mod_libavcodec/libavcodec/i386/motion_est_mmx.c @@ -0,0 +1,420 @@ +/* + * MMX optimized motion estimation + * Copyright (c) 2001 Fabrice Bellard. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * mostly by Michael Niedermayer + */ +#include "../dsputil.h" + +static const __attribute__ ((aligned(8))) uint64_t round_tab[3]={ +0x0000000000000000, +0x0001000100010001, +0x0002000200020002, +}; + +static __attribute__ ((aligned(8), unused)) uint64_t bone= 0x0101010101010101LL; + +static inline void sad8_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h) +{ + int len= -(stride<pix_abs16x16 = pix_abs16x16_mmx; + c->pix_abs16x16_x2 = pix_abs16x16_x2_mmx; + c->pix_abs16x16_y2 = pix_abs16x16_y2_mmx; + c->pix_abs16x16_xy2 = pix_abs16x16_xy2_mmx; + c->pix_abs8x8 = pix_abs8x8_mmx; + c->pix_abs8x8_x2 = pix_abs8x8_x2_mmx; + c->pix_abs8x8_y2 = pix_abs8x8_y2_mmx; + c->pix_abs8x8_xy2 = pix_abs8x8_xy2_mmx; + + c->sad[0]= sad16x16_mmx; + c->sad[1]= sad8x8_mmx; + } + if (mm_flags & MM_MMXEXT) { + c->pix_abs16x16 = pix_abs16x16_mmx2; + c->pix_abs8x8 = pix_abs8x8_mmx2; + + c->sad[0]= sad16x16_mmx2; + c->sad[1]= sad8x8_mmx2; + + if(!(avctx->flags & CODEC_FLAG_BITEXACT)){ + c->pix_abs16x16_x2 = pix_abs16x16_x2_mmx2; + c->pix_abs16x16_y2 = pix_abs16x16_y2_mmx2; + c->pix_abs16x16_xy2 = pix_abs16x16_xy2_mmx2; + c->pix_abs8x8_x2 = pix_abs8x8_x2_mmx2; + c->pix_abs8x8_y2 = pix_abs8x8_y2_mmx2; + c->pix_abs8x8_xy2 = pix_abs8x8_xy2_mmx2; + } + } +}