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.

56 lines
1.7KB

  1. ;******************************************************************************
  2. ;* MMX/SSE2-optimized functions for the RV30 and RV40 decoders
  3. ;* Copyright (C) 2012 Christophe Gisquet <christophe.gisquet@gmail.com>
  4. ;*
  5. ;* This file is part of Libav.
  6. ;*
  7. ;* Libav is free software; you can redistribute it and/or
  8. ;* modify it under the terms of the GNU Lesser General Public
  9. ;* License as published by the Free Software Foundation; either
  10. ;* version 2.1 of the License, or (at your option) any later version.
  11. ;*
  12. ;* Libav is distributed in the hope that it will be useful,
  13. ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. ;* Lesser General Public License for more details.
  16. ;*
  17. ;* You should have received a copy of the GNU Lesser General Public
  18. ;* License along with Libav; if not, write to the Free Software
  19. ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. ;******************************************************************************
  21. %include "x86inc.asm"
  22. %include "x86util.asm"
  23. SECTION .text
  24. %macro IDCT_DC_NOROUND 1
  25. imul %1, 13*13*3
  26. sar %1, 11
  27. %endmacro
  28. %macro IDCT_DC_ROUND 1
  29. imul %1, 13*13
  30. add %1, 0x200
  31. sar %1, 10
  32. %endmacro
  33. %macro rv34_idct_dequant4x4_dc 1
  34. cglobal rv34_idct_dequant4x4_%1_mmx2, 1, 2, 0
  35. movsx r1, word [r0]
  36. IDCT_DC r1
  37. movd mm0, r1
  38. pshufw mm0, mm0, 0
  39. movq [r0+ 0], mm0
  40. movq [r0+16], mm0
  41. movq [r0+32], mm0
  42. movq [r0+48], mm0
  43. REP_RET
  44. %endmacro
  45. INIT_MMX
  46. %define IDCT_DC IDCT_DC_ROUND
  47. rv34_idct_dequant4x4_dc dc
  48. %define IDCT_DC IDCT_DC_NOROUND
  49. rv34_idct_dequant4x4_dc dc_noround