• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright 2013 The LibYuv Project Authors. All rights reserved.
3  *
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
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS. All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #ifndef INCLUDE_LIBYUV_ROTATE_ROW_H_  // NOLINT
12 #define INCLUDE_LIBYUV_ROTATE_ROW_H_
13 
14 #include "libyuv/basic_types.h"
15 
16 #ifdef __cplusplus
17 namespace libyuv {
18 extern "C" {
19 #endif
20 
21 #if defined(__pnacl__) || defined(__CLR_VER) || \
22     (defined(__i386__) && !defined(__SSE2__))
23 #define LIBYUV_DISABLE_X86
24 #endif
25 
26 // Visual C 2012 required for AVX2.
27 #if defined(_M_IX86) && !defined(__clang__) && \
28     defined(_MSC_VER) && _MSC_VER >= 1700
29 #define VISUALC_HAS_AVX2 1
30 #endif  // VisualStudio >= 2012
31 
32 // TODO(fbarchard): switch to standard form of inline; fails on clangcl.
33 #if !defined(LIBYUV_DISABLE_X86) && \
34     (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__))
35 #if defined(__APPLE__) && defined(__i386__)
36 #define DECLARE_FUNCTION(name)                                                 \
37     ".text                                     \n"                             \
38     ".private_extern _" #name "                \n"                             \
39     ".align 4,0x90                             \n"                             \
40 "_" #name ":                                   \n"
41 #elif defined(__MINGW32__) || defined(__CYGWIN__) && defined(__i386__)
42 #define DECLARE_FUNCTION(name)                                                 \
43     ".text                                     \n"                             \
44     ".align 4,0x90                             \n"                             \
45 "_" #name ":                                   \n"
46 #else
47 #define DECLARE_FUNCTION(name)                                                 \
48     ".text                                     \n"                             \
49     ".align 4,0x90                             \n"                             \
50 #name ":                                       \n"
51 #endif
52 #endif
53 
54 // The following are available for Visual C:
55 #if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && \
56     defined(_MSC_VER) && !defined(__clang__)
57 #define HAS_TRANSPOSEWX8_SSSE3
58 #define HAS_TRANSPOSEUVWX8_SSE2
59 #endif
60 
61 // The following are available for GCC but not NaCL:
62 #if !defined(LIBYUV_DISABLE_X86) && \
63     (defined(__i386__) || (defined(__x86_64__) && !defined(__native_client__)))
64 #define HAS_TRANSPOSEWX8_SSSE3
65 #endif
66 
67 // The following are available for 32 bit GCC:
68 #if !defined(LIBYUV_DISABLE_X86) && defined(__i386__)  && !defined(__clang__)
69 #define HAS_TRANSPOSEUVWX8_SSE2
70 #endif
71 
72 // The following are available for 64 bit GCC but not NaCL:
73 #if !defined(LIBYUV_DISABLE_X86) && !defined(__native_client__) && \
74     defined(__x86_64__)
75 #define HAS_TRANSPOSEWX8_FAST_SSSE3
76 #define HAS_TRANSPOSEUVWX8_SSE2
77 #endif
78 
79 #if !defined(LIBYUV_DISABLE_NEON) && !defined(__native_client__) && \
80     (defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__))
81 #define HAS_TRANSPOSEWX8_NEON
82 #define HAS_TRANSPOSEUVWX8_NEON
83 #endif
84 
85 #if !defined(LIBYUV_DISABLE_MIPS) && !defined(__native_client__) && \
86     defined(__mips__) && \
87     defined(__mips_dsp) && (__mips_dsp_rev >= 2)
88 #define HAS_TRANSPOSEWX8_MIPS_DSPR2
89 #define HAS_TRANSPOSEUVWx8_MIPS_DSPR2
90 #endif  // defined(__mips__)
91 
92 void TransposeWxH_C(const uint8* src, int src_stride,
93                     uint8* dst, int dst_stride, int width, int height);
94 
95 void TransposeWx8_C(const uint8* src, int src_stride,
96                     uint8* dst, int dst_stride, int width);
97 void TransposeWx8_NEON(const uint8* src, int src_stride,
98                        uint8* dst, int dst_stride, int width);
99 void TransposeWx8_SSSE3(const uint8* src, int src_stride,
100                         uint8* dst, int dst_stride, int width);
101 void TransposeWx8_Fast_SSSE3(const uint8* src, int src_stride,
102                              uint8* dst, int dst_stride, int width);
103 void TransposeWx8_MIPS_DSPR2(const uint8* src, int src_stride,
104                              uint8* dst, int dst_stride, int width);
105 
106 void TransposeWx8_Any_NEON(const uint8* src, int src_stride,
107                            uint8* dst, int dst_stride, int width);
108 void TransposeWx8_Any_SSSE3(const uint8* src, int src_stride,
109                             uint8* dst, int dst_stride, int width);
110 void TransposeWx8_Fast_Any_SSSE3(const uint8* src, int src_stride,
111                                  uint8* dst, int dst_stride, int width);
112 void TransposeWx8_Any_MIPS_DSPR2(const uint8* src, int src_stride,
113                                  uint8* dst, int dst_stride, int width);
114 
115 void TransposeUVWxH_C(const uint8* src, int src_stride,
116                       uint8* dst_a, int dst_stride_a,
117                       uint8* dst_b, int dst_stride_b,
118                       int width, int height);
119 
120 void TransposeUVWx8_C(const uint8* src, int src_stride,
121                       uint8* dst_a, int dst_stride_a,
122                       uint8* dst_b, int dst_stride_b, int width);
123 void TransposeUVWx8_SSE2(const uint8* src, int src_stride,
124                          uint8* dst_a, int dst_stride_a,
125                          uint8* dst_b, int dst_stride_b, int width);
126 void TransposeUVWx8_NEON(const uint8* src, int src_stride,
127                          uint8* dst_a, int dst_stride_a,
128                          uint8* dst_b, int dst_stride_b, int width);
129 void TransposeUVWx8_MIPS_DSPR2(const uint8* src, int src_stride,
130                                uint8* dst_a, int dst_stride_a,
131                                uint8* dst_b, int dst_stride_b, int width);
132 
133 #ifdef __cplusplus
134 }  // extern "C"
135 }  // namespace libyuv
136 #endif
137 
138 #endif  // INCLUDE_LIBYUV_ROTATE_ROW_H_  NOLINT
139