OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 The LibYuv Project Authors. All rights reserved. | 2 * Copyright 2011 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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 : [kUVToRB]"r"(&yuvconstants->kUVToRB), | 310 : [kUVToRB]"r"(&yuvconstants->kUVToRB), |
311 [kUVToG]"r"(&yuvconstants->kUVToG), | 311 [kUVToG]"r"(&yuvconstants->kUVToG), |
312 [kUVBiasBGR]"r"(&yuvconstants->kUVBiasBGR), | 312 [kUVBiasBGR]"r"(&yuvconstants->kUVBiasBGR), |
313 [kYToRgb]"r"(&yuvconstants->kYToRgb) | 313 [kYToRgb]"r"(&yuvconstants->kYToRgb) |
314 : "cc", "memory", "q0", "q1", "q2", "q3", "q4", | 314 : "cc", "memory", "q0", "q1", "q2", "q3", "q4", |
315 "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15" | 315 "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15" |
316 ); | 316 ); |
317 } | 317 } |
318 | 318 |
319 #define ARGBTORGB565 \ | 319 #define ARGBTORGB565 \ |
320 "vshr.u8 d20, d20, #3 \n" /* B */ \ | 320 "vshll.u8 q0, d22, #8 \n" /* R */ \ |
321 "vshr.u8 d21, d21, #2 \n" /* G */ \ | 321 "vshll.u8 q8, d21, #8 \n" /* G */ \ |
322 "vshr.u8 d22, d22, #3 \n" /* R */ \ | 322 "vshll.u8 q9, d20, #8 \n" /* B */ \ |
323 "vmovl.u8 q8, d20 \n" /* B */ \ | 323 "vsri.16 q0, q8, #5 \n" /* RG */ \ |
324 "vmovl.u8 q9, d21 \n" /* G */ \ | 324 "vsri.16 q0, q9, #11 \n" /* RGB */ |
325 "vmovl.u8 q10, d22 \n" /* R */ \ | |
326 "vshl.u16 q9, q9, #5 \n" /* G */ \ | |
327 "vshl.u16 q10, q10, #11 \n" /* R */ \ | |
328 "vorr q0, q8, q9 \n" /* BG */ \ | |
329 "vorr q0, q0, q10 \n" /* BGR */ | |
330 | 325 |
331 void I422ToRGB565Row_NEON(const uint8* src_y, | 326 void I422ToRGB565Row_NEON(const uint8* src_y, |
332 const uint8* src_u, | 327 const uint8* src_u, |
333 const uint8* src_v, | 328 const uint8* src_v, |
334 uint8* dst_rgb565, | 329 uint8* dst_rgb565, |
335 const struct YuvConstants* yuvconstants, | 330 const struct YuvConstants* yuvconstants, |
336 int width) { | 331 int width) { |
337 asm volatile ( | 332 asm volatile ( |
338 YUVTORGB_SETUP | 333 YUVTORGB_SETUP |
339 "1: \n" | 334 "1: \n" |
(...skipping 12 matching lines...) Expand all Loading... |
352 : [kUVToRB]"r"(&yuvconstants->kUVToRB), | 347 : [kUVToRB]"r"(&yuvconstants->kUVToRB), |
353 [kUVToG]"r"(&yuvconstants->kUVToG), | 348 [kUVToG]"r"(&yuvconstants->kUVToG), |
354 [kUVBiasBGR]"r"(&yuvconstants->kUVBiasBGR), | 349 [kUVBiasBGR]"r"(&yuvconstants->kUVBiasBGR), |
355 [kYToRgb]"r"(&yuvconstants->kYToRgb) | 350 [kYToRgb]"r"(&yuvconstants->kYToRgb) |
356 : "cc", "memory", "q0", "q1", "q2", "q3", "q4", | 351 : "cc", "memory", "q0", "q1", "q2", "q3", "q4", |
357 "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15" | 352 "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15" |
358 ); | 353 ); |
359 } | 354 } |
360 | 355 |
361 #define ARGBTOARGB1555 \ | 356 #define ARGBTOARGB1555 \ |
362 "vshr.u8 q10, q10, #3 \n" /* B */ \ | 357 "vshll.u8 q0, d23, #8 \n" /* A */ \ |
363 "vshr.u8 d22, d22, #3 \n" /* R */ \ | 358 "vshll.u8 q8, d22, #8 \n" /* R */ \ |
364 "vshr.u8 d23, d23, #7 \n" /* A */ \ | 359 "vshll.u8 q9, d21, #8 \n" /* G */ \ |
365 "vmovl.u8 q8, d20 \n" /* B */ \ | 360 "vshll.u8 q10, d20, #8 \n" /* B */ \ |
366 "vmovl.u8 q9, d21 \n" /* G */ \ | 361 "vsri.16 q0, q8, #1 \n" /* AR */ \ |
367 "vmovl.u8 q10, d22 \n" /* R */ \ | 362 "vsri.16 q0, q9, #6 \n" /* ARG */ \ |
368 "vmovl.u8 q11, d23 \n" /* A */ \ | 363 "vsri.16 q0, q10, #11 \n" /* ARGB */ |
369 "vshl.u16 q9, q9, #5 \n" /* G */ \ | |
370 "vshl.u16 q10, q10, #10 \n" /* R */ \ | |
371 "vshl.u16 q11, q11, #15 \n" /* A */ \ | |
372 "vorr q0, q8, q9 \n" /* BG */ \ | |
373 "vorr q1, q10, q11 \n" /* RA */ \ | |
374 "vorr q0, q0, q1 \n" /* BGRA */ | |
375 | 364 |
376 void I422ToARGB1555Row_NEON(const uint8* src_y, | 365 void I422ToARGB1555Row_NEON(const uint8* src_y, |
377 const uint8* src_u, | 366 const uint8* src_u, |
378 const uint8* src_v, | 367 const uint8* src_v, |
379 uint8* dst_argb1555, | 368 uint8* dst_argb1555, |
380 const struct YuvConstants* yuvconstants, | 369 const struct YuvConstants* yuvconstants, |
381 int width) { | 370 int width) { |
382 asm volatile ( | 371 asm volatile ( |
383 YUVTORGB_SETUP | 372 YUVTORGB_SETUP |
384 "1: \n" | 373 "1: \n" |
(...skipping 2445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2830 "r"(6) // %5 | 2819 "r"(6) // %5 |
2831 : "cc", "memory", "q0", "q1" // Clobber List | 2820 : "cc", "memory", "q0", "q1" // Clobber List |
2832 ); | 2821 ); |
2833 } | 2822 } |
2834 #endif // defined(__ARM_NEON__) && !defined(__aarch64__) | 2823 #endif // defined(__ARM_NEON__) && !defined(__aarch64__) |
2835 | 2824 |
2836 #ifdef __cplusplus | 2825 #ifdef __cplusplus |
2837 } // extern "C" | 2826 } // extern "C" |
2838 } // namespace libyuv | 2827 } // namespace libyuv |
2839 #endif | 2828 #endif |
OLD | NEW |