/* * 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))) 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_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 = pix_abs8x8_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; c->sad[0]= sad16x16_mmx2; c->sad[1]= sad8x8_mmx2; } } void dsputil_set_bit_exact_pix_mmx(DSPContext* c, unsigned mask) { if (mm_flags & MM_MMXEXT) { 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_x2 = pix_abs8x8_x2_mmx; c->pix_abs8x8_y2 = pix_abs8x8_y2_mmx; c->pix_abs8x8_xy2 = pix_abs8x8_xy2_mmx; } }