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.

83 lines
2.5KB

  1. ;******************************************************************************
  2. ;* MMX optimized deinterlacing functions
  3. ;* Copyright (c) 2010 Vitor Sessak
  4. ;* Copyright (c) 2002 Michael Niedermayer
  5. ;*
  6. ;* This file is part of FFmpeg.
  7. ;*
  8. ;* FFmpeg 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. ;* 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 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 FFmpeg; if not, write to the Free Software
  20. ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. ;******************************************************************************
  22. %include "libavutil/x86/x86util.asm"
  23. SECTION_RODATA
  24. cextern pw_4
  25. SECTION .text
  26. %macro DEINTERLACE 1
  27. %ifidn %1, inplace
  28. ;void ff_deinterlace_line_inplace_mmx(const uint8_t *lum_m4, const uint8_t *lum_m3, const uint8_t *lum_m2, const uint8_t *lum_m1, const uint8_t *lum, int size)
  29. cglobal deinterlace_line_inplace_mmx, 6,6,7, lum_m4, lum_m3, lum_m2, lum_m1, lum, size
  30. %else
  31. ;void ff_deinterlace_line_mmx(uint8_t *dst, const uint8_t *lum_m4, const uint8_t *lum_m3, const uint8_t *lum_m2, const uint8_t *lum_m1, const uint8_t *lum, int size)
  32. cglobal deinterlace_line_mmx, 7,7,7, dst, lum_m4, lum_m3, lum_m2, lum_m1, lum, size
  33. %endif
  34. pxor mm7, mm7
  35. movq mm6, [pw_4]
  36. .nextrow:
  37. movd mm0, [lum_m4q]
  38. movd mm1, [lum_m3q]
  39. movd mm2, [lum_m2q]
  40. %ifidn %1, inplace
  41. movd [lum_m4q], mm2
  42. %endif
  43. movd mm3, [lum_m1q]
  44. movd mm4, [lumq]
  45. punpcklbw mm0, mm7
  46. punpcklbw mm1, mm7
  47. punpcklbw mm2, mm7
  48. punpcklbw mm3, mm7
  49. punpcklbw mm4, mm7
  50. paddw mm1, mm3
  51. psllw mm2, 1
  52. paddw mm0, mm4
  53. psllw mm1, 2
  54. paddw mm2, mm6
  55. paddw mm1, mm2
  56. psubusw mm1, mm0
  57. psrlw mm1, 3
  58. packuswb mm1, mm7
  59. %ifidn %1, inplace
  60. movd [lum_m2q], mm1
  61. %else
  62. movd [dstq], mm1
  63. add dstq, 4
  64. %endif
  65. add lum_m4q, 4
  66. add lum_m3q, 4
  67. add lum_m2q, 4
  68. add lum_m1q, 4
  69. add lumq, 4
  70. sub sized, 4
  71. jg .nextrow
  72. REP_RET
  73. %endmacro
  74. DEINTERLACE ""
  75. DEINTERLACE inplace