OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 The LibYuv Project Authors. All rights reserved. | 2 * Copyright 2014 The LibYuv Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 "movi v22.8h, #19, lsl #0 \n" /* UR coefficient (-0.2969) / 2 */ \ | 134 "movi v22.8h, #19, lsl #0 \n" /* UR coefficient (-0.2969) / 2 */ \ |
135 "movi v23.8h, #9, lsl #0 \n" /* VB coefficient (-0.1406) / 2 */ \ | 135 "movi v23.8h, #9, lsl #0 \n" /* VB coefficient (-0.1406) / 2 */ \ |
136 "movi v24.8h, #47, lsl #0 \n" /* VG coefficient (-0.7344) / 2 */ \ | 136 "movi v24.8h, #47, lsl #0 \n" /* VG coefficient (-0.7344) / 2 */ \ |
137 "movi v25.16b, #0x80 \n" /* 128.5 (0x8080 in 16-bit) */ | 137 "movi v25.16b, #0x80 \n" /* 128.5 (0x8080 in 16-bit) */ |
138 | 138 |
139 #ifdef HAS_I444TOARGBROW_NEON | 139 #ifdef HAS_I444TOARGBROW_NEON |
140 void I444ToARGBRow_NEON(const uint8* src_y, | 140 void I444ToARGBRow_NEON(const uint8* src_y, |
141 const uint8* src_u, | 141 const uint8* src_u, |
142 const uint8* src_v, | 142 const uint8* src_v, |
143 uint8* dst_argb, | 143 uint8* dst_argb, |
144 struct YuvConstants* yuvconstants, | 144 const struct YuvConstants* yuvconstants, |
145 int width) { | 145 int width) { |
146 asm volatile ( | 146 asm volatile ( |
147 YUVTORGB_SETUP | 147 YUVTORGB_SETUP |
148 "1: \n" | 148 "1: \n" |
149 READYUV444 | 149 READYUV444 |
150 YUVTORGB(v22, v21, v20) | 150 YUVTORGB(v22, v21, v20) |
151 "subs %w4, %w4, #8 \n" | 151 "subs %w4, %w4, #8 \n" |
152 "movi v23.8b, #255 \n" /* A */ | 152 "movi v23.8b, #255 \n" /* A */ |
153 MEMACCESS(3) | 153 MEMACCESS(3) |
154 "st4 {v20.8b,v21.8b,v22.8b,v23.8b}, [%3], #32 \n" | 154 "st4 {v20.8b,v21.8b,v22.8b,v23.8b}, [%3], #32 \n" |
(...skipping 12 matching lines...) Expand all Loading... |
167 ); | 167 ); |
168 } | 168 } |
169 #endif // HAS_I444TOARGBROW_NEON | 169 #endif // HAS_I444TOARGBROW_NEON |
170 | 170 |
171 // TODO(fbarchard): Switch to Matrix version of this function. | 171 // TODO(fbarchard): Switch to Matrix version of this function. |
172 #ifdef HAS_I422TOARGBROW_NEON | 172 #ifdef HAS_I422TOARGBROW_NEON |
173 void I422ToARGBRow_NEON(const uint8* src_y, | 173 void I422ToARGBRow_NEON(const uint8* src_y, |
174 const uint8* src_u, | 174 const uint8* src_u, |
175 const uint8* src_v, | 175 const uint8* src_v, |
176 uint8* dst_argb, | 176 uint8* dst_argb, |
177 struct YuvConstants* yuvconstants, | 177 const struct YuvConstants* yuvconstants, |
178 int width) { | 178 int width) { |
179 asm volatile ( | 179 asm volatile ( |
180 YUVTORGB_SETUP | 180 YUVTORGB_SETUP |
181 "1: \n" | 181 "1: \n" |
182 READYUV422 | 182 READYUV422 |
183 YUVTORGB(v22, v21, v20) | 183 YUVTORGB(v22, v21, v20) |
184 "subs %w4, %w4, #8 \n" | 184 "subs %w4, %w4, #8 \n" |
185 "movi v23.8b, #255 \n" /* A */ | 185 "movi v23.8b, #255 \n" /* A */ |
186 MEMACCESS(3) | 186 MEMACCESS(3) |
187 "st4 {v20.8b,v21.8b,v22.8b,v23.8b}, [%3], #32 \n" | 187 "st4 {v20.8b,v21.8b,v22.8b,v23.8b}, [%3], #32 \n" |
(...skipping 11 matching lines...) Expand all Loading... |
199 "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30" | 199 "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30" |
200 ); | 200 ); |
201 } | 201 } |
202 #endif // HAS_I422TOARGBROW_NEON | 202 #endif // HAS_I422TOARGBROW_NEON |
203 | 203 |
204 #ifdef HAS_I411TOARGBROW_NEON | 204 #ifdef HAS_I411TOARGBROW_NEON |
205 void I411ToARGBRow_NEON(const uint8* src_y, | 205 void I411ToARGBRow_NEON(const uint8* src_y, |
206 const uint8* src_u, | 206 const uint8* src_u, |
207 const uint8* src_v, | 207 const uint8* src_v, |
208 uint8* dst_argb, | 208 uint8* dst_argb, |
209 struct YuvConstants* yuvconstants, | 209 const struct YuvConstants* yuvconstants, |
210 int width) { | 210 int width) { |
211 asm volatile ( | 211 asm volatile ( |
212 YUVTORGB_SETUP | 212 YUVTORGB_SETUP |
213 "1: \n" | 213 "1: \n" |
214 READYUV411 | 214 READYUV411 |
215 YUVTORGB(v22, v21, v20) | 215 YUVTORGB(v22, v21, v20) |
216 "subs %w4, %w4, #8 \n" | 216 "subs %w4, %w4, #8 \n" |
217 "movi v23.8b, #255 \n" /* A */ | 217 "movi v23.8b, #255 \n" /* A */ |
218 MEMACCESS(3) | 218 MEMACCESS(3) |
219 "st4 {v20.8b,v21.8b,v22.8b,v23.8b}, [%3], #32 \n" | 219 "st4 {v20.8b,v21.8b,v22.8b,v23.8b}, [%3], #32 \n" |
(...skipping 11 matching lines...) Expand all Loading... |
231 "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30" | 231 "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30" |
232 ); | 232 ); |
233 } | 233 } |
234 #endif // HAS_I411TOARGBROW_NEON | 234 #endif // HAS_I411TOARGBROW_NEON |
235 | 235 |
236 #ifdef HAS_I422TOBGRAROW_NEON | 236 #ifdef HAS_I422TOBGRAROW_NEON |
237 void I422ToBGRARow_NEON(const uint8* src_y, | 237 void I422ToBGRARow_NEON(const uint8* src_y, |
238 const uint8* src_u, | 238 const uint8* src_u, |
239 const uint8* src_v, | 239 const uint8* src_v, |
240 uint8* dst_bgra, | 240 uint8* dst_bgra, |
241 struct YuvConstants* yuvconstants, | 241 const struct YuvConstants* yuvconstants, |
242 int width) { | 242 int width) { |
243 asm volatile ( | 243 asm volatile ( |
244 YUVTORGB_SETUP | 244 YUVTORGB_SETUP |
245 "1: \n" | 245 "1: \n" |
246 READYUV422 | 246 READYUV422 |
247 YUVTORGB(v21, v22, v23) | 247 YUVTORGB(v21, v22, v23) |
248 "subs %w4, %w4, #8 \n" | 248 "subs %w4, %w4, #8 \n" |
249 "movi v20.8b, #255 \n" /* A */ | 249 "movi v20.8b, #255 \n" /* A */ |
250 MEMACCESS(3) | 250 MEMACCESS(3) |
251 "st4 {v20.8b,v21.8b,v22.8b,v23.8b}, [%3], #32 \n" | 251 "st4 {v20.8b,v21.8b,v22.8b,v23.8b}, [%3], #32 \n" |
(...skipping 12 matching lines...) Expand all Loading... |
264 ); | 264 ); |
265 } | 265 } |
266 #endif // HAS_I422TOBGRAROW_NEON | 266 #endif // HAS_I422TOBGRAROW_NEON |
267 | 267 |
268 // TODO(fbarchard): Switch to Matrix version of this function. | 268 // TODO(fbarchard): Switch to Matrix version of this function. |
269 #ifdef HAS_I422TOABGRROW_NEON | 269 #ifdef HAS_I422TOABGRROW_NEON |
270 void I422ToABGRRow_NEON(const uint8* src_y, | 270 void I422ToABGRRow_NEON(const uint8* src_y, |
271 const uint8* src_u, | 271 const uint8* src_u, |
272 const uint8* src_v, | 272 const uint8* src_v, |
273 uint8* dst_abgr, | 273 uint8* dst_abgr, |
274 struct YuvConstants* yuvconstants, | 274 const struct YuvConstants* yuvconstants, |
275 int width) { | 275 int width) { |
276 asm volatile ( | 276 asm volatile ( |
277 YUVTORGB_SETUP | 277 YUVTORGB_SETUP |
278 "1: \n" | 278 "1: \n" |
279 READYUV422 | 279 READYUV422 |
280 YUVTORGB(v20, v21, v22) | 280 YUVTORGB(v20, v21, v22) |
281 "subs %w4, %w4, #8 \n" | 281 "subs %w4, %w4, #8 \n" |
282 "movi v23.8b, #255 \n" /* A */ | 282 "movi v23.8b, #255 \n" /* A */ |
283 MEMACCESS(3) | 283 MEMACCESS(3) |
284 "st4 {v20.8b,v21.8b,v22.8b,v23.8b}, [%3], #32 \n" | 284 "st4 {v20.8b,v21.8b,v22.8b,v23.8b}, [%3], #32 \n" |
(...skipping 11 matching lines...) Expand all Loading... |
296 "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30" | 296 "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30" |
297 ); | 297 ); |
298 } | 298 } |
299 #endif // HAS_I422TOABGRROW_NEON | 299 #endif // HAS_I422TOABGRROW_NEON |
300 | 300 |
301 #ifdef HAS_I422TORGBAROW_NEON | 301 #ifdef HAS_I422TORGBAROW_NEON |
302 void I422ToRGBARow_NEON(const uint8* src_y, | 302 void I422ToRGBARow_NEON(const uint8* src_y, |
303 const uint8* src_u, | 303 const uint8* src_u, |
304 const uint8* src_v, | 304 const uint8* src_v, |
305 uint8* dst_rgba, | 305 uint8* dst_rgba, |
306 struct YuvConstants* yuvconstants, | 306 const struct YuvConstants* yuvconstants, |
307 int width) { | 307 int width) { |
308 asm volatile ( | 308 asm volatile ( |
309 YUVTORGB_SETUP | 309 YUVTORGB_SETUP |
310 "1: \n" | 310 "1: \n" |
311 READYUV422 | 311 READYUV422 |
312 YUVTORGB(v23, v22, v21) | 312 YUVTORGB(v23, v22, v21) |
313 "subs %w4, %w4, #8 \n" | 313 "subs %w4, %w4, #8 \n" |
314 "movi v20.8b, #255 \n" /* A */ | 314 "movi v20.8b, #255 \n" /* A */ |
315 MEMACCESS(3) | 315 MEMACCESS(3) |
316 "st4 {v20.8b,v21.8b,v22.8b,v23.8b}, [%3], #32 \n" | 316 "st4 {v20.8b,v21.8b,v22.8b,v23.8b}, [%3], #32 \n" |
(...skipping 11 matching lines...) Expand all Loading... |
328 "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30" | 328 "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30" |
329 ); | 329 ); |
330 } | 330 } |
331 #endif // HAS_I422TORGBAROW_NEON | 331 #endif // HAS_I422TORGBAROW_NEON |
332 | 332 |
333 #ifdef HAS_I422TORGB24ROW_NEON | 333 #ifdef HAS_I422TORGB24ROW_NEON |
334 void I422ToRGB24Row_NEON(const uint8* src_y, | 334 void I422ToRGB24Row_NEON(const uint8* src_y, |
335 const uint8* src_u, | 335 const uint8* src_u, |
336 const uint8* src_v, | 336 const uint8* src_v, |
337 uint8* dst_rgb24, | 337 uint8* dst_rgb24, |
338 struct YuvConstants* yuvconstants, | 338 const struct YuvConstants* yuvconstants, |
339 int width) { | 339 int width) { |
340 asm volatile ( | 340 asm volatile ( |
341 YUVTORGB_SETUP | 341 YUVTORGB_SETUP |
342 "1: \n" | 342 "1: \n" |
343 READYUV422 | 343 READYUV422 |
344 YUVTORGB(v22, v21, v20) | 344 YUVTORGB(v22, v21, v20) |
345 "subs %w4, %w4, #8 \n" | 345 "subs %w4, %w4, #8 \n" |
346 MEMACCESS(3) | 346 MEMACCESS(3) |
347 "st3 {v20.8b,v21.8b,v22.8b}, [%3], #24 \n" | 347 "st3 {v20.8b,v21.8b,v22.8b}, [%3], #24 \n" |
348 "b.gt 1b \n" | 348 "b.gt 1b \n" |
(...skipping 10 matching lines...) Expand all Loading... |
359 "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30" | 359 "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30" |
360 ); | 360 ); |
361 } | 361 } |
362 #endif // HAS_I422TORGB24ROW_NEON | 362 #endif // HAS_I422TORGB24ROW_NEON |
363 | 363 |
364 #ifdef HAS_I422TORAWROW_NEON | 364 #ifdef HAS_I422TORAWROW_NEON |
365 void I422ToRAWRow_NEON(const uint8* src_y, | 365 void I422ToRAWRow_NEON(const uint8* src_y, |
366 const uint8* src_u, | 366 const uint8* src_u, |
367 const uint8* src_v, | 367 const uint8* src_v, |
368 uint8* dst_raw, | 368 uint8* dst_raw, |
369 struct YuvConstants* yuvconstants, | 369 const struct YuvConstants* yuvconstants, |
370 int width) { | 370 int width) { |
371 asm volatile ( | 371 asm volatile ( |
372 YUVTORGB_SETUP | 372 YUVTORGB_SETUP |
373 "1: \n" | 373 "1: \n" |
374 READYUV422 | 374 READYUV422 |
375 YUVTORGB(v20, v21, v22) | 375 YUVTORGB(v20, v21, v22) |
376 "subs %w4, %w4, #8 \n" | 376 "subs %w4, %w4, #8 \n" |
377 MEMACCESS(3) | 377 MEMACCESS(3) |
378 "st3 {v20.8b,v21.8b,v22.8b}, [%3], #24 \n" | 378 "st3 {v20.8b,v21.8b,v22.8b}, [%3], #24 \n" |
379 "b.gt 1b \n" | 379 "b.gt 1b \n" |
(...skipping 17 matching lines...) Expand all Loading... |
397 "shll v20.8h, v20.8b, #8 \n" /* B */ \ | 397 "shll v20.8h, v20.8b, #8 \n" /* B */ \ |
398 "shll v21.8h, v21.8b, #8 \n" /* G */ \ | 398 "shll v21.8h, v21.8b, #8 \n" /* G */ \ |
399 "sri v0.8h, v21.8h, #5 \n" /* RG */ \ | 399 "sri v0.8h, v21.8h, #5 \n" /* RG */ \ |
400 "sri v0.8h, v20.8h, #11 \n" /* RGB */ | 400 "sri v0.8h, v20.8h, #11 \n" /* RGB */ |
401 | 401 |
402 #ifdef HAS_I422TORGB565ROW_NEON | 402 #ifdef HAS_I422TORGB565ROW_NEON |
403 void I422ToRGB565Row_NEON(const uint8* src_y, | 403 void I422ToRGB565Row_NEON(const uint8* src_y, |
404 const uint8* src_u, | 404 const uint8* src_u, |
405 const uint8* src_v, | 405 const uint8* src_v, |
406 uint8* dst_rgb565, | 406 uint8* dst_rgb565, |
407 struct YuvConstants* yuvconstants, | 407 const struct YuvConstants* yuvconstants, |
408 int width) { | 408 int width) { |
409 asm volatile ( | 409 asm volatile ( |
410 YUVTORGB_SETUP | 410 YUVTORGB_SETUP |
411 "1: \n" | 411 "1: \n" |
412 READYUV422 | 412 READYUV422 |
413 YUVTORGB(v22, v21, v20) | 413 YUVTORGB(v22, v21, v20) |
414 "subs %w4, %w4, #8 \n" | 414 "subs %w4, %w4, #8 \n" |
415 ARGBTORGB565 | 415 ARGBTORGB565 |
416 MEMACCESS(3) | 416 MEMACCESS(3) |
417 "st1 {v0.8h}, [%3], #16 \n" // store 8 pixels RGB565. | 417 "st1 {v0.8h}, [%3], #16 \n" // store 8 pixels RGB565. |
(...skipping 20 matching lines...) Expand all Loading... |
438 "shll v21.8h, v21.8b, #8 \n" /* G */ \ | 438 "shll v21.8h, v21.8b, #8 \n" /* G */ \ |
439 "sri v0.8h, v22.8h, #1 \n" /* AR */ \ | 439 "sri v0.8h, v22.8h, #1 \n" /* AR */ \ |
440 "sri v0.8h, v21.8h, #6 \n" /* ARG */ \ | 440 "sri v0.8h, v21.8h, #6 \n" /* ARG */ \ |
441 "sri v0.8h, v20.8h, #11 \n" /* ARGB */ | 441 "sri v0.8h, v20.8h, #11 \n" /* ARGB */ |
442 | 442 |
443 #ifdef HAS_I422TOARGB1555ROW_NEON | 443 #ifdef HAS_I422TOARGB1555ROW_NEON |
444 void I422ToARGB1555Row_NEON(const uint8* src_y, | 444 void I422ToARGB1555Row_NEON(const uint8* src_y, |
445 const uint8* src_u, | 445 const uint8* src_u, |
446 const uint8* src_v, | 446 const uint8* src_v, |
447 uint8* dst_argb1555, | 447 uint8* dst_argb1555, |
448 struct YuvConstants* yuvconstants, | 448 const struct YuvConstants* yuvconstants, |
449 int width) { | 449 int width) { |
450 asm volatile ( | 450 asm volatile ( |
451 YUVTORGB_SETUP | 451 YUVTORGB_SETUP |
452 "1: \n" | 452 "1: \n" |
453 READYUV422 | 453 READYUV422 |
454 YUVTORGB(v22, v21, v20) | 454 YUVTORGB(v22, v21, v20) |
455 "subs %w4, %w4, #8 \n" | 455 "subs %w4, %w4, #8 \n" |
456 "movi v23.8b, #255 \n" | 456 "movi v23.8b, #255 \n" |
457 ARGBTOARGB1555 | 457 ARGBTOARGB1555 |
458 MEMACCESS(3) | 458 MEMACCESS(3) |
(...skipping 22 matching lines...) Expand all Loading... |
481 "bic v23.8b, v23.8b, v4.8b \n" /* A */ \ | 481 "bic v23.8b, v23.8b, v4.8b \n" /* A */ \ |
482 "orr v0.8b, v20.8b, v21.8b \n" /* BG */ \ | 482 "orr v0.8b, v20.8b, v21.8b \n" /* BG */ \ |
483 "orr v1.8b, v22.8b, v23.8b \n" /* RA */ \ | 483 "orr v1.8b, v22.8b, v23.8b \n" /* RA */ \ |
484 "zip1 v0.16b, v0.16b, v1.16b \n" /* BGRA */ | 484 "zip1 v0.16b, v0.16b, v1.16b \n" /* BGRA */ |
485 | 485 |
486 #ifdef HAS_I422TOARGB4444ROW_NEON | 486 #ifdef HAS_I422TOARGB4444ROW_NEON |
487 void I422ToARGB4444Row_NEON(const uint8* src_y, | 487 void I422ToARGB4444Row_NEON(const uint8* src_y, |
488 const uint8* src_u, | 488 const uint8* src_u, |
489 const uint8* src_v, | 489 const uint8* src_v, |
490 uint8* dst_argb4444, | 490 uint8* dst_argb4444, |
491 struct YuvConstants* yuvconstants, | 491 const struct YuvConstants* yuvconstants, |
492 int width) { | 492 int width) { |
493 asm volatile ( | 493 asm volatile ( |
494 YUVTORGB_SETUP | 494 YUVTORGB_SETUP |
495 "movi v4.16b, #0x0f \n" // bits to clear with vbic. | 495 "movi v4.16b, #0x0f \n" // bits to clear with vbic. |
496 "1: \n" | 496 "1: \n" |
497 READYUV422 | 497 READYUV422 |
498 YUVTORGB(v22, v21, v20) | 498 YUVTORGB(v22, v21, v20) |
499 "subs %w4, %w4, #8 \n" | 499 "subs %w4, %w4, #8 \n" |
500 "movi v23.8b, #255 \n" | 500 "movi v23.8b, #255 \n" |
501 ARGBTOARGB4444 | 501 ARGBTOARGB4444 |
(...skipping 26 matching lines...) Expand all Loading... |
528 READYUV400 | 528 READYUV400 |
529 YUVTORGB(v22, v21, v20) | 529 YUVTORGB(v22, v21, v20) |
530 "subs %w2, %w2, #8 \n" | 530 "subs %w2, %w2, #8 \n" |
531 "movi v23.8b, #255 \n" | 531 "movi v23.8b, #255 \n" |
532 MEMACCESS(1) | 532 MEMACCESS(1) |
533 "st4 {v20.8b,v21.8b,v22.8b,v23.8b}, [%1], #32 \n" | 533 "st4 {v20.8b,v21.8b,v22.8b,v23.8b}, [%1], #32 \n" |
534 "b.gt 1b \n" | 534 "b.gt 1b \n" |
535 : "+r"(src_y), // %0 | 535 : "+r"(src_y), // %0 |
536 "+r"(dst_argb), // %1 | 536 "+r"(dst_argb), // %1 |
537 "+r"(width64) // %2 | 537 "+r"(width64) // %2 |
538 : [kUVToRB]"r"(&kYuvConstants.kUVToRB), | 538 : [kUVToRB]"r"(&kYuvIConstants.kUVToRB), |
539 [kUVToG]"r"(&kYuvConstants.kUVToG), | 539 [kUVToG]"r"(&kYuvIConstants.kUVToG), |
540 [kUVBiasBGR]"r"(&kYuvConstants.kUVBiasBGR), | 540 [kUVBiasBGR]"r"(&kYuvIConstants.kUVBiasBGR), |
541 [kYToRgb]"r"(&kYuvConstants.kYToRgb) | 541 [kYToRgb]"r"(&kYuvIConstants.kYToRgb) |
542 : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v20", | 542 : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v20", |
543 "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30" | 543 "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30" |
544 ); | 544 ); |
545 } | 545 } |
546 #endif // HAS_I400TOARGBROW_NEON | 546 #endif // HAS_I400TOARGBROW_NEON |
547 | 547 |
548 #ifdef HAS_J400TOARGBROW_NEON | 548 #ifdef HAS_J400TOARGBROW_NEON |
549 void J400ToARGBRow_NEON(const uint8* src_y, | 549 void J400ToARGBRow_NEON(const uint8* src_y, |
550 uint8* dst_argb, | 550 uint8* dst_argb, |
551 int width) { | 551 int width) { |
(...skipping 14 matching lines...) Expand all Loading... |
566 : | 566 : |
567 : "cc", "memory", "v20", "v21", "v22", "v23" | 567 : "cc", "memory", "v20", "v21", "v22", "v23" |
568 ); | 568 ); |
569 } | 569 } |
570 #endif // HAS_J400TOARGBROW_NEON | 570 #endif // HAS_J400TOARGBROW_NEON |
571 | 571 |
572 #ifdef HAS_NV12TOARGBROW_NEON | 572 #ifdef HAS_NV12TOARGBROW_NEON |
573 void NV12ToARGBRow_NEON(const uint8* src_y, | 573 void NV12ToARGBRow_NEON(const uint8* src_y, |
574 const uint8* src_uv, | 574 const uint8* src_uv, |
575 uint8* dst_argb, | 575 uint8* dst_argb, |
576 struct YuvConstants* yuvconstants, | 576 const struct YuvConstants* yuvconstants, |
577 int width) { | 577 int width) { |
578 asm volatile ( | 578 asm volatile ( |
579 YUVTORGB_SETUP | 579 YUVTORGB_SETUP |
580 "1: \n" | 580 "1: \n" |
581 READNV12 | 581 READNV12 |
582 YUVTORGB(v22, v21, v20) | 582 YUVTORGB(v22, v21, v20) |
583 "subs %w3, %w3, #8 \n" | 583 "subs %w3, %w3, #8 \n" |
584 "movi v23.8b, #255 \n" | 584 "movi v23.8b, #255 \n" |
585 MEMACCESS(2) | 585 MEMACCESS(2) |
586 "st4 {v20.8b,v21.8b,v22.8b,v23.8b}, [%2], #32 \n" | 586 "st4 {v20.8b,v21.8b,v22.8b,v23.8b}, [%2], #32 \n" |
587 "b.gt 1b \n" | 587 "b.gt 1b \n" |
588 : "+r"(src_y), // %0 | 588 : "+r"(src_y), // %0 |
589 "+r"(src_uv), // %1 | 589 "+r"(src_uv), // %1 |
590 "+r"(dst_argb), // %2 | 590 "+r"(dst_argb), // %2 |
591 "+r"(width) // %3 | 591 "+r"(width) // %3 |
592 : [kUVToRB]"r"(&yuvconstants->kUVToRB), | 592 : [kUVToRB]"r"(&yuvconstants->kUVToRB), |
593 [kUVToG]"r"(&yuvconstants->kUVToG), | 593 [kUVToG]"r"(&yuvconstants->kUVToG), |
594 [kUVBiasBGR]"r"(&yuvconstants->kUVBiasBGR), | 594 [kUVBiasBGR]"r"(&yuvconstants->kUVBiasBGR), |
595 [kYToRgb]"r"(&yuvconstants->kYToRgb) | 595 [kYToRgb]"r"(&yuvconstants->kYToRgb) |
596 : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v20", | 596 : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v20", |
597 "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30" | 597 "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30" |
598 ); | 598 ); |
599 } | 599 } |
600 #endif // HAS_NV12TOARGBROW_NEON | 600 #endif // HAS_NV12TOARGBROW_NEON |
601 | 601 |
602 #ifdef HAS_NV12TOARGBROW_NEON | 602 #ifdef HAS_NV12TOARGBROW_NEON |
603 void NV21ToARGBRow_NEON(const uint8* src_y, | 603 void NV21ToARGBRow_NEON(const uint8* src_y, |
604 const uint8* src_vu, | 604 const uint8* src_vu, |
605 uint8* dst_argb, | 605 uint8* dst_argb, |
606 struct YuvConstants* yuvconstants, | 606 const struct YuvConstants* yuvconstants, |
607 int width) { | 607 int width) { |
608 asm volatile ( | 608 asm volatile ( |
609 YUVTORGB_SETUP | 609 YUVTORGB_SETUP |
610 "1: \n" | 610 "1: \n" |
611 READNV21 | 611 READNV21 |
612 YUVTORGB(v22, v21, v20) | 612 YUVTORGB(v22, v21, v20) |
613 "subs %w3, %w3, #8 \n" | 613 "subs %w3, %w3, #8 \n" |
614 "movi v23.8b, #255 \n" | 614 "movi v23.8b, #255 \n" |
615 MEMACCESS(2) | 615 MEMACCESS(2) |
616 "st4 {v20.8b,v21.8b,v22.8b,v23.8b}, [%2], #32 \n" | 616 "st4 {v20.8b,v21.8b,v22.8b,v23.8b}, [%2], #32 \n" |
617 "b.gt 1b \n" | 617 "b.gt 1b \n" |
618 : "+r"(src_y), // %0 | 618 : "+r"(src_y), // %0 |
619 "+r"(src_vu), // %1 | 619 "+r"(src_vu), // %1 |
620 "+r"(dst_argb), // %2 | 620 "+r"(dst_argb), // %2 |
621 "+r"(width) // %3 | 621 "+r"(width) // %3 |
622 : [kUVToRB]"r"(&yuvconstants->kUVToRB), | 622 : [kUVToRB]"r"(&yuvconstants->kUVToRB), |
623 [kUVToG]"r"(&yuvconstants->kUVToG), | 623 [kUVToG]"r"(&yuvconstants->kUVToG), |
624 [kUVBiasBGR]"r"(&yuvconstants->kUVBiasBGR), | 624 [kUVBiasBGR]"r"(&yuvconstants->kUVBiasBGR), |
625 [kYToRgb]"r"(&yuvconstants->kYToRgb) | 625 [kYToRgb]"r"(&yuvconstants->kYToRgb) |
626 : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v20", | 626 : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v20", |
627 "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30" | 627 "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30" |
628 ); | 628 ); |
629 } | 629 } |
630 #endif // HAS_NV12TOARGBROW_NEON | 630 #endif // HAS_NV12TOARGBROW_NEON |
631 | 631 |
632 #ifdef HAS_NV12TORGB565ROW_NEON | 632 #ifdef HAS_NV12TORGB565ROW_NEON |
633 void NV12ToRGB565Row_NEON(const uint8* src_y, | 633 void NV12ToRGB565Row_NEON(const uint8* src_y, |
634 const uint8* src_uv, | 634 const uint8* src_uv, |
635 uint8* dst_rgb565, | 635 uint8* dst_rgb565, |
636 struct YuvConstants* yuvconstants, | 636 const struct YuvConstants* yuvconstants, |
637 int width) { | 637 int width) { |
638 asm volatile ( | 638 asm volatile ( |
639 YUVTORGB_SETUP | 639 YUVTORGB_SETUP |
640 "1: \n" | 640 "1: \n" |
641 READNV12 | 641 READNV12 |
642 YUVTORGB(v22, v21, v20) | 642 YUVTORGB(v22, v21, v20) |
643 "subs %w3, %w3, #8 \n" | 643 "subs %w3, %w3, #8 \n" |
644 ARGBTORGB565 | 644 ARGBTORGB565 |
645 MEMACCESS(2) | 645 MEMACCESS(2) |
646 "st1 {v0.8h}, [%2], 16 \n" // store 8 pixels RGB565. | 646 "st1 {v0.8h}, [%2], 16 \n" // store 8 pixels RGB565. |
647 "b.gt 1b \n" | 647 "b.gt 1b \n" |
648 : "+r"(src_y), // %0 | 648 : "+r"(src_y), // %0 |
649 "+r"(src_uv), // %1 | 649 "+r"(src_uv), // %1 |
650 "+r"(dst_rgb565), // %2 | 650 "+r"(dst_rgb565), // %2 |
651 "+r"(width) // %3 | 651 "+r"(width) // %3 |
652 : [kUVToRB]"r"(&yuvconstants->kUVToRB), | 652 : [kUVToRB]"r"(&yuvconstants->kUVToRB), |
653 [kUVToG]"r"(&yuvconstants->kUVToG), | 653 [kUVToG]"r"(&yuvconstants->kUVToG), |
654 [kUVBiasBGR]"r"(&yuvconstants->kUVBiasBGR), | 654 [kUVBiasBGR]"r"(&yuvconstants->kUVBiasBGR), |
655 [kYToRgb]"r"(&yuvconstants->kYToRgb) | 655 [kYToRgb]"r"(&yuvconstants->kYToRgb) |
656 : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v20", | 656 : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v20", |
657 "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30" | 657 "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30" |
658 ); | 658 ); |
659 } | 659 } |
660 #endif // HAS_NV12TORGB565ROW_NEON | 660 #endif // HAS_NV12TORGB565ROW_NEON |
661 | 661 |
662 #ifdef HAS_YUY2TOARGBROW_NEON | 662 #ifdef HAS_YUY2TOARGBROW_NEON |
663 void YUY2ToARGBRow_NEON(const uint8* src_yuy2, | 663 void YUY2ToARGBRow_NEON(const uint8* src_yuy2, |
664 uint8* dst_argb, | 664 uint8* dst_argb, |
665 struct YuvConstants* yuvconstants, | 665 const struct YuvConstants* yuvconstants, |
666 int width) { | 666 int width) { |
667 int64 width64 = (int64)(width); | 667 int64 width64 = (int64)(width); |
668 asm volatile ( | 668 asm volatile ( |
669 YUVTORGB_SETUP | 669 YUVTORGB_SETUP |
670 "1: \n" | 670 "1: \n" |
671 READYUY2 | 671 READYUY2 |
672 YUVTORGB(v22, v21, v20) | 672 YUVTORGB(v22, v21, v20) |
673 "subs %w2, %w2, #8 \n" | 673 "subs %w2, %w2, #8 \n" |
674 "movi v23.8b, #255 \n" | 674 "movi v23.8b, #255 \n" |
675 MEMACCESS(1) | 675 MEMACCESS(1) |
676 "st4 {v20.8b,v21.8b,v22.8b,v23.8b}, [%1], #32 \n" | 676 "st4 {v20.8b,v21.8b,v22.8b,v23.8b}, [%1], #32 \n" |
677 "b.gt 1b \n" | 677 "b.gt 1b \n" |
678 : "+r"(src_yuy2), // %0 | 678 : "+r"(src_yuy2), // %0 |
679 "+r"(dst_argb), // %1 | 679 "+r"(dst_argb), // %1 |
680 "+r"(width64) // %2 | 680 "+r"(width64) // %2 |
681 : [kUVToRB]"r"(&yuvconstants->kUVToRB), | 681 : [kUVToRB]"r"(&yuvconstants->kUVToRB), |
682 [kUVToG]"r"(&yuvconstants->kUVToG), | 682 [kUVToG]"r"(&yuvconstants->kUVToG), |
683 [kUVBiasBGR]"r"(&yuvconstants->kUVBiasBGR), | 683 [kUVBiasBGR]"r"(&yuvconstants->kUVBiasBGR), |
684 [kYToRgb]"r"(&yuvconstants->kYToRgb) | 684 [kYToRgb]"r"(&yuvconstants->kYToRgb) |
685 : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v20", | 685 : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v20", |
686 "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30" | 686 "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30" |
687 ); | 687 ); |
688 } | 688 } |
689 #endif // HAS_YUY2TOARGBROW_NEON | 689 #endif // HAS_YUY2TOARGBROW_NEON |
690 | 690 |
691 #ifdef HAS_UYVYTOARGBROW_NEON | 691 #ifdef HAS_UYVYTOARGBROW_NEON |
692 void UYVYToARGBRow_NEON(const uint8* src_uyvy, | 692 void UYVYToARGBRow_NEON(const uint8* src_uyvy, |
693 uint8* dst_argb, | 693 uint8* dst_argb, |
694 struct YuvConstants* yuvconstants, | 694 const struct YuvConstants* yuvconstants, |
695 int width) { | 695 int width) { |
696 int64 width64 = (int64)(width); | 696 int64 width64 = (int64)(width); |
697 asm volatile ( | 697 asm volatile ( |
698 YUVTORGB_SETUP | 698 YUVTORGB_SETUP |
699 "1: \n" | 699 "1: \n" |
700 READUYVY | 700 READUYVY |
701 YUVTORGB(v22, v21, v20) | 701 YUVTORGB(v22, v21, v20) |
702 "subs %w2, %w2, #8 \n" | 702 "subs %w2, %w2, #8 \n" |
703 "movi v23.8b, #255 \n" | 703 "movi v23.8b, #255 \n" |
704 MEMACCESS(1) | 704 MEMACCESS(1) |
(...skipping 2367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3072 : "cc", "memory", "v0", "v1", "v2", "v3" // Clobber List | 3072 : "cc", "memory", "v0", "v1", "v2", "v3" // Clobber List |
3073 ); | 3073 ); |
3074 } | 3074 } |
3075 #endif // HAS_SOBELYROW_NEON | 3075 #endif // HAS_SOBELYROW_NEON |
3076 #endif // !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__) | 3076 #endif // !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__) |
3077 | 3077 |
3078 #ifdef __cplusplus | 3078 #ifdef __cplusplus |
3079 } // extern "C" | 3079 } // extern "C" |
3080 } // namespace libyuv | 3080 } // namespace libyuv |
3081 #endif | 3081 #endif |
OLD | NEW |