vf_pp7.asm 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. ;*****************************************************************************
  2. ;* x86-optimized functions for pp7 filter
  3. ;*
  4. ;* Copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
  5. ;*
  6. ;* This file is part of FFmpeg.
  7. ;*
  8. ;* FFmpeg is free software; you can redistribute it and/or modify
  9. ;* it under the terms of the GNU General Public License as published by
  10. ;* the Free Software Foundation; either version 2 of the License, or
  11. ;* (at your option) any later version.
  12. ;*
  13. ;* FFmpeg 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
  16. ;* GNU General Public License for more details.
  17. ;*
  18. ;* You should have received a copy of the GNU General Public License along
  19. ;* with FFmpeg; if not, write to the Free Software Foundation, Inc.,
  20. ;* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  21. ;******************************************************************************
  22. %include "libavutil/x86/x86util.asm"
  23. SECTION .text
  24. INIT_MMX mmx
  25. ;void ff_pp7_dctB_mmx(int16_t *dst, int16_t *src)
  26. cglobal pp7_dctB, 2, 2, 0, dst, src
  27. movq m0, [srcq]
  28. movq m1, [srcq+mmsize*1]
  29. paddw m0, [srcq+mmsize*6]
  30. paddw m1, [srcq+mmsize*5]
  31. movq m2, [srcq+mmsize*2]
  32. movq m3, [srcq+mmsize*3]
  33. paddw m2, [srcq+mmsize*4]
  34. paddw m3, m3
  35. movq m4, m3
  36. psubw m3, m0
  37. paddw m4, m0
  38. movq m0, m2
  39. psubw m2, m1
  40. paddw m0, m1
  41. movq m1, m4
  42. psubw m4, m0
  43. paddw m1, m0
  44. movq m0, m3
  45. psubw m3, m2
  46. psubw m3, m2
  47. paddw m2, m0
  48. paddw m2, m0
  49. movq [dstq], m1
  50. movq [dstq+mmsize*2], m4
  51. movq [dstq+mmsize*1], m2
  52. movq [dstq+mmsize*3], m3
  53. RET