vp9_dct_sse2.asm 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. ;
  2. ; Copyright (c) 2016 The WebM project authors. All Rights Reserved.
  3. ;
  4. ; Use of this source code is governed by a BSD-style license
  5. ; that can be found in the LICENSE file in the root of the source
  6. ; tree. An additional intellectual property rights grant can be found
  7. ; in the file PATENTS. All contributing project authors may
  8. ; be found in the AUTHORS file in the root of the source tree.
  9. ;
  10. %define private_prefix vp9
  11. %include "third_party/x86inc/x86inc.asm"
  12. %include "vpx_dsp/x86/bitdepth_conversion_sse2.asm"
  13. SECTION .text
  14. %macro TRANSFORM_COLS 0
  15. paddw m0, m1
  16. movq m4, m0
  17. psubw m3, m2
  18. psubw m4, m3
  19. psraw m4, 1
  20. movq m5, m4
  21. psubw m5, m1 ;b1
  22. psubw m4, m2 ;c1
  23. psubw m0, m4
  24. paddw m3, m5
  25. ; m0 a0
  26. SWAP 1, 4 ; m1 c1
  27. SWAP 2, 3 ; m2 d1
  28. SWAP 3, 5 ; m3 b1
  29. %endmacro
  30. %macro TRANSPOSE_4X4 0
  31. ; 00 01 02 03
  32. ; 10 11 12 13
  33. ; 20 21 22 23
  34. ; 30 31 32 33
  35. punpcklwd m0, m1 ; 00 10 01 11 02 12 03 13
  36. punpcklwd m2, m3 ; 20 30 21 31 22 32 23 33
  37. mova m1, m0
  38. punpckldq m0, m2 ; 00 10 20 30 01 11 21 31
  39. punpckhdq m1, m2 ; 02 12 22 32 03 13 23 33
  40. %endmacro
  41. INIT_XMM sse2
  42. cglobal fwht4x4, 3, 4, 8, input, output, stride
  43. lea r3q, [inputq + strideq*4]
  44. movq m0, [inputq] ;a1
  45. movq m1, [inputq + strideq*2] ;b1
  46. movq m2, [r3q] ;c1
  47. movq m3, [r3q + strideq*2] ;d1
  48. TRANSFORM_COLS
  49. TRANSPOSE_4X4
  50. SWAP 1, 2
  51. psrldq m1, m0, 8
  52. psrldq m3, m2, 8
  53. TRANSFORM_COLS
  54. TRANSPOSE_4X4
  55. psllw m0, 2
  56. psllw m1, 2
  57. STORE_TRAN_LOW 0, outputq, 0, 2, 3
  58. STORE_TRAN_LOW 1, outputq, 8, 2, 3
  59. RET