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 2693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2704 : "+r"(src_y0), // %0 | 2704 : "+r"(src_y0), // %0 |
2705 "+r"(src_y1), // %1 | 2705 "+r"(src_y1), // %1 |
2706 "+r"(dst_sobely), // %2 | 2706 "+r"(dst_sobely), // %2 |
2707 "+r"(width) // %3 | 2707 "+r"(width) // %3 |
2708 : "r"(1LL), // %4 | 2708 : "r"(1LL), // %4 |
2709 "r"(6LL) // %5 | 2709 "r"(6LL) // %5 |
2710 : "cc", "memory", "v0", "v1", "v2", "v3" // Clobber List | 2710 : "cc", "memory", "v0", "v1", "v2", "v3" // Clobber List |
2711 ); | 2711 ); |
2712 } | 2712 } |
2713 | 2713 |
| 2714 // Caveat - rounds float to half float whereas scaling version truncates. |
2714 void HalfFloat1Row_NEON(const uint16* src, uint16* dst, float, int width) { | 2715 void HalfFloat1Row_NEON(const uint16* src, uint16* dst, float, int width) { |
2715 asm volatile ( | 2716 asm volatile ( |
2716 "1: \n" | 2717 "1: \n" |
2717 MEMACCESS(0) | 2718 MEMACCESS(0) |
2718 "ld1 {v1.16b}, [%0], #16 \n" // load 8 shorts | 2719 "ld1 {v1.16b}, [%0], #16 \n" // load 8 shorts |
2719 "subs %w2, %w2, #8 \n" // 8 pixels per loop | 2720 "subs %w2, %w2, #8 \n" // 8 pixels per loop |
2720 "uxtl v2.4s, v1.4h \n" // 8 int's | 2721 "uxtl v2.4s, v1.4h \n" // 8 int's |
2721 "uxtl2 v3.4s, v1.8h \n" | 2722 "uxtl2 v3.4s, v1.8h \n" |
2722 "scvtf v2.4s, v2.4s \n" // 8 floats | 2723 "scvtf v2.4s, v2.4s \n" // 8 floats |
2723 "scvtf v3.4s, v3.4s \n" | 2724 "scvtf v3.4s, v3.4s \n" |
2724 "fcvtn v1.4h, v2.4s \n" // 8 floatsgit | 2725 "fcvtn v1.4h, v2.4s \n" // 8 half floats |
2725 "fcvtn2 v1.8h, v3.4s \n" | 2726 "fcvtn2 v1.8h, v3.4s \n" |
2726 MEMACCESS(1) | 2727 MEMACCESS(1) |
2727 "st1 {v1.16b}, [%1], #16 \n" // store 8 shorts | 2728 "st1 {v1.16b}, [%1], #16 \n" // store 8 shorts |
2728 "b.gt 1b \n" | 2729 "b.gt 1b \n" |
2729 : "+r"(src), // %0 | 2730 : "+r"(src), // %0 |
2730 "+r"(dst), // %1 | 2731 "+r"(dst), // %1 |
2731 "+r"(width) // %2 | 2732 "+r"(width) // %2 |
2732 : | 2733 : |
2733 : "cc", "memory", "v1", "v2", "v3" | 2734 : "cc", "memory", "v1", "v2", "v3" |
2734 ); | 2735 ); |
(...skipping 23 matching lines...) Expand all Loading... |
2758 : "cc", "memory", "v1", "v2", "v3" | 2759 : "cc", "memory", "v1", "v2", "v3" |
2759 ); | 2760 ); |
2760 } | 2761 } |
2761 | 2762 |
2762 #endif // !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__) | 2763 #endif // !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__) |
2763 | 2764 |
2764 #ifdef __cplusplus | 2765 #ifdef __cplusplus |
2765 } // extern "C" | 2766 } // extern "C" |
2766 } // namespace libyuv | 2767 } // namespace libyuv |
2767 #endif | 2768 #endif |
OLD | NEW |