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.

107 lines
3.8KB

  1. /*
  2. * Copyright (c) 2010 Mans Rullgard
  3. *
  4. * This file is part of FFmpeg.
  5. *
  6. * FFmpeg 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. * FFmpeg 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 FFmpeg; 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. #include "asm-offsets.h"
  22. function ff_dct_unquantize_h263_inter_neon, export=1
  23. add r0, r0, #0x2200
  24. add r12, r0, #BLOCK_LAST_INDEX-0x2200
  25. ldr r12, [r12, r2, lsl #2]
  26. add r0, r0, #INTER_SCANTAB_RASTER_END-0x2200
  27. ldrb r12, [r0, r12]
  28. sub r2, r3, #1
  29. lsl r0, r3, #1
  30. orr r2, r2, #1
  31. add r3, r12, #1
  32. endfunc
  33. function ff_dct_unquantize_h263_neon, export=1
  34. vdup.16 q15, r0 @ qmul
  35. vdup.16 q14, r2 @ qadd
  36. vneg.s16 q13, q14
  37. cmp r3, #4
  38. mov r0, r1
  39. ble 2f
  40. 1:
  41. vld1.16 {q0}, [r0,:128]!
  42. vclt.s16 q3, q0, #0
  43. vld1.16 {q8}, [r0,:128]!
  44. vceq.s16 q1, q0, #0
  45. vmul.s16 q2, q0, q15
  46. vclt.s16 q11, q8, #0
  47. vmul.s16 q10, q8, q15
  48. vbsl q3, q13, q14
  49. vbsl q11, q13, q14
  50. vadd.s16 q2, q2, q3
  51. vceq.s16 q9, q8, #0
  52. vadd.s16 q10, q10, q11
  53. vbif q0, q2, q1
  54. vbif q8, q10, q9
  55. subs r3, r3, #16
  56. vst1.16 {q0}, [r1,:128]!
  57. vst1.16 {q8}, [r1,:128]!
  58. bxle lr
  59. cmp r3, #8
  60. bgt 1b
  61. 2:
  62. vld1.16 {d0}, [r0,:64]
  63. vclt.s16 d3, d0, #0
  64. vceq.s16 d1, d0, #0
  65. vmul.s16 d2, d0, d30
  66. vbsl d3, d26, d28
  67. vadd.s16 d2, d2, d3
  68. vbif d0, d2, d1
  69. vst1.16 {d0}, [r1,:64]
  70. bx lr
  71. endfunc
  72. function ff_dct_unquantize_h263_intra_neon, export=1
  73. push {r4-r6,lr}
  74. ldr r6, [r0, #AC_PRED]
  75. add r5, r0, #0x2700
  76. cmp r6, #0
  77. movne r12, #63
  78. bne 1f
  79. add lr, r0, #0x2200
  80. add r12, lr, #BLOCK_LAST_INDEX-0x2200
  81. add lr, lr, #INTER_SCANTAB_RASTER_END-0x2200
  82. ldr r12, [r12, r2, lsl #2]
  83. ldrb r12, [lr, r12]
  84. 1: ldr r5, [r5, #H263_AIC-0x2700]
  85. ldrsh r4, [r1]
  86. cmp r5, #0
  87. mov r5, r1
  88. movne r2, #0
  89. bne 2f
  90. cmp r2, #4
  91. addge r0, r0, #4
  92. sub r2, r3, #1
  93. ldr r6, [r0, #Y_DC_SCALE]
  94. orr r2, r2, #1
  95. smulbb r4, r4, r6
  96. 2: lsl r0, r3, #1
  97. add r3, r12, #1
  98. bl ff_dct_unquantize_h263_neon
  99. vmov.16 d0[0], r4
  100. vst1.16 {d0[0]}, [r5]
  101. pop {r4-r6,pc}
  102. endfunc