vf_interlace.asm 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. ;*****************************************************************************
  2. ;* x86-optimized functions for interlace filter
  3. ;*
  4. ;* Copyright (C) 2014 Kieran Kunhya <kierank@obe.tv>
  5. ;* Copyright (c) 2014 Michael Niedermayer <michaelni@gmx.at>
  6. ;*
  7. ;* This file is part of FFmpeg.
  8. ;*
  9. ;* FFmpeg is free software; you can redistribute it and/or modify
  10. ;* it under the terms of the GNU General Public License as published by
  11. ;* the Free Software Foundation; either version 2 of the License, or
  12. ;* (at your option) any later version.
  13. ;*
  14. ;* FFmpeg is distributed in the hope that it will be useful,
  15. ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. ;* GNU General Public License for more details.
  18. ;*
  19. ;* You should have received a copy of the GNU General Public License along
  20. ;* with FFmpeg; if not, write to the Free Software Foundation, Inc.,
  21. ;* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  22. ;******************************************************************************
  23. %include "libavutil/x86/x86util.asm"
  24. SECTION_RODATA
  25. SECTION .text
  26. %macro LOWPASS_LINE 0
  27. cglobal lowpass_line, 5, 5, 7
  28. add r0, r1
  29. add r2, r1
  30. add r3, r1
  31. add r4, r1
  32. neg r1
  33. pcmpeqb m6, m6
  34. .loop:
  35. mova m0, [r3+r1]
  36. mova m1, [r3+r1+mmsize]
  37. pavgb m0, [r4+r1]
  38. pavgb m1, [r4+r1+mmsize]
  39. pxor m0, m6
  40. pxor m1, m6
  41. pxor m2, m6, [r2+r1]
  42. pxor m3, m6, [r2+r1+mmsize]
  43. pavgb m0, m2
  44. pavgb m1, m3
  45. pxor m0, m6
  46. pxor m1, m6
  47. mova [r0+r1], m0
  48. mova [r0+r1+mmsize], m1
  49. add r1, 2*mmsize
  50. jl .loop
  51. REP_RET
  52. %endmacro
  53. INIT_XMM sse2
  54. LOWPASS_LINE
  55. INIT_XMM avx
  56. LOWPASS_LINE