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.6KB

  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_get_pixels_armv6, export=1
  22. pld [r1, r2]
  23. push {r4-r8, lr}
  24. mov lr, #8
  25. 1:
  26. ldrd_post r4, r5, r1, r2
  27. subs lr, lr, #1
  28. uxtb16 r6, r4
  29. uxtb16 r4, r4, ror #8
  30. uxtb16 r12, r5
  31. uxtb16 r8, r5, ror #8
  32. pld [r1, r2]
  33. pkhbt r5, r6, r4, lsl #16
  34. pkhtb r6, r4, r6, asr #16
  35. pkhbt r7, r12, r8, lsl #16
  36. pkhtb r12, r8, r12, asr #16
  37. stm r0!, {r5,r6,r7,r12}
  38. bgt 1b
  39. pop {r4-r8, pc}
  40. endfunc
  41. function ff_diff_pixels_armv6, export=1
  42. pld [r1, r3]
  43. pld [r2, r3]
  44. push {r4-r9, lr}
  45. mov lr, #8
  46. 1:
  47. ldrd_post r4, r5, r1, r3
  48. ldrd_post r6, r7, r2, r3
  49. uxtb16 r8, r4
  50. uxtb16 r4, r4, ror #8
  51. uxtb16 r9, r6
  52. uxtb16 r6, r6, ror #8
  53. pld [r1, r3]
  54. ssub16 r9, r8, r9
  55. ssub16 r6, r4, r6
  56. uxtb16 r8, r5
  57. uxtb16 r5, r5, ror #8
  58. pld [r2, r3]
  59. pkhbt r4, r9, r6, lsl #16
  60. pkhtb r6, r6, r9, asr #16
  61. uxtb16 r9, r7
  62. uxtb16 r7, r7, ror #8
  63. ssub16 r9, r8, r9
  64. ssub16 r5, r5, r7
  65. subs lr, lr, #1
  66. pkhbt r8, r9, r5, lsl #16
  67. pkhtb r9, r5, r9, asr #16
  68. stm r0!, {r4,r6,r8,r9}
  69. bgt 1b
  70. pop {r4-r9, pc}
  71. endfunc