Merge "Skip computation of distortion in vp8_pick_inter_mode if active_map is used"
[libvpx.git] / vp8 / common / arm / neon / iwalsh_neon.asm
blob01c79d937e6d78f0aedce18b6e08ae4d4d5a3c10
2 ; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
4 ; Use of this source code is governed by a BSD-style license
5 ; that can be found in the LICENSE file in the root of the source
6 ; tree. An additional intellectual property rights grant can be found
7 ; in the file PATENTS. All contributing project authors may
8 ; be found in the AUTHORS file in the root of the source tree.
10 EXPORT |vp8_short_inv_walsh4x4_neon|
11 EXPORT |vp8_short_inv_walsh4x4_1_neon|
13 ARM
14 REQUIRE8
15 PRESERVE8
17 AREA |.text|, CODE, READONLY ; name this block of code
19 ;short vp8_short_inv_walsh4x4_neon(short *input, short *output)
20 |vp8_short_inv_walsh4x4_neon| PROC
22 ; read in all four lines of values: d0->d3
23 vld1.i16 {q0-q1}, [r0@128]
25 ; first for loop
26 vadd.s16 d4, d0, d3 ;a = [0] + [12]
27 vadd.s16 d6, d1, d2 ;b = [4] + [8]
28 vsub.s16 d5, d0, d3 ;d = [0] - [12]
29 vsub.s16 d7, d1, d2 ;c = [4] - [8]
31 vadd.s16 q0, q2, q3 ; a+b d+c
32 vsub.s16 q1, q2, q3 ; a-b d-c
34 vtrn.32 d0, d2 ;d0: 0 1 8 9
35 ;d2: 2 3 10 11
36 vtrn.32 d1, d3 ;d1: 4 5 12 13
37 ;d3: 6 7 14 15
39 vtrn.16 d0, d1 ;d0: 0 4 8 12
40 ;d1: 1 5 9 13
41 vtrn.16 d2, d3 ;d2: 2 6 10 14
42 ;d3: 3 7 11 15
44 ; second for loop
46 vadd.s16 d4, d0, d3 ;a = [0] + [3]
47 vadd.s16 d6, d1, d2 ;b = [1] + [2]
48 vsub.s16 d5, d0, d3 ;d = [0] - [3]
49 vsub.s16 d7, d1, d2 ;c = [1] - [2]
51 vmov.i16 q8, #3
53 vadd.s16 q0, q2, q3 ; a+b d+c
54 vsub.s16 q1, q2, q3 ; a-b d-c
56 vadd.i16 q0, q0, q8 ;e/f += 3
57 vadd.i16 q1, q1, q8 ;g/h += 3
59 vshr.s16 q0, q0, #3 ;e/f >> 3
60 vshr.s16 q1, q1, #3 ;g/h >> 3
62 vst4.i16 {d0,d1,d2,d3}, [r1@128]
64 bx lr
65 ENDP ; |vp8_short_inv_walsh4x4_neon|
68 ;short vp8_short_inv_walsh4x4_1_neon(short *input, short *output)
69 |vp8_short_inv_walsh4x4_1_neon| PROC
70 ldrsh r2, [r0] ; load input[0]
71 add r3, r2, #3 ; add 3
72 add r2, r1, #16 ; base for last 8 output
73 asr r0, r3, #3 ; right shift 3
74 vdup.16 q0, r0 ; load and duplicate
75 vst1.16 {q0}, [r1@128] ; write back 8
76 vst1.16 {q0}, [r2@128] ; write back last 8
77 bx lr
78 ENDP ; |vp8_short_inv_walsh4x4_1_neon|
80 END