OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 The LibYuv Project Authors. All rights reserved. | 2 * Copyright 2013 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 |
11 #ifndef INCLUDE_LIBYUV_SCALE_ROW_H_ // NOLINT | 11 #ifndef INCLUDE_LIBYUV_SCALE_ROW_H_ // NOLINT |
12 #define INCLUDE_LIBYUV_SCALE_ROW_H_ | 12 #define INCLUDE_LIBYUV_SCALE_ROW_H_ |
13 | 13 |
14 #include "libyuv/basic_types.h" | 14 #include "libyuv/basic_types.h" |
15 #include "libyuv/scale.h" | 15 #include "libyuv/scale.h" |
16 | 16 |
17 #ifdef __cplusplus | 17 #ifdef __cplusplus |
18 namespace libyuv { | 18 namespace libyuv { |
19 extern "C" { | 19 extern "C" { |
20 #endif | 20 #endif |
21 | 21 |
22 #if defined(__pnacl__) || defined(__CLR_VER) || \ | 22 #if defined(__pnacl__) || defined(__CLR_VER) || \ |
23 (defined(__i386__) && !defined(__SSE2__)) | 23 (defined(__i386__) && !defined(__SSE2__)) |
24 #define LIBYUV_DISABLE_X86 | 24 #define LIBYUV_DISABLE_X86 |
25 #endif | 25 #endif |
26 | 26 |
27 // Visual C 2012 required for AVX2. | 27 // GCC >= 4.7.0 required for AVX2. |
28 #if defined(_M_IX86) && !defined(__clang__) && \ | 28 #if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__)) |
29 defined(_MSC_VER) && _MSC_VER >= 1700 | 29 #if (__GNUC__ > 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 7)) |
30 #define VISUALC_HAS_AVX2 1 | 30 #define GCC_HAS_AVX2 1 |
31 #endif // VisualStudio >= 2012 | 31 #endif // GNUC >= 4.7 |
| 32 #endif // __GNUC__ |
32 | 33 |
33 // clang >= 3.4.0 required for AVX2. | 34 // clang >= 3.4.0 required for AVX2. |
34 #if defined(__clang__) && (defined(__x86_64__) || defined(__i386__)) | 35 #if defined(__clang__) && (defined(__x86_64__) || defined(__i386__)) |
35 #if (__clang_major__ > 3) || (__clang_major__ == 3 && (__clang_minor__ >= 4)) | 36 #if (__clang_major__ > 3) || (__clang_major__ == 3 && (__clang_minor__ >= 4)) |
36 #define CLANG_HAS_AVX2 1 | 37 #define CLANG_HAS_AVX2 1 |
37 #endif // clang >= 3.4 | 38 #endif // clang >= 3.4 |
38 #endif // __clang__ | 39 #endif // __clang__ |
39 | 40 |
| 41 // Visual C 2012 required for AVX2. |
| 42 #if defined(_M_IX86) && !defined(__clang__) && \ |
| 43 defined(_MSC_VER) && _MSC_VER >= 1700 |
| 44 #define VISUALC_HAS_AVX2 1 |
| 45 #endif // VisualStudio >= 2012 |
| 46 |
40 // The following are available on all x86 platforms: | 47 // The following are available on all x86 platforms: |
41 #if !defined(LIBYUV_DISABLE_X86) && \ | 48 #if !defined(LIBYUV_DISABLE_X86) && \ |
42 (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)) | 49 (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)) |
43 #define HAS_FIXEDDIV1_X86 | 50 #define HAS_FIXEDDIV1_X86 |
44 #define HAS_FIXEDDIV_X86 | 51 #define HAS_FIXEDDIV_X86 |
45 #define HAS_SCALEARGBCOLS_SSE2 | 52 #define HAS_SCALEARGBCOLS_SSE2 |
46 #define HAS_SCALEARGBCOLSUP2_SSE2 | 53 #define HAS_SCALEARGBCOLSUP2_SSE2 |
47 #define HAS_SCALEARGBFILTERCOLS_SSSE3 | 54 #define HAS_SCALEARGBFILTERCOLS_SSSE3 |
48 #define HAS_SCALEARGBROWDOWN2_SSE2 | 55 #define HAS_SCALEARGBROWDOWN2_SSE2 |
49 #define HAS_SCALEARGBROWDOWNEVEN_SSE2 | 56 #define HAS_SCALEARGBROWDOWNEVEN_SSE2 |
50 #define HAS_SCALECOLSUP2_SSE2 | 57 #define HAS_SCALECOLSUP2_SSE2 |
51 #define HAS_SCALEFILTERCOLS_SSSE3 | 58 #define HAS_SCALEFILTERCOLS_SSSE3 |
52 #define HAS_SCALEROWDOWN2_SSE2 | 59 #define HAS_SCALEROWDOWN2_SSE2 |
53 #define HAS_SCALEROWDOWN34_SSSE3 | 60 #define HAS_SCALEROWDOWN34_SSSE3 |
54 #define HAS_SCALEROWDOWN38_SSSE3 | 61 #define HAS_SCALEROWDOWN38_SSSE3 |
55 #define HAS_SCALEROWDOWN4_SSE2 | 62 #define HAS_SCALEROWDOWN4_SSE2 |
56 #define HAS_SCALEADDROW_SSE2 | 63 #define HAS_SCALEADDROW_SSE2 |
57 #endif | 64 #endif |
58 | 65 |
| 66 // The following are available on all x86 platforms, but |
| 67 // require VS2012, clang 3.4 or gcc 4.7. |
| 68 // The code supports NaCL but requires a new compiler and validator. |
| 69 #if !defined(LIBYUV_DISABLE_X86) && (defined(VISUALC_HAS_AVX2) || \ |
| 70 defined(CLANG_HAS_AVX2) || defined(GCC_HAS_AVX2)) |
| 71 #define HAS_SCALEADDROW_AVX2 |
| 72 #endif |
| 73 |
59 // The following are available for Visual C and clangcl 32 bit: | 74 // The following are available for Visual C and clangcl 32 bit: |
60 #if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && \ | 75 #if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && \ |
61 (defined(VISUALC_HAS_AVX2) || defined(CLANG_HAS_AVX2)) | 76 (defined(VISUALC_HAS_AVX2) || defined(CLANG_HAS_AVX2)) |
62 #define HAS_SCALEADDROW_AVX2 | |
63 #define HAS_SCALEROWDOWN2_AVX2 | 77 #define HAS_SCALEROWDOWN2_AVX2 |
64 #define HAS_SCALEROWDOWN4_AVX2 | 78 #define HAS_SCALEROWDOWN4_AVX2 |
65 #endif | 79 #endif |
66 | 80 |
67 // The following are available on Neon platforms: | 81 // The following are available on Neon platforms: |
68 #if !defined(LIBYUV_DISABLE_NEON) && !defined(__native_client__) && \ | 82 #if !defined(LIBYUV_DISABLE_NEON) && !defined(__native_client__) && \ |
69 (defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__)) | 83 (defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__)) |
70 #define HAS_SCALEARGBCOLS_NEON | 84 #define HAS_SCALEARGBCOLS_NEON |
71 #define HAS_SCALEARGBROWDOWN2_NEON | 85 #define HAS_SCALEARGBROWDOWN2_NEON |
72 #define HAS_SCALEARGBROWDOWNEVEN_NEON | 86 #define HAS_SCALEARGBROWDOWNEVEN_NEON |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 void ScaleRowDown38_3_Box_MIPS_DSPR2(const uint8* src_ptr, | 487 void ScaleRowDown38_3_Box_MIPS_DSPR2(const uint8* src_ptr, |
474 ptrdiff_t src_stride, | 488 ptrdiff_t src_stride, |
475 uint8* dst_ptr, int dst_width); | 489 uint8* dst_ptr, int dst_width); |
476 | 490 |
477 #ifdef __cplusplus | 491 #ifdef __cplusplus |
478 } // extern "C" | 492 } // extern "C" |
479 } // namespace libyuv | 493 } // namespace libyuv |
480 #endif | 494 #endif |
481 | 495 |
482 #endif // INCLUDE_LIBYUV_SCALE_ROW_H_ NOLINT | 496 #endif // INCLUDE_LIBYUV_SCALE_ROW_H_ NOLINT |
OLD | NEW |