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.

64 lines
2.2KB

  1. /*
  2. * ARM NEON optimised audio functions
  3. * Copyright (c) 2008 Mans Rullgard <mans@mansr.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 "libavutil/arm/asm.S"
  22. function ff_vector_clipf_neon, export=1
  23. VFP vdup.32 q1, d0[1]
  24. VFP vdup.32 q0, d0[0]
  25. NOVFP vdup.32 q0, r3
  26. NOVFP vld1.32 {d2[],d3[]}, [sp]
  27. vld1.f32 {q2},[r1,:128]!
  28. vmin.f32 q10, q2, q1
  29. vld1.f32 {q3},[r1,:128]!
  30. vmin.f32 q11, q3, q1
  31. 1: vmax.f32 q8, q10, q0
  32. vmax.f32 q9, q11, q0
  33. subs r2, r2, #8
  34. beq 2f
  35. vld1.f32 {q2},[r1,:128]!
  36. vmin.f32 q10, q2, q1
  37. vld1.f32 {q3},[r1,:128]!
  38. vmin.f32 q11, q3, q1
  39. vst1.f32 {q8},[r0,:128]!
  40. vst1.f32 {q9},[r0,:128]!
  41. b 1b
  42. 2: vst1.f32 {q8},[r0,:128]!
  43. vst1.f32 {q9},[r0,:128]!
  44. bx lr
  45. endfunc
  46. function ff_vector_clip_int32_neon, export=1
  47. vdup.32 q0, r2
  48. vdup.32 q1, r3
  49. ldr r2, [sp]
  50. 1:
  51. vld1.32 {q2-q3}, [r1,:128]!
  52. vmin.s32 q2, q2, q1
  53. vmin.s32 q3, q3, q1
  54. vmax.s32 q2, q2, q0
  55. vmax.s32 q3, q3, q0
  56. vst1.32 {q2-q3}, [r0,:128]!
  57. subs r2, r2, #8
  58. bgt 1b
  59. bx lr
  60. endfunc