arm: remove duplicate functions
[libvpx.git] / vp8 / common / arm / neon / bilinearpredict4x4_neon.asm
blob6d4820b7e6c99ee50c58080c556c7c4841d201da
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.
12 EXPORT |vp8_bilinear_predict4x4_neon|
13 ARM
14 REQUIRE8
15 PRESERVE8
17 AREA ||.text||, CODE, READONLY, ALIGN=2
18 ; r0 unsigned char *src_ptr,
19 ; r1 int src_pixels_per_line,
20 ; r2 int xoffset,
21 ; r3 int yoffset,
22 ; r4 unsigned char *dst_ptr,
23 ; stack(lr) int dst_pitch
25 |vp8_bilinear_predict4x4_neon| PROC
26 push {r4, lr}
28 ldr r12, _bifilter4_coeff_
29 ldr r4, [sp, #8] ;load parameters from stack
30 ldr lr, [sp, #12] ;load parameters from stack
32 cmp r2, #0 ;skip first_pass filter if xoffset=0
33 beq skip_firstpass_filter
35 ;First pass: output_height lines x output_width columns (5x4)
36 vld1.u8 {d2}, [r0], r1 ;load src data
37 add r2, r12, r2, lsl #3 ;calculate Hfilter location (2coeffsx4bytes=8bytes)
39 vld1.u8 {d3}, [r0], r1
40 vld1.u32 {d31}, [r2] ;first_pass filter
42 vld1.u8 {d4}, [r0], r1
43 vdup.8 d0, d31[0] ;first_pass filter (d0-d1)
44 vld1.u8 {d5}, [r0], r1
45 vdup.8 d1, d31[4]
46 vld1.u8 {d6}, [r0], r1
48 vshr.u64 q4, q1, #8 ;construct src_ptr[1]
49 vshr.u64 q5, q2, #8
50 vshr.u64 d12, d6, #8
52 vzip.32 d2, d3 ;put 2-line data in 1 register (src_ptr[0])
53 vzip.32 d4, d5
54 vzip.32 d8, d9 ;put 2-line data in 1 register (src_ptr[1])
55 vzip.32 d10, d11
57 vmull.u8 q7, d2, d0 ;(src_ptr[0] * vp8_filter[0])
58 vmull.u8 q8, d4, d0
59 vmull.u8 q9, d6, d0
61 vmlal.u8 q7, d8, d1 ;(src_ptr[1] * vp8_filter[1])
62 vmlal.u8 q8, d10, d1
63 vmlal.u8 q9, d12, d1
65 vqrshrn.u16 d28, q7, #7 ;shift/round/saturate to u8
66 vqrshrn.u16 d29, q8, #7
67 vqrshrn.u16 d30, q9, #7
69 ;Second pass: 4x4
70 secondpass_filter
71 cmp r3, #0 ;skip second_pass filter if yoffset=0
72 beq skip_secondpass_filter
74 add r3, r12, r3, lsl #3 ;calculate Vfilter location
75 vld1.u32 {d31}, [r3] ;load second_pass filter
77 vdup.8 d0, d31[0] ;second_pass filter parameters (d0-d5)
78 vdup.8 d1, d31[4]
80 vmull.u8 q1, d28, d0
81 vmull.u8 q2, d29, d0
83 vext.8 d26, d28, d29, #4 ;construct src_ptr[pixel_step]
84 vext.8 d27, d29, d30, #4
86 vmlal.u8 q1, d26, d1
87 vmlal.u8 q2, d27, d1
89 add r0, r4, lr
90 add r1, r0, lr
91 add r2, r1, lr
93 vqrshrn.u16 d2, q1, #7 ;shift/round/saturate to u8
94 vqrshrn.u16 d3, q2, #7
96 vst1.32 {d2[0]}, [r4] ;store result
97 vst1.32 {d2[1]}, [r0]
98 vst1.32 {d3[0]}, [r1]
99 vst1.32 {d3[1]}, [r2]
101 pop {r4, pc}
103 ;--------------------
104 skip_firstpass_filter
106 vld1.32 {d28[0]}, [r0], r1 ;load src data
107 vld1.32 {d28[1]}, [r0], r1
108 vld1.32 {d29[0]}, [r0], r1
109 vld1.32 {d29[1]}, [r0], r1
110 vld1.32 {d30[0]}, [r0], r1
112 b secondpass_filter
114 ;---------------------
115 skip_secondpass_filter
116 vst1.32 {d28[0]}, [r4], lr ;store result
117 vst1.32 {d28[1]}, [r4], lr
118 vst1.32 {d29[0]}, [r4], lr
119 vst1.32 {d29[1]}, [r4], lr
121 pop {r4, pc}
123 ENDP
125 ;-----------------
126 AREA bilinearfilters4_dat, DATA, READWRITE ;read/write by default
127 ;Data section with name data_area is specified. DCD reserves space in memory for 48 data.
128 ;One word each is reserved. Label filter_coeff can be used to access the data.
129 ;Data address: filter_coeff, filter_coeff+4, filter_coeff+8 ...
130 _bifilter4_coeff_
131 DCD bifilter4_coeff
132 bifilter4_coeff
133 DCD 128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112