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.

110 lines
4.0KB

  1. /*
  2. * Copyright (c) 2010 Mans Rullgard <mans@mansr.com>
  3. * Copyright (c) 2015 Janne Grunau <janne-libav@jannau.net>
  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 "libavutil/aarch64/asm.S"
  22. function ff_dca_lfe_fir0_neon, export=1
  23. mov x3, #32 // decifactor
  24. sub x1, x1, #7*4
  25. add x4, x0, #2*32*4 - 16 // out2
  26. mov x7, #-16
  27. ld1 {v0.4s,v1.4s}, [x1]
  28. // reverse [-num_coeffs + 1, 0]
  29. ext v3.16b, v0.16b, v0.16b, #8
  30. ext v2.16b, v1.16b, v1.16b, #8
  31. rev64 v3.4s, v3.4s
  32. rev64 v2.4s, v2.4s
  33. 1:
  34. ld1 {v4.4s,v5.4s}, [x2], #32
  35. ld1 {v6.4s,v7.4s}, [x2], #32
  36. subs x3, x3, #4
  37. fmul v16.4s, v2.4s, v4.4s
  38. fmul v23.4s, v0.4s, v4.4s
  39. fmul v17.4s, v2.4s, v6.4s
  40. fmul v22.4s, v0.4s, v6.4s
  41. fmla v16.4s, v3.4s, v5.4s
  42. fmla v23.4s, v1.4s, v5.4s
  43. ld1 {v4.4s,v5.4s}, [x2], #32
  44. fmla v17.4s, v3.4s, v7.4s
  45. fmla v22.4s, v1.4s, v7.4s
  46. ld1 {v6.4s,v7.4s}, [x2], #32
  47. fmul v18.4s, v2.4s, v4.4s
  48. fmul v21.4s, v0.4s, v4.4s
  49. fmul v19.4s, v2.4s, v6.4s
  50. fmul v20.4s, v0.4s, v6.4s
  51. fmla v18.4s, v3.4s, v5.4s
  52. fmla v21.4s, v1.4s, v5.4s
  53. fmla v19.4s, v3.4s, v7.4s
  54. fmla v20.4s, v1.4s, v7.4s
  55. faddp v16.4s, v16.4s, v17.4s
  56. faddp v18.4s, v18.4s, v19.4s
  57. faddp v20.4s, v20.4s, v21.4s
  58. faddp v22.4s, v22.4s, v23.4s
  59. faddp v16.4s, v16.4s, v18.4s
  60. faddp v20.4s, v20.4s, v22.4s
  61. st1 {v16.4s}, [x0], #16
  62. st1 {v20.4s}, [x4], x7
  63. b.gt 1b
  64. ret
  65. endfunc
  66. function ff_dca_lfe_fir1_neon, export=1
  67. mov x3, #64 // decifactor
  68. sub x1, x1, #3*4
  69. add x4, x0, #2*64*4 - 16 // out2
  70. mov x7, #-16
  71. ld1 {v0.4s}, [x1]
  72. // reverse [-num_coeffs + 1, 0]
  73. ext v1.16b, v0.16b, v0.16b, #8
  74. rev64 v1.4s, v1.4s
  75. 1:
  76. ld1 {v4.4s,v5.4s}, [x2], #32
  77. ld1 {v6.4s,v7.4s}, [x2], #32
  78. subs x3, x3, #4
  79. fmul v16.4s, v1.4s, v4.4s
  80. fmul v23.4s, v0.4s, v4.4s
  81. fmul v17.4s, v1.4s, v5.4s
  82. fmul v22.4s, v0.4s, v5.4s
  83. fmul v18.4s, v1.4s, v6.4s
  84. fmul v21.4s, v0.4s, v6.4s
  85. fmul v19.4s, v1.4s, v7.4s
  86. fmul v20.4s, v0.4s, v7.4s
  87. faddp v16.4s, v16.4s, v17.4s
  88. faddp v18.4s, v18.4s, v19.4s
  89. faddp v20.4s, v20.4s, v21.4s
  90. faddp v22.4s, v22.4s, v23.4s
  91. faddp v16.4s, v16.4s, v18.4s
  92. faddp v20.4s, v20.4s, v22.4s
  93. st1 {v16.4s}, [x0], #16
  94. st1 {v20.4s}, [x4], x7
  95. b.gt 1b
  96. ret
  97. endfunc