2 * ARM NEON optimised DSP functions
3 * Copyright (c) 2008 Mans Rullgard <mans@mansr.com>
5 * This file is part of Libav.
7 * Libav is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * Libav is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with Libav; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 #include "libavutil/arm/asm.S"
24 function ff_clear_block_neon, export=1
27 vst1.16 {q0}, [r0,:128]!
32 function ff_clear_blocks_neon, export=1
35 vst1.16 {q0}, [r0,:128]!
40 function ff_put_pixels_clamped_neon, export=1
41 vld1.16 {d16-d19}, [r0,:128]!
43 vld1.16 {d20-d23}, [r0,:128]!
45 vld1.16 {d24-d27}, [r0,:128]!
47 vld1.16 {d28-d31}, [r0,:128]!
49 vst1.8 {d0}, [r1,:64], r2
51 vst1.8 {d1}, [r1,:64], r2
53 vst1.8 {d2}, [r1,:64], r2
55 vst1.8 {d3}, [r1,:64], r2
57 vst1.8 {d4}, [r1,:64], r2
58 vst1.8 {d5}, [r1,:64], r2
59 vst1.8 {d6}, [r1,:64], r2
60 vst1.8 {d7}, [r1,:64], r2
64 function ff_put_signed_pixels_clamped_neon, export=1
66 vld1.16 {d16-d17}, [r0,:128]!
68 vld1.16 {d18-d19}, [r0,:128]!
70 vld1.16 {d16-d17}, [r0,:128]!
72 vld1.16 {d18-d19}, [r0,:128]!
74 vld1.16 {d20-d21}, [r0,:128]!
76 vld1.16 {d22-d23}, [r0,:128]!
78 vst1.8 {d0}, [r1,:64], r2
80 vst1.8 {d1}, [r1,:64], r2
82 vst1.8 {d2}, [r1,:64], r2
84 vld1.16 {d24-d25}, [r0,:128]!
86 vld1.16 {d26-d27}, [r0,:128]!
89 vst1.8 {d3}, [r1,:64], r2
91 vst1.8 {d4}, [r1,:64], r2
93 vst1.8 {d5}, [r1,:64], r2
96 vst1.8 {d6}, [r1,:64], r2
97 vst1.8 {d7}, [r1,:64], r2
101 function ff_add_pixels_clamped_neon, export=1
103 vld1.8 {d16}, [r1,:64], r2
104 vld1.16 {d0-d1}, [r0,:128]!
106 vld1.8 {d17}, [r1,:64], r2
107 vld1.16 {d2-d3}, [r0,:128]!
109 vld1.8 {d18}, [r1,:64], r2
111 vld1.16 {d4-d5}, [r0,:128]!
113 vst1.8 {d0}, [r3,:64], r2
115 vld1.8 {d19}, [r1,:64], r2
116 vld1.16 {d6-d7}, [r0,:128]!
119 vst1.8 {d2}, [r3,:64], r2
120 vld1.8 {d16}, [r1,:64], r2
122 vld1.16 {d0-d1}, [r0,:128]!
124 vst1.8 {d4}, [r3,:64], r2
125 vld1.8 {d17}, [r1,:64], r2
126 vld1.16 {d2-d3}, [r0,:128]!
128 vst1.8 {d6}, [r3,:64], r2
130 vld1.8 {d18}, [r1,:64], r2
131 vld1.16 {d4-d5}, [r0,:128]!
133 vst1.8 {d0}, [r3,:64], r2
135 vld1.8 {d19}, [r1,:64], r2
137 vld1.16 {d6-d7}, [r0,:128]!
139 vst1.8 {d2}, [r3,:64], r2
141 vst1.8 {d4}, [r3,:64], r2
142 vst1.8 {d6}, [r3,:64], r2
146 function ff_vector_clipf_neon, export=1
147 VFP vdup.32 q1, d0[1]
148 VFP vdup.32 q0, d0[0]
152 vld1.f32 {q2},[r1,:128]!
154 vld1.f32 {q3},[r1,:128]!
156 1: vmax.f32 q8, q10, q0
160 vld1.f32 {q2},[r1,:128]!
162 vld1.f32 {q3},[r1,:128]!
164 vst1.f32 {q8},[r0,:128]!
165 vst1.f32 {q9},[r0,:128]!
167 2: vst1.f32 {q8},[r0,:128]!
168 vst1.f32 {q9},[r0,:128]!
172 function ff_apply_window_int16_neon, export=1
174 add r4, r1, r3, lsl #1
175 add lr, r0, r3, lsl #1
180 vld1.16 {q0}, [r1,:128]!
181 vld1.16 {q2}, [r2,:128]!
182 vld1.16 {q1}, [r4,:128], r12
184 vqrdmulh.s16 q0, q0, q2
185 vqrdmulh.s16 d2, d2, d7
186 vqrdmulh.s16 d3, d3, d6
187 vst1.16 {q0}, [r0,:128]!
188 vst1.16 {q1}, [lr,:128], r12
195 function ff_vector_clip_int32_neon, export=1
200 vld1.32 {q2-q3}, [r1,:128]!
205 vst1.32 {q2-q3}, [r0,:128]!