OLD | NEW |
1 // VERSION 2 | 1 // VERSION 2 |
2 /* | 2 /* |
3 * Copyright 2011 The LibYuv Project Authors. All rights reserved. | 3 * Copyright 2011 The LibYuv Project Authors. All rights reserved. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license | 5 * Use of this source code is governed by a BSD-style license |
6 * that can be found in the LICENSE file in the root of the source | 6 * that can be found in the LICENSE file in the root of the source |
7 * tree. An additional intellectual property rights grant can be found | 7 * tree. An additional intellectual property rights grant can be found |
8 * in the file PATENTS. All contributing project authors may | 8 * in the file PATENTS. All contributing project authors may |
9 * be found in the AUTHORS file in the root of the source tree. | 9 * be found in the AUTHORS file in the root of the source tree. |
10 */ | 10 */ |
(...skipping 2503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2514 : "+r"(src), // %0 | 2514 : "+r"(src), // %0 |
2515 "+r"(dst), // %1 | 2515 "+r"(dst), // %1 |
2516 "+r"(temp_width) // %2 | 2516 "+r"(temp_width) // %2 |
2517 : "m"(kShuffleMirror) // %3 | 2517 : "m"(kShuffleMirror) // %3 |
2518 : "memory", "cc", NACL_R14 | 2518 : "memory", "cc", NACL_R14 |
2519 "xmm0", "xmm5" | 2519 "xmm0", "xmm5" |
2520 ); | 2520 ); |
2521 } | 2521 } |
2522 #endif // HAS_MIRRORROW_AVX2 | 2522 #endif // HAS_MIRRORROW_AVX2 |
2523 | 2523 |
2524 #ifdef HAS_MIRRORROW_UV_SSSE3 | 2524 #ifdef HAS_MIRRORUVROW_SSSE3 |
2525 // Shuffle table for reversing the bytes of UV channels. | 2525 // Shuffle table for reversing the bytes of UV channels. |
2526 static uvec8 kShuffleMirrorUV = { | 2526 static uvec8 kShuffleMirrorUV = { |
2527 14u, 12u, 10u, 8u, 6u, 4u, 2u, 0u, 15u, 13u, 11u, 9u, 7u, 5u, 3u, 1u | 2527 14u, 12u, 10u, 8u, 6u, 4u, 2u, 0u, 15u, 13u, 11u, 9u, 7u, 5u, 3u, 1u |
2528 }; | 2528 }; |
2529 void MirrorUVRow_SSSE3(const uint8* src, uint8* dst_u, uint8* dst_v, | 2529 void MirrorUVRow_SSSE3(const uint8* src, uint8* dst_u, uint8* dst_v, |
2530 int width) { | 2530 int width) { |
2531 intptr_t temp_width = (intptr_t)(width); | 2531 intptr_t temp_width = (intptr_t)(width); |
2532 asm volatile ( | 2532 asm volatile ( |
2533 "movdqa %4,%%xmm1 \n" | 2533 "movdqa %4,%%xmm1 \n" |
2534 "lea " MEMLEA4(-0x10,0,3,2) ",%0 \n" | 2534 "lea " MEMLEA4(-0x10,0,3,2) ",%0 \n" |
(...skipping 10 matching lines...) Expand all Loading... |
2545 "jg 1b \n" | 2545 "jg 1b \n" |
2546 : "+r"(src), // %0 | 2546 : "+r"(src), // %0 |
2547 "+r"(dst_u), // %1 | 2547 "+r"(dst_u), // %1 |
2548 "+r"(dst_v), // %2 | 2548 "+r"(dst_v), // %2 |
2549 "+r"(temp_width) // %3 | 2549 "+r"(temp_width) // %3 |
2550 : "m"(kShuffleMirrorUV) // %4 | 2550 : "m"(kShuffleMirrorUV) // %4 |
2551 : "memory", "cc", NACL_R14 | 2551 : "memory", "cc", NACL_R14 |
2552 "xmm0", "xmm1" | 2552 "xmm0", "xmm1" |
2553 ); | 2553 ); |
2554 } | 2554 } |
2555 #endif // HAS_MIRRORROW_UV_SSSE3 | 2555 #endif // HAS_MIRRORUVROW_SSSE3 |
2556 | 2556 |
2557 #ifdef HAS_ARGBMIRRORROW_SSE2 | 2557 #ifdef HAS_ARGBMIRRORROW_SSE2 |
2558 | 2558 |
2559 void ARGBMirrorRow_SSE2(const uint8* src, uint8* dst, int width) { | 2559 void ARGBMirrorRow_SSE2(const uint8* src, uint8* dst, int width) { |
2560 intptr_t temp_width = (intptr_t)(width); | 2560 intptr_t temp_width = (intptr_t)(width); |
2561 asm volatile ( | 2561 asm volatile ( |
2562 "lea " MEMLEA4(-0x10,0,2,4) ",%0 \n" | 2562 "lea " MEMLEA4(-0x10,0,2,4) ",%0 \n" |
2563 LABELALIGN | 2563 LABELALIGN |
2564 "1: \n" | 2564 "1: \n" |
2565 "movdqu " MEMACCESS(0) ",%%xmm0 \n" | 2565 "movdqu " MEMACCESS(0) ",%%xmm0 \n" |
(...skipping 2877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5443 ); | 5443 ); |
5444 } | 5444 } |
5445 #endif // HAS_ARGBLUMACOLORTABLEROW_SSSE3 | 5445 #endif // HAS_ARGBLUMACOLORTABLEROW_SSSE3 |
5446 | 5446 |
5447 #endif // defined(__x86_64__) || defined(__i386__) | 5447 #endif // defined(__x86_64__) || defined(__i386__) |
5448 | 5448 |
5449 #ifdef __cplusplus | 5449 #ifdef __cplusplus |
5450 } // extern "C" | 5450 } // extern "C" |
5451 } // namespace libyuv | 5451 } // namespace libyuv |
5452 #endif | 5452 #endif |
OLD | NEW |