You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.6KB

  1. /*
  2. * MMX-optimized avg/put pixel routines
  3. *
  4. * Copyright (c) 2001 Fabrice Bellard
  5. *
  6. * This file is part of Libav.
  7. *
  8. * Libav is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * Libav is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with Libav; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. */
  22. #include <stddef.h>
  23. #include <stdint.h>
  24. #include "config.h"
  25. #include "hpeldsp.h"
  26. #include "inline_asm.h"
  27. #if HAVE_MMX_INLINE
  28. void ff_avg_pixels8_x2_mmx(uint8_t *block, const uint8_t *pixels,
  29. ptrdiff_t line_size, int h)
  30. {
  31. MOVQ_BFE(mm6);
  32. JUMPALIGN();
  33. do {
  34. __asm__ volatile(
  35. "movq %1, %%mm0 \n\t"
  36. "movq 1%1, %%mm1 \n\t"
  37. "movq %0, %%mm3 \n\t"
  38. PAVGB_MMX(%%mm0, %%mm1, %%mm2, %%mm6)
  39. PAVGB_MMX(%%mm3, %%mm2, %%mm0, %%mm6)
  40. "movq %%mm0, %0 \n\t"
  41. :"+m"(*block)
  42. :"m"(*pixels)
  43. :"memory");
  44. pixels += line_size;
  45. block += line_size;
  46. } while (--h);
  47. }
  48. #endif /* HAVE_MMX_INLINE */