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.

77 lines
2.5KB

  1. /*
  2. * Copyright (c) 2009 Mans Rullgard <mans@mansr.com>
  3. *
  4. * This file is part of Libav.
  5. *
  6. * Libav is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * Libav is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with Libav; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #include "libavutil/arm/asm.S"
  21. function ff_pix_norm1_armv6, export=1
  22. push {r4-r6, lr}
  23. mov r12, #16
  24. mov lr, #0
  25. 1:
  26. ldm r0, {r2-r5}
  27. uxtb16 r6, r2
  28. uxtb16 r2, r2, ror #8
  29. smlad lr, r6, r6, lr
  30. uxtb16 r6, r3
  31. smlad lr, r2, r2, lr
  32. uxtb16 r3, r3, ror #8
  33. smlad lr, r6, r6, lr
  34. uxtb16 r6, r4
  35. smlad lr, r3, r3, lr
  36. uxtb16 r4, r4, ror #8
  37. smlad lr, r6, r6, lr
  38. uxtb16 r6, r5
  39. smlad lr, r4, r4, lr
  40. uxtb16 r5, r5, ror #8
  41. smlad lr, r6, r6, lr
  42. subs r12, r12, #1
  43. add r0, r0, r1
  44. smlad lr, r5, r5, lr
  45. bgt 1b
  46. mov r0, lr
  47. pop {r4-r6, pc}
  48. endfunc
  49. function ff_pix_sum_armv6, export=1
  50. push {r4-r7, lr}
  51. mov r12, #16
  52. mov r2, #0
  53. mov r3, #0
  54. mov lr, #0
  55. ldr r4, [r0]
  56. 1:
  57. subs r12, r12, #1
  58. ldr r5, [r0, #4]
  59. usada8 r2, r4, lr, r2
  60. ldr r6, [r0, #8]
  61. usada8 r3, r5, lr, r3
  62. ldr r7, [r0, #12]
  63. usada8 r2, r6, lr, r2
  64. beq 2f
  65. ldr_pre r4, r0, r1
  66. usada8 r3, r7, lr, r3
  67. bgt 1b
  68. 2:
  69. usada8 r3, r7, lr, r3
  70. add r0, r2, r3
  71. pop {r4-r7, pc}
  72. endfunc