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.

53 lines
1.7KB

  1. /*
  2. * Copyright (c) 2011 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 "asm.S"
  21. function ff_ac3_compute_mantissa_size_arm, export=1
  22. push {r4-r8,lr}
  23. ldm r0, {r4-r8}
  24. mov r3, r0
  25. mov r0, #0
  26. 1:
  27. ldrb lr, [r1], #1
  28. subs r2, r2, #1
  29. blt 2f
  30. cmp lr, #4
  31. bgt 3f
  32. subs lr, lr, #1
  33. addlt r4, r4, #1
  34. addeq r5, r5, #1
  35. ble 1b
  36. subs lr, lr, #2
  37. addlt r6, r6, #1
  38. addeq r7, r7, #1
  39. addgt r8, r8, #1
  40. b 1b
  41. 3:
  42. cmp lr, #14
  43. sublt lr, lr, #1
  44. addgt r0, r0, #16
  45. addle r0, r0, lr
  46. b 1b
  47. 2:
  48. stm r3, {r4-r8}
  49. pop {r4-r8,pc}
  50. endfunc