Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Side by Side Diff: source/libvpx/vp9/common/arm/neon/vp9_idct8x8_add_neon.c

Issue 812033011: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
3 *
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.
9 */
10
11 #include <arm_neon.h>
12
13 #include "./vpx_config.h"
14
15 static int16_t cospi_4_64 = 16069;
16 static int16_t cospi_8_64 = 15137;
17 static int16_t cospi_12_64 = 13623;
18 static int16_t cospi_16_64 = 11585;
19 static int16_t cospi_20_64 = 9102;
20 static int16_t cospi_24_64 = 6270;
21 static int16_t cospi_28_64 = 3196;
22
23 static INLINE void TRANSPOSE8X8(
24 int16x8_t *q8s16,
25 int16x8_t *q9s16,
26 int16x8_t *q10s16,
27 int16x8_t *q11s16,
28 int16x8_t *q12s16,
29 int16x8_t *q13s16,
30 int16x8_t *q14s16,
31 int16x8_t *q15s16) {
32 int16x4_t d16s16, d17s16, d18s16, d19s16, d20s16, d21s16, d22s16, d23s16;
33 int16x4_t d24s16, d25s16, d26s16, d27s16, d28s16, d29s16, d30s16, d31s16;
34 int32x4x2_t q0x2s32, q1x2s32, q2x2s32, q3x2s32;
35 int16x8x2_t q0x2s16, q1x2s16, q2x2s16, q3x2s16;
36
37 d16s16 = vget_low_s16(*q8s16);
38 d17s16 = vget_high_s16(*q8s16);
39 d18s16 = vget_low_s16(*q9s16);
40 d19s16 = vget_high_s16(*q9s16);
41 d20s16 = vget_low_s16(*q10s16);
42 d21s16 = vget_high_s16(*q10s16);
43 d22s16 = vget_low_s16(*q11s16);
44 d23s16 = vget_high_s16(*q11s16);
45 d24s16 = vget_low_s16(*q12s16);
46 d25s16 = vget_high_s16(*q12s16);
47 d26s16 = vget_low_s16(*q13s16);
48 d27s16 = vget_high_s16(*q13s16);
49 d28s16 = vget_low_s16(*q14s16);
50 d29s16 = vget_high_s16(*q14s16);
51 d30s16 = vget_low_s16(*q15s16);
52 d31s16 = vget_high_s16(*q15s16);
53
54 *q8s16 = vcombine_s16(d16s16, d24s16); // vswp d17, d24
55 *q9s16 = vcombine_s16(d18s16, d26s16); // vswp d19, d26
56 *q10s16 = vcombine_s16(d20s16, d28s16); // vswp d21, d28
57 *q11s16 = vcombine_s16(d22s16, d30s16); // vswp d23, d30
58 *q12s16 = vcombine_s16(d17s16, d25s16);
59 *q13s16 = vcombine_s16(d19s16, d27s16);
60 *q14s16 = vcombine_s16(d21s16, d29s16);
61 *q15s16 = vcombine_s16(d23s16, d31s16);
62
63 q0x2s32 = vtrnq_s32(vreinterpretq_s32_s16(*q8s16),
64 vreinterpretq_s32_s16(*q10s16));
65 q1x2s32 = vtrnq_s32(vreinterpretq_s32_s16(*q9s16),
66 vreinterpretq_s32_s16(*q11s16));
67 q2x2s32 = vtrnq_s32(vreinterpretq_s32_s16(*q12s16),
68 vreinterpretq_s32_s16(*q14s16));
69 q3x2s32 = vtrnq_s32(vreinterpretq_s32_s16(*q13s16),
70 vreinterpretq_s32_s16(*q15s16));
71
72 q0x2s16 = vtrnq_s16(vreinterpretq_s16_s32(q0x2s32.val[0]), // q8
73 vreinterpretq_s16_s32(q1x2s32.val[0])); // q9
74 q1x2s16 = vtrnq_s16(vreinterpretq_s16_s32(q0x2s32.val[1]), // q10
75 vreinterpretq_s16_s32(q1x2s32.val[1])); // q11
76 q2x2s16 = vtrnq_s16(vreinterpretq_s16_s32(q2x2s32.val[0]), // q12
77 vreinterpretq_s16_s32(q3x2s32.val[0])); // q13
78 q3x2s16 = vtrnq_s16(vreinterpretq_s16_s32(q2x2s32.val[1]), // q14
79 vreinterpretq_s16_s32(q3x2s32.val[1])); // q15
80
81 *q8s16 = q0x2s16.val[0];
82 *q9s16 = q0x2s16.val[1];
83 *q10s16 = q1x2s16.val[0];
84 *q11s16 = q1x2s16.val[1];
85 *q12s16 = q2x2s16.val[0];
86 *q13s16 = q2x2s16.val[1];
87 *q14s16 = q3x2s16.val[0];
88 *q15s16 = q3x2s16.val[1];
89 return;
90 }
91
92 static INLINE void IDCT8x8_1D(
93 int16x8_t *q8s16,
94 int16x8_t *q9s16,
95 int16x8_t *q10s16,
96 int16x8_t *q11s16,
97 int16x8_t *q12s16,
98 int16x8_t *q13s16,
99 int16x8_t *q14s16,
100 int16x8_t *q15s16) {
101 int16x4_t d0s16, d1s16, d2s16, d3s16;
102 int16x4_t d8s16, d9s16, d10s16, d11s16, d12s16, d13s16, d14s16, d15s16;
103 int16x4_t d16s16, d17s16, d18s16, d19s16, d20s16, d21s16, d22s16, d23s16;
104 int16x4_t d24s16, d25s16, d26s16, d27s16, d28s16, d29s16, d30s16, d31s16;
105 int16x8_t q0s16, q1s16, q2s16, q3s16, q4s16, q5s16, q6s16, q7s16;
106 int32x4_t q2s32, q3s32, q5s32, q6s32, q8s32, q9s32;
107 int32x4_t q10s32, q11s32, q12s32, q13s32, q15s32;
108
109 d0s16 = vdup_n_s16(cospi_28_64);
110 d1s16 = vdup_n_s16(cospi_4_64);
111 d2s16 = vdup_n_s16(cospi_12_64);
112 d3s16 = vdup_n_s16(cospi_20_64);
113
114 d16s16 = vget_low_s16(*q8s16);
115 d17s16 = vget_high_s16(*q8s16);
116 d18s16 = vget_low_s16(*q9s16);
117 d19s16 = vget_high_s16(*q9s16);
118 d20s16 = vget_low_s16(*q10s16);
119 d21s16 = vget_high_s16(*q10s16);
120 d22s16 = vget_low_s16(*q11s16);
121 d23s16 = vget_high_s16(*q11s16);
122 d24s16 = vget_low_s16(*q12s16);
123 d25s16 = vget_high_s16(*q12s16);
124 d26s16 = vget_low_s16(*q13s16);
125 d27s16 = vget_high_s16(*q13s16);
126 d28s16 = vget_low_s16(*q14s16);
127 d29s16 = vget_high_s16(*q14s16);
128 d30s16 = vget_low_s16(*q15s16);
129 d31s16 = vget_high_s16(*q15s16);
130
131 q2s32 = vmull_s16(d18s16, d0s16);
132 q3s32 = vmull_s16(d19s16, d0s16);
133 q5s32 = vmull_s16(d26s16, d2s16);
134 q6s32 = vmull_s16(d27s16, d2s16);
135
136 q2s32 = vmlsl_s16(q2s32, d30s16, d1s16);
137 q3s32 = vmlsl_s16(q3s32, d31s16, d1s16);
138 q5s32 = vmlsl_s16(q5s32, d22s16, d3s16);
139 q6s32 = vmlsl_s16(q6s32, d23s16, d3s16);
140
141 d8s16 = vqrshrn_n_s32(q2s32, 14);
142 d9s16 = vqrshrn_n_s32(q3s32, 14);
143 d10s16 = vqrshrn_n_s32(q5s32, 14);
144 d11s16 = vqrshrn_n_s32(q6s32, 14);
145 q4s16 = vcombine_s16(d8s16, d9s16);
146 q5s16 = vcombine_s16(d10s16, d11s16);
147
148 q2s32 = vmull_s16(d18s16, d1s16);
149 q3s32 = vmull_s16(d19s16, d1s16);
150 q9s32 = vmull_s16(d26s16, d3s16);
151 q13s32 = vmull_s16(d27s16, d3s16);
152
153 q2s32 = vmlal_s16(q2s32, d30s16, d0s16);
154 q3s32 = vmlal_s16(q3s32, d31s16, d0s16);
155 q9s32 = vmlal_s16(q9s32, d22s16, d2s16);
156 q13s32 = vmlal_s16(q13s32, d23s16, d2s16);
157
158 d14s16 = vqrshrn_n_s32(q2s32, 14);
159 d15s16 = vqrshrn_n_s32(q3s32, 14);
160 d12s16 = vqrshrn_n_s32(q9s32, 14);
161 d13s16 = vqrshrn_n_s32(q13s32, 14);
162 q6s16 = vcombine_s16(d12s16, d13s16);
163 q7s16 = vcombine_s16(d14s16, d15s16);
164
165 d0s16 = vdup_n_s16(cospi_16_64);
166
167 q2s32 = vmull_s16(d16s16, d0s16);
168 q3s32 = vmull_s16(d17s16, d0s16);
169 q13s32 = vmull_s16(d16s16, d0s16);
170 q15s32 = vmull_s16(d17s16, d0s16);
171
172 q2s32 = vmlal_s16(q2s32, d24s16, d0s16);
173 q3s32 = vmlal_s16(q3s32, d25s16, d0s16);
174 q13s32 = vmlsl_s16(q13s32, d24s16, d0s16);
175 q15s32 = vmlsl_s16(q15s32, d25s16, d0s16);
176
177 d0s16 = vdup_n_s16(cospi_24_64);
178 d1s16 = vdup_n_s16(cospi_8_64);
179
180 d18s16 = vqrshrn_n_s32(q2s32, 14);
181 d19s16 = vqrshrn_n_s32(q3s32, 14);
182 d22s16 = vqrshrn_n_s32(q13s32, 14);
183 d23s16 = vqrshrn_n_s32(q15s32, 14);
184 *q9s16 = vcombine_s16(d18s16, d19s16);
185 *q11s16 = vcombine_s16(d22s16, d23s16);
186
187 q2s32 = vmull_s16(d20s16, d0s16);
188 q3s32 = vmull_s16(d21s16, d0s16);
189 q8s32 = vmull_s16(d20s16, d1s16);
190 q12s32 = vmull_s16(d21s16, d1s16);
191
192 q2s32 = vmlsl_s16(q2s32, d28s16, d1s16);
193 q3s32 = vmlsl_s16(q3s32, d29s16, d1s16);
194 q8s32 = vmlal_s16(q8s32, d28s16, d0s16);
195 q12s32 = vmlal_s16(q12s32, d29s16, d0s16);
196
197 d26s16 = vqrshrn_n_s32(q2s32, 14);
198 d27s16 = vqrshrn_n_s32(q3s32, 14);
199 d30s16 = vqrshrn_n_s32(q8s32, 14);
200 d31s16 = vqrshrn_n_s32(q12s32, 14);
201 *q13s16 = vcombine_s16(d26s16, d27s16);
202 *q15s16 = vcombine_s16(d30s16, d31s16);
203
204 q0s16 = vaddq_s16(*q9s16, *q15s16);
205 q1s16 = vaddq_s16(*q11s16, *q13s16);
206 q2s16 = vsubq_s16(*q11s16, *q13s16);
207 q3s16 = vsubq_s16(*q9s16, *q15s16);
208
209 *q13s16 = vsubq_s16(q4s16, q5s16);
210 q4s16 = vaddq_s16(q4s16, q5s16);
211 *q14s16 = vsubq_s16(q7s16, q6s16);
212 q7s16 = vaddq_s16(q7s16, q6s16);
213 d26s16 = vget_low_s16(*q13s16);
214 d27s16 = vget_high_s16(*q13s16);
215 d28s16 = vget_low_s16(*q14s16);
216 d29s16 = vget_high_s16(*q14s16);
217
218 d16s16 = vdup_n_s16(cospi_16_64);
219
220 q9s32 = vmull_s16(d28s16, d16s16);
221 q10s32 = vmull_s16(d29s16, d16s16);
222 q11s32 = vmull_s16(d28s16, d16s16);
223 q12s32 = vmull_s16(d29s16, d16s16);
224
225 q9s32 = vmlsl_s16(q9s32, d26s16, d16s16);
226 q10s32 = vmlsl_s16(q10s32, d27s16, d16s16);
227 q11s32 = vmlal_s16(q11s32, d26s16, d16s16);
228 q12s32 = vmlal_s16(q12s32, d27s16, d16s16);
229
230 d10s16 = vqrshrn_n_s32(q9s32, 14);
231 d11s16 = vqrshrn_n_s32(q10s32, 14);
232 d12s16 = vqrshrn_n_s32(q11s32, 14);
233 d13s16 = vqrshrn_n_s32(q12s32, 14);
234 q5s16 = vcombine_s16(d10s16, d11s16);
235 q6s16 = vcombine_s16(d12s16, d13s16);
236
237 *q8s16 = vaddq_s16(q0s16, q7s16);
238 *q9s16 = vaddq_s16(q1s16, q6s16);
239 *q10s16 = vaddq_s16(q2s16, q5s16);
240 *q11s16 = vaddq_s16(q3s16, q4s16);
241 *q12s16 = vsubq_s16(q3s16, q4s16);
242 *q13s16 = vsubq_s16(q2s16, q5s16);
243 *q14s16 = vsubq_s16(q1s16, q6s16);
244 *q15s16 = vsubq_s16(q0s16, q7s16);
245 return;
246 }
247
248 void vp9_idct8x8_64_add_neon(
249 int16_t *input,
250 uint8_t *dest,
251 int dest_stride) {
252 uint8_t *d1, *d2;
253 uint8x8_t d0u8, d1u8, d2u8, d3u8;
254 uint64x1_t d0u64, d1u64, d2u64, d3u64;
255 int16x8_t q8s16, q9s16, q10s16, q11s16, q12s16, q13s16, q14s16, q15s16;
256 uint16x8_t q8u16, q9u16, q10u16, q11u16;
257
258 q8s16 = vld1q_s16(input);
259 q9s16 = vld1q_s16(input + 8);
260 q10s16 = vld1q_s16(input + 16);
261 q11s16 = vld1q_s16(input + 24);
262 q12s16 = vld1q_s16(input + 32);
263 q13s16 = vld1q_s16(input + 40);
264 q14s16 = vld1q_s16(input + 48);
265 q15s16 = vld1q_s16(input + 56);
266
267 TRANSPOSE8X8(&q8s16, &q9s16, &q10s16, &q11s16,
268 &q12s16, &q13s16, &q14s16, &q15s16);
269
270 IDCT8x8_1D(&q8s16, &q9s16, &q10s16, &q11s16,
271 &q12s16, &q13s16, &q14s16, &q15s16);
272
273 TRANSPOSE8X8(&q8s16, &q9s16, &q10s16, &q11s16,
274 &q12s16, &q13s16, &q14s16, &q15s16);
275
276 IDCT8x8_1D(&q8s16, &q9s16, &q10s16, &q11s16,
277 &q12s16, &q13s16, &q14s16, &q15s16);
278
279 q8s16 = vrshrq_n_s16(q8s16, 5);
280 q9s16 = vrshrq_n_s16(q9s16, 5);
281 q10s16 = vrshrq_n_s16(q10s16, 5);
282 q11s16 = vrshrq_n_s16(q11s16, 5);
283 q12s16 = vrshrq_n_s16(q12s16, 5);
284 q13s16 = vrshrq_n_s16(q13s16, 5);
285 q14s16 = vrshrq_n_s16(q14s16, 5);
286 q15s16 = vrshrq_n_s16(q15s16, 5);
287
288 d1 = d2 = dest;
289
290 d0u64 = vld1_u64((uint64_t *)d1);
291 d1 += dest_stride;
292 d1u64 = vld1_u64((uint64_t *)d1);
293 d1 += dest_stride;
294 d2u64 = vld1_u64((uint64_t *)d1);
295 d1 += dest_stride;
296 d3u64 = vld1_u64((uint64_t *)d1);
297 d1 += dest_stride;
298
299 q8u16 = vaddw_u8(vreinterpretq_u16_s16(q8s16),
300 vreinterpret_u8_u64(d0u64));
301 q9u16 = vaddw_u8(vreinterpretq_u16_s16(q9s16),
302 vreinterpret_u8_u64(d1u64));
303 q10u16 = vaddw_u8(vreinterpretq_u16_s16(q10s16),
304 vreinterpret_u8_u64(d2u64));
305 q11u16 = vaddw_u8(vreinterpretq_u16_s16(q11s16),
306 vreinterpret_u8_u64(d3u64));
307
308 d0u8 = vqmovun_s16(vreinterpretq_s16_u16(q8u16));
309 d1u8 = vqmovun_s16(vreinterpretq_s16_u16(q9u16));
310 d2u8 = vqmovun_s16(vreinterpretq_s16_u16(q10u16));
311 d3u8 = vqmovun_s16(vreinterpretq_s16_u16(q11u16));
312
313 vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d0u8));
314 d2 += dest_stride;
315 vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d1u8));
316 d2 += dest_stride;
317 vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d2u8));
318 d2 += dest_stride;
319 vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d3u8));
320 d2 += dest_stride;
321
322 q8s16 = q12s16;
323 q9s16 = q13s16;
324 q10s16 = q14s16;
325 q11s16 = q15s16;
326
327 d0u64 = vld1_u64((uint64_t *)d1);
328 d1 += dest_stride;
329 d1u64 = vld1_u64((uint64_t *)d1);
330 d1 += dest_stride;
331 d2u64 = vld1_u64((uint64_t *)d1);
332 d1 += dest_stride;
333 d3u64 = vld1_u64((uint64_t *)d1);
334 d1 += dest_stride;
335
336 q8u16 = vaddw_u8(vreinterpretq_u16_s16(q8s16),
337 vreinterpret_u8_u64(d0u64));
338 q9u16 = vaddw_u8(vreinterpretq_u16_s16(q9s16),
339 vreinterpret_u8_u64(d1u64));
340 q10u16 = vaddw_u8(vreinterpretq_u16_s16(q10s16),
341 vreinterpret_u8_u64(d2u64));
342 q11u16 = vaddw_u8(vreinterpretq_u16_s16(q11s16),
343 vreinterpret_u8_u64(d3u64));
344
345 d0u8 = vqmovun_s16(vreinterpretq_s16_u16(q8u16));
346 d1u8 = vqmovun_s16(vreinterpretq_s16_u16(q9u16));
347 d2u8 = vqmovun_s16(vreinterpretq_s16_u16(q10u16));
348 d3u8 = vqmovun_s16(vreinterpretq_s16_u16(q11u16));
349
350 vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d0u8));
351 d2 += dest_stride;
352 vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d1u8));
353 d2 += dest_stride;
354 vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d2u8));
355 d2 += dest_stride;
356 vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d3u8));
357 d2 += dest_stride;
358 return;
359 }
360
361 void vp9_idct8x8_12_add_neon(
362 int16_t *input,
363 uint8_t *dest,
364 int dest_stride) {
365 uint8_t *d1, *d2;
366 uint8x8_t d0u8, d1u8, d2u8, d3u8;
367 int16x4_t d10s16, d11s16, d12s16, d13s16, d16s16;
368 int16x4_t d26s16, d27s16, d28s16, d29s16;
369 uint64x1_t d0u64, d1u64, d2u64, d3u64;
370 int16x8_t q0s16, q1s16, q2s16, q3s16, q4s16, q5s16, q6s16, q7s16;
371 int16x8_t q8s16, q9s16, q10s16, q11s16, q12s16, q13s16, q14s16, q15s16;
372 uint16x8_t q8u16, q9u16, q10u16, q11u16;
373 int32x4_t q9s32, q10s32, q11s32, q12s32;
374
375 q8s16 = vld1q_s16(input);
376 q9s16 = vld1q_s16(input + 8);
377 q10s16 = vld1q_s16(input + 16);
378 q11s16 = vld1q_s16(input + 24);
379 q12s16 = vld1q_s16(input + 32);
380 q13s16 = vld1q_s16(input + 40);
381 q14s16 = vld1q_s16(input + 48);
382 q15s16 = vld1q_s16(input + 56);
383
384 TRANSPOSE8X8(&q8s16, &q9s16, &q10s16, &q11s16,
385 &q12s16, &q13s16, &q14s16, &q15s16);
386
387 // First transform rows
388 // stage 1
389 q0s16 = vdupq_n_s16(cospi_28_64 * 2);
390 q1s16 = vdupq_n_s16(cospi_4_64 * 2);
391
392 q4s16 = vqrdmulhq_s16(q9s16, q0s16);
393
394 q0s16 = vdupq_n_s16(-cospi_20_64 * 2);
395
396 q7s16 = vqrdmulhq_s16(q9s16, q1s16);
397
398 q1s16 = vdupq_n_s16(cospi_12_64 * 2);
399
400 q5s16 = vqrdmulhq_s16(q11s16, q0s16);
401
402 q0s16 = vdupq_n_s16(cospi_16_64 * 2);
403
404 q6s16 = vqrdmulhq_s16(q11s16, q1s16);
405
406 // stage 2 & stage 3 - even half
407 q1s16 = vdupq_n_s16(cospi_24_64 * 2);
408
409 q9s16 = vqrdmulhq_s16(q8s16, q0s16);
410
411 q0s16 = vdupq_n_s16(cospi_8_64 * 2);
412
413 q13s16 = vqrdmulhq_s16(q10s16, q1s16);
414
415 q15s16 = vqrdmulhq_s16(q10s16, q0s16);
416
417 // stage 3 -odd half
418 q0s16 = vaddq_s16(q9s16, q15s16);
419 q1s16 = vaddq_s16(q9s16, q13s16);
420 q2s16 = vsubq_s16(q9s16, q13s16);
421 q3s16 = vsubq_s16(q9s16, q15s16);
422
423 // stage 2 - odd half
424 q13s16 = vsubq_s16(q4s16, q5s16);
425 q4s16 = vaddq_s16(q4s16, q5s16);
426 q14s16 = vsubq_s16(q7s16, q6s16);
427 q7s16 = vaddq_s16(q7s16, q6s16);
428 d26s16 = vget_low_s16(q13s16);
429 d27s16 = vget_high_s16(q13s16);
430 d28s16 = vget_low_s16(q14s16);
431 d29s16 = vget_high_s16(q14s16);
432
433 d16s16 = vdup_n_s16(cospi_16_64);
434 q9s32 = vmull_s16(d28s16, d16s16);
435 q10s32 = vmull_s16(d29s16, d16s16);
436 q11s32 = vmull_s16(d28s16, d16s16);
437 q12s32 = vmull_s16(d29s16, d16s16);
438
439 q9s32 = vmlsl_s16(q9s32, d26s16, d16s16);
440 q10s32 = vmlsl_s16(q10s32, d27s16, d16s16);
441 q11s32 = vmlal_s16(q11s32, d26s16, d16s16);
442 q12s32 = vmlal_s16(q12s32, d27s16, d16s16);
443
444 d10s16 = vqrshrn_n_s32(q9s32, 14);
445 d11s16 = vqrshrn_n_s32(q10s32, 14);
446 d12s16 = vqrshrn_n_s32(q11s32, 14);
447 d13s16 = vqrshrn_n_s32(q12s32, 14);
448 q5s16 = vcombine_s16(d10s16, d11s16);
449 q6s16 = vcombine_s16(d12s16, d13s16);
450
451 // stage 4
452 q8s16 = vaddq_s16(q0s16, q7s16);
453 q9s16 = vaddq_s16(q1s16, q6s16);
454 q10s16 = vaddq_s16(q2s16, q5s16);
455 q11s16 = vaddq_s16(q3s16, q4s16);
456 q12s16 = vsubq_s16(q3s16, q4s16);
457 q13s16 = vsubq_s16(q2s16, q5s16);
458 q14s16 = vsubq_s16(q1s16, q6s16);
459 q15s16 = vsubq_s16(q0s16, q7s16);
460
461 TRANSPOSE8X8(&q8s16, &q9s16, &q10s16, &q11s16,
462 &q12s16, &q13s16, &q14s16, &q15s16);
463
464 IDCT8x8_1D(&q8s16, &q9s16, &q10s16, &q11s16,
465 &q12s16, &q13s16, &q14s16, &q15s16);
466
467 q8s16 = vrshrq_n_s16(q8s16, 5);
468 q9s16 = vrshrq_n_s16(q9s16, 5);
469 q10s16 = vrshrq_n_s16(q10s16, 5);
470 q11s16 = vrshrq_n_s16(q11s16, 5);
471 q12s16 = vrshrq_n_s16(q12s16, 5);
472 q13s16 = vrshrq_n_s16(q13s16, 5);
473 q14s16 = vrshrq_n_s16(q14s16, 5);
474 q15s16 = vrshrq_n_s16(q15s16, 5);
475
476 d1 = d2 = dest;
477
478 d0u64 = vld1_u64((uint64_t *)d1);
479 d1 += dest_stride;
480 d1u64 = vld1_u64((uint64_t *)d1);
481 d1 += dest_stride;
482 d2u64 = vld1_u64((uint64_t *)d1);
483 d1 += dest_stride;
484 d3u64 = vld1_u64((uint64_t *)d1);
485 d1 += dest_stride;
486
487 q8u16 = vaddw_u8(vreinterpretq_u16_s16(q8s16),
488 vreinterpret_u8_u64(d0u64));
489 q9u16 = vaddw_u8(vreinterpretq_u16_s16(q9s16),
490 vreinterpret_u8_u64(d1u64));
491 q10u16 = vaddw_u8(vreinterpretq_u16_s16(q10s16),
492 vreinterpret_u8_u64(d2u64));
493 q11u16 = vaddw_u8(vreinterpretq_u16_s16(q11s16),
494 vreinterpret_u8_u64(d3u64));
495
496 d0u8 = vqmovun_s16(vreinterpretq_s16_u16(q8u16));
497 d1u8 = vqmovun_s16(vreinterpretq_s16_u16(q9u16));
498 d2u8 = vqmovun_s16(vreinterpretq_s16_u16(q10u16));
499 d3u8 = vqmovun_s16(vreinterpretq_s16_u16(q11u16));
500
501 vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d0u8));
502 d2 += dest_stride;
503 vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d1u8));
504 d2 += dest_stride;
505 vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d2u8));
506 d2 += dest_stride;
507 vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d3u8));
508 d2 += dest_stride;
509
510 q8s16 = q12s16;
511 q9s16 = q13s16;
512 q10s16 = q14s16;
513 q11s16 = q15s16;
514
515 d0u64 = vld1_u64((uint64_t *)d1);
516 d1 += dest_stride;
517 d1u64 = vld1_u64((uint64_t *)d1);
518 d1 += dest_stride;
519 d2u64 = vld1_u64((uint64_t *)d1);
520 d1 += dest_stride;
521 d3u64 = vld1_u64((uint64_t *)d1);
522 d1 += dest_stride;
523
524 q8u16 = vaddw_u8(vreinterpretq_u16_s16(q8s16),
525 vreinterpret_u8_u64(d0u64));
526 q9u16 = vaddw_u8(vreinterpretq_u16_s16(q9s16),
527 vreinterpret_u8_u64(d1u64));
528 q10u16 = vaddw_u8(vreinterpretq_u16_s16(q10s16),
529 vreinterpret_u8_u64(d2u64));
530 q11u16 = vaddw_u8(vreinterpretq_u16_s16(q11s16),
531 vreinterpret_u8_u64(d3u64));
532
533 d0u8 = vqmovun_s16(vreinterpretq_s16_u16(q8u16));
534 d1u8 = vqmovun_s16(vreinterpretq_s16_u16(q9u16));
535 d2u8 = vqmovun_s16(vreinterpretq_s16_u16(q10u16));
536 d3u8 = vqmovun_s16(vreinterpretq_s16_u16(q11u16));
537
538 vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d0u8));
539 d2 += dest_stride;
540 vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d1u8));
541 d2 += dest_stride;
542 vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d2u8));
543 d2 += dest_stride;
544 vst1_u64((uint64_t *)d2, vreinterpret_u64_u8(d3u8));
545 d2 += dest_stride;
546 return;
547 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698