imgutils.asm 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ;*****************************************************************************
  2. ;* Copyright 2016 Anton Khirnov
  3. ;*
  4. ;* This file is part of FFmpeg.
  5. ;*
  6. ;* FFmpeg is free software; you can redistribute it and/or
  7. ;* modify it under the terms of the GNU Lesser General Public
  8. ;* License as published by the Free Software Foundation; either
  9. ;* version 2.1 of the License, or (at your option) any later version.
  10. ;*
  11. ;* FFmpeg is distributed in the hope that it will be useful,
  12. ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. ;* Lesser General Public License for more details.
  15. ;*
  16. ;* You should have received a copy of the GNU Lesser General Public
  17. ;* License along with FFmpeg; if not, write to the Free Software
  18. ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. ;******************************************************************************
  20. %include "libavutil/x86/x86util.asm"
  21. SECTION .text
  22. INIT_XMM sse4
  23. cglobal image_copy_plane_uc_from, 6, 7, 4, dst, dst_linesize, src, src_linesize, bw, height, rowpos
  24. add dstq, bwq
  25. add srcq, bwq
  26. neg bwq
  27. .row_start:
  28. mov rowposq, bwq
  29. .loop:
  30. movntdqa m0, [srcq + rowposq + 0 * mmsize]
  31. movntdqa m1, [srcq + rowposq + 1 * mmsize]
  32. movntdqa m2, [srcq + rowposq + 2 * mmsize]
  33. movntdqa m3, [srcq + rowposq + 3 * mmsize]
  34. mova [dstq + rowposq + 0 * mmsize], m0
  35. mova [dstq + rowposq + 1 * mmsize], m1
  36. mova [dstq + rowposq + 2 * mmsize], m2
  37. mova [dstq + rowposq + 3 * mmsize], m3
  38. add rowposq, 4 * mmsize
  39. jnz .loop
  40. add srcq, src_linesizeq
  41. add dstq, dst_linesizeq
  42. dec heightd
  43. jnz .row_start
  44. RET