idct4x4_1_add_neon.asm 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ;
  2. ; Copyright (c) 2013 The WebM project authors. All Rights Reserved.
  3. ;
  4. ; Use of this source code is governed by a BSD-style license and patent
  5. ; grant that can be found in the LICENSE file in the root of the source
  6. ; tree. All contributing project authors may be found in the AUTHORS
  7. ; file in the root of the source tree.
  8. ;
  9. EXPORT |vpx_idct4x4_1_add_neon|
  10. ARM
  11. REQUIRE8
  12. PRESERVE8
  13. AREA ||.text||, CODE, READONLY, ALIGN=2
  14. ;void vpx_idct4x4_1_add_neon(int16_t *input, uint8_t *dest, int stride)
  15. ;
  16. ; r0 int16_t input
  17. ; r1 uint8_t *dest
  18. ; r2 int stride)
  19. |vpx_idct4x4_1_add_neon| PROC
  20. ldrsh r0, [r0]
  21. ; cospi_16_64 = 11585
  22. movw r12, #0x2d41
  23. ; out = dct_const_round_shift(input[0] * cospi_16_64)
  24. mul r0, r0, r12 ; input[0] * cospi_16_64
  25. add r0, r0, #0x2000 ; +(1 << ((DCT_CONST_BITS) - 1))
  26. asr r0, r0, #14 ; >> DCT_CONST_BITS
  27. ; out = dct_const_round_shift(out * cospi_16_64)
  28. mul r0, r0, r12 ; out * cospi_16_64
  29. mov r12, r1 ; save dest
  30. add r0, r0, #0x2000 ; +(1 << ((DCT_CONST_BITS) - 1))
  31. asr r0, r0, #14 ; >> DCT_CONST_BITS
  32. ; a1 = ROUND_POWER_OF_TWO(out, 4)
  33. add r0, r0, #8 ; + (1 <<((4) - 1))
  34. asr r0, r0, #4 ; >> 4
  35. vdup.s16 q0, r0 ; duplicate a1
  36. vld1.32 {d2[0]}, [r1], r2
  37. vld1.32 {d2[1]}, [r1], r2
  38. vld1.32 {d4[0]}, [r1], r2
  39. vld1.32 {d4[1]}, [r1]
  40. vaddw.u8 q8, q0, d2 ; dest[x] + a1
  41. vaddw.u8 q9, q0, d4
  42. vqmovun.s16 d6, q8 ; clip_pixel
  43. vqmovun.s16 d7, q9
  44. vst1.32 {d6[0]}, [r12], r2
  45. vst1.32 {d6[1]}, [r12], r2
  46. vst1.32 {d7[0]}, [r12], r2
  47. vst1.32 {d7[1]}, [r12]
  48. bx lr
  49. ENDP ; |vpx_idct4x4_1_add_neon|
  50. END