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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 #if defined(__native_client__) | 49 #if defined(__native_client__) |
50 #define LIBYUV_DISABLE_NEON | 50 #define LIBYUV_DISABLE_NEON |
51 #endif | 51 #endif |
52 // clang >= 3.5.0 required for Arm64. | 52 // clang >= 3.5.0 required for Arm64. |
53 #if defined(__clang__) && defined(__aarch64__) && !defined(LIBYUV_DISABLE_NEON) | 53 #if defined(__clang__) && defined(__aarch64__) && !defined(LIBYUV_DISABLE_NEON) |
54 #if (__clang_major__ < 3) || (__clang_major__ == 3 && (__clang_minor__ < 5)) | 54 #if (__clang_major__ < 3) || (__clang_major__ == 3 && (__clang_minor__ < 5)) |
55 #define LIBYUV_DISABLE_NEON | 55 #define LIBYUV_DISABLE_NEON |
56 #endif // clang >= 3.5 | 56 #endif // clang >= 3.5 |
57 #endif // __clang__ | 57 #endif // __clang__ |
58 | 58 |
| 59 // GCC >= 4.7.0 required for AVX2. |
| 60 #if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__)) |
| 61 #if (__GNUC__ > 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 7)) |
| 62 #define GCC_HAS_AVX2 1 |
| 63 #endif // GNUC >= 4.7 |
| 64 #endif // __GNUC__ |
| 65 |
| 66 // clang >= 3.4.0 required for AVX2. |
| 67 #if defined(__clang__) && (defined(__x86_64__) || defined(__i386__)) |
| 68 #if (__clang_major__ > 3) || (__clang_major__ == 3 && (__clang_minor__ >= 4)) |
| 69 #define CLANG_HAS_AVX2 1 |
| 70 #endif // clang >= 3.4 |
| 71 #endif // __clang__ |
| 72 |
| 73 // Visual C 2012 required for AVX2. |
| 74 #if defined(_M_IX86) && !defined(__clang__) && \ |
| 75 defined(_MSC_VER) && _MSC_VER >= 1700 |
| 76 #define VISUALC_HAS_AVX2 1 |
| 77 #endif // VisualStudio >= 2012 |
| 78 |
59 // The following are available on all x86 platforms: | 79 // The following are available on all x86 platforms: |
60 #if !defined(LIBYUV_DISABLE_X86) && \ | 80 #if !defined(LIBYUV_DISABLE_X86) && \ |
61 (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)) | 81 (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)) |
62 // Conversions: | 82 // Conversions: |
63 #define HAS_ABGRTOUVROW_SSSE3 | 83 #define HAS_ABGRTOUVROW_SSSE3 |
64 #define HAS_ABGRTOYROW_SSSE3 | 84 #define HAS_ABGRTOYROW_SSSE3 |
65 #define HAS_ARGB1555TOARGBROW_SSE2 | 85 #define HAS_ARGB1555TOARGBROW_SSE2 |
66 #define HAS_ARGB4444TOARGBROW_SSE2 | 86 #define HAS_ARGB4444TOARGBROW_SSE2 |
67 #define HAS_ARGBSETROW_X86 | 87 #define HAS_ARGBSETROW_X86 |
68 #define HAS_ARGBSHUFFLEROW_SSE2 | 88 #define HAS_ARGBSHUFFLEROW_SSE2 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 #define HAS_INTERPOLATEROW_SSSE3 | 176 #define HAS_INTERPOLATEROW_SSSE3 |
157 #define HAS_RGBCOLORTABLEROW_X86 | 177 #define HAS_RGBCOLORTABLEROW_X86 |
158 #define HAS_SOBELROW_SSE2 | 178 #define HAS_SOBELROW_SSE2 |
159 #define HAS_SOBELTOPLANEROW_SSE2 | 179 #define HAS_SOBELTOPLANEROW_SSE2 |
160 #define HAS_SOBELXROW_SSE2 | 180 #define HAS_SOBELXROW_SSE2 |
161 #define HAS_SOBELXYROW_SSE2 | 181 #define HAS_SOBELXYROW_SSE2 |
162 #define HAS_SOBELYROW_SSE2 | 182 #define HAS_SOBELYROW_SSE2 |
163 #endif | 183 #endif |
164 | 184 |
165 // The following are available on x64 Visual C and clangcl. | 185 // The following are available on x64 Visual C and clangcl. |
| 186 // TODO(fbarchard): Port to gcc. |
166 #if !defined(LIBYUV_DISABLE_X86) && defined (_M_X64) && \ | 187 #if !defined(LIBYUV_DISABLE_X86) && defined (_M_X64) && \ |
167 (!defined(__clang__) || defined(__SSSE3__)) | 188 (!defined(__clang__) || defined(__SSSE3__)) |
168 #define HAS_I422TOARGBROW_SSSE3 | 189 #define HAS_I422TOARGBROW_SSSE3 |
169 #define HAS_I422TOABGRROW_SSSE3 | 190 #define HAS_I422TOABGRROW_SSSE3 |
170 #define HAS_I422TOARGBMATRIXROW_SSSE3 | 191 #define HAS_I422TOARGBMATRIXROW_SSSE3 |
171 #define HAS_I422TOABGRMATRIXROW_SSSE3 | 192 #define HAS_I422TOABGRMATRIXROW_SSSE3 |
172 #endif | 193 #endif |
173 | 194 |
174 // GCC >= 4.7.0 required for AVX2. | 195 // The following are available for Visual C and clangcl 32 bit: |
175 #if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__)) | 196 // TODO(fbarchard): Port to gcc. |
176 #if (__GNUC__ > 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 7)) | 197 #if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && \ |
177 #define GCC_HAS_AVX2 1 | 198 (defined(VISUALC_HAS_AVX2) || defined(CLANG_HAS_AVX2)) |
178 #endif // GNUC >= 4.7 | 199 #define HAS_I444TOABGRROW_SSSE3 |
179 #endif // __GNUC__ | 200 #define HAS_I444TOARGBMATRIXROW_SSSE3 |
| 201 #define HAS_I444TOABGRMATRIXROW_SSSE3 |
| 202 #endif |
180 | 203 |
181 // clang >= 3.4.0 required for AVX2. | 204 // The following are available for AVX2 Visual C and clangcl 32 bit: |
182 #if defined(__clang__) && (defined(__x86_64__) || defined(__i386__)) | 205 // TODO(fbarchard): Port to gcc. |
183 #if (__clang_major__ > 3) || (__clang_major__ == 3 && (__clang_minor__ >= 4)) | |
184 #define CLANG_HAS_AVX2 1 | |
185 #endif // clang >= 3.4 | |
186 #endif // __clang__ | |
187 | |
188 // Visual C 2012 required for AVX2. | |
189 #if defined(_M_IX86) && !defined(__clang__) && \ | |
190 defined(_MSC_VER) && _MSC_VER >= 1700 | |
191 #define VISUALC_HAS_AVX2 1 | |
192 #endif // VisualStudio >= 2012 | |
193 | |
194 // The following are available for Visual C and clangcl 32 bit: | |
195 #if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && \ | 206 #if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && \ |
196 (defined(VISUALC_HAS_AVX2) || defined(CLANG_HAS_AVX2)) | 207 (defined(VISUALC_HAS_AVX2) || defined(CLANG_HAS_AVX2)) |
197 #define HAS_ARGB1555TOARGBROW_AVX2 | 208 #define HAS_ARGB1555TOARGBROW_AVX2 |
198 #define HAS_ARGB4444TOARGBROW_AVX2 | 209 #define HAS_ARGB4444TOARGBROW_AVX2 |
199 #define HAS_ARGBTOARGB1555ROW_AVX2 | 210 #define HAS_ARGBTOARGB1555ROW_AVX2 |
200 #define HAS_ARGBTOARGB4444ROW_AVX2 | 211 #define HAS_ARGBTOARGB4444ROW_AVX2 |
201 #define HAS_ARGBTORGB565DITHERROW_AVX2 | 212 #define HAS_ARGBTORGB565DITHERROW_AVX2 |
202 #define HAS_ARGBTORGB565DITHERROW_SSE2 | 213 #define HAS_ARGBTORGB565DITHERROW_SSE2 |
203 #define HAS_ARGBTORGB565ROW_AVX2 | 214 #define HAS_ARGBTORGB565ROW_AVX2 |
204 #define HAS_I411TOARGBROW_AVX2 | 215 #define HAS_I411TOARGBROW_AVX2 |
205 #define HAS_I422TOARGB1555ROW_AVX2 | 216 #define HAS_I422TOARGB1555ROW_AVX2 |
206 #define HAS_I422TOARGB4444ROW_AVX2 | 217 #define HAS_I422TOARGB4444ROW_AVX2 |
207 #define HAS_I422TORGB565ROW_AVX2 | 218 #define HAS_I422TORGB565ROW_AVX2 |
208 #define HAS_I444TOARGBROW_AVX2 | 219 #define HAS_I444TOARGBROW_AVX2 |
| 220 #define HAS_I444TOABGRROW_AVX2 |
209 #define HAS_J400TOARGBROW_AVX2 | 221 #define HAS_J400TOARGBROW_AVX2 |
210 #define HAS_NV12TOARGBROW_AVX2 | 222 #define HAS_NV12TOARGBROW_AVX2 |
211 #define HAS_NV12TORGB565ROW_AVX2 | 223 #define HAS_NV12TORGB565ROW_AVX2 |
212 #define HAS_NV21TOARGBROW_AVX2 | 224 #define HAS_NV21TOARGBROW_AVX2 |
213 #define HAS_NV21TORGB565ROW_AVX2 | 225 #define HAS_NV21TORGB565ROW_AVX2 |
214 #define HAS_RGB565TOARGBROW_AVX2 | 226 #define HAS_RGB565TOARGBROW_AVX2 |
| 227 #define HAS_I444TOARGBMATRIXROW_AVX2 |
| 228 #define HAS_I444TOABGRMATRIXROW_AVX2 |
215 #endif | 229 #endif |
216 | 230 |
217 // The following are available on all x86 platforms, but | 231 // The following are available on all x86 platforms, but |
218 // require VS2012, clang 3.4 or gcc 4.7. | 232 // require VS2012, clang 3.4 or gcc 4.7. |
219 // The code supports NaCL but requires a new compiler and validator. | 233 // The code supports NaCL but requires a new compiler and validator. |
220 #if !defined(LIBYUV_DISABLE_X86) && (defined(VISUALC_HAS_AVX2) || \ | 234 #if !defined(LIBYUV_DISABLE_X86) && (defined(VISUALC_HAS_AVX2) || \ |
221 defined(CLANG_HAS_AVX2) || defined(GCC_HAS_AVX2)) | 235 defined(CLANG_HAS_AVX2) || defined(GCC_HAS_AVX2)) |
222 #define HAS_ARGBCOPYALPHAROW_AVX2 | 236 #define HAS_ARGBCOPYALPHAROW_AVX2 |
223 #define HAS_ARGBCOPYYTOALPHAROW_AVX2 | 237 #define HAS_ARGBCOPYYTOALPHAROW_AVX2 |
224 #define HAS_ARGBMIRRORROW_AVX2 | 238 #define HAS_ARGBMIRRORROW_AVX2 |
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1023 void J400ToARGBRow_C(const uint8* src_y, uint8* dst_argb, int pix); | 1037 void J400ToARGBRow_C(const uint8* src_y, uint8* dst_argb, int pix); |
1024 void J400ToARGBRow_Any_SSE2(const uint8* src_y, uint8* dst_argb, int pix); | 1038 void J400ToARGBRow_Any_SSE2(const uint8* src_y, uint8* dst_argb, int pix); |
1025 void J400ToARGBRow_Any_AVX2(const uint8* src_y, uint8* dst_argb, int pix); | 1039 void J400ToARGBRow_Any_AVX2(const uint8* src_y, uint8* dst_argb, int pix); |
1026 void J400ToARGBRow_Any_NEON(const uint8* src_y, uint8* dst_argb, int pix); | 1040 void J400ToARGBRow_Any_NEON(const uint8* src_y, uint8* dst_argb, int pix); |
1027 | 1041 |
1028 void I444ToARGBRow_C(const uint8* src_y, | 1042 void I444ToARGBRow_C(const uint8* src_y, |
1029 const uint8* src_u, | 1043 const uint8* src_u, |
1030 const uint8* src_v, | 1044 const uint8* src_v, |
1031 uint8* dst_argb, | 1045 uint8* dst_argb, |
1032 int width); | 1046 int width); |
| 1047 void I444ToABGRRow_C(const uint8* src_y, |
| 1048 const uint8* src_u, |
| 1049 const uint8* src_v, |
| 1050 uint8* dst_argb, |
| 1051 int width); |
1033 void I422ToARGBRow_C(const uint8* src_y, | 1052 void I422ToARGBRow_C(const uint8* src_y, |
1034 const uint8* src_u, | 1053 const uint8* src_u, |
1035 const uint8* src_v, | 1054 const uint8* src_v, |
1036 uint8* dst_argb, | 1055 uint8* dst_argb, |
1037 int width); | 1056 int width); |
1038 void I422ToARGBMatrixRow_C(const uint8* src_y, | 1057 void I422ToARGBMatrixRow_C(const uint8* src_y, |
1039 const uint8* src_u, | 1058 const uint8* src_u, |
1040 const uint8* src_v, | 1059 const uint8* src_v, |
1041 uint8* dst_argb, | 1060 uint8* dst_argb, |
1042 struct YuvConstants* YuvConstants, | 1061 struct YuvConstants* YuvConstants, |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1159 void I422ToRGBARow_AVX2(const uint8* src_y, | 1178 void I422ToRGBARow_AVX2(const uint8* src_y, |
1160 const uint8* src_u, | 1179 const uint8* src_u, |
1161 const uint8* src_v, | 1180 const uint8* src_v, |
1162 uint8* dst_argb, | 1181 uint8* dst_argb, |
1163 int width); | 1182 int width); |
1164 void I422ToABGRRow_AVX2(const uint8* src_y, | 1183 void I422ToABGRRow_AVX2(const uint8* src_y, |
1165 const uint8* src_u, | 1184 const uint8* src_u, |
1166 const uint8* src_v, | 1185 const uint8* src_v, |
1167 uint8* dst_argb, | 1186 uint8* dst_argb, |
1168 int width); | 1187 int width); |
| 1188 void I444ToARGBMatrixRow_SSSE3(const uint8* src_y, |
| 1189 const uint8* src_u, |
| 1190 const uint8* src_v, |
| 1191 uint8* dst_argb, |
| 1192 struct YuvConstants* YuvConstants, |
| 1193 int width); |
| 1194 void I444ToARGBMatrixRow_AVX2(const uint8* src_y, |
| 1195 const uint8* src_u, |
| 1196 const uint8* src_v, |
| 1197 uint8* dst_argb, |
| 1198 struct YuvConstants* YuvConstants, |
| 1199 int width); |
1169 void I444ToARGBRow_SSSE3(const uint8* src_y, | 1200 void I444ToARGBRow_SSSE3(const uint8* src_y, |
1170 const uint8* src_u, | 1201 const uint8* src_u, |
1171 const uint8* src_v, | 1202 const uint8* src_v, |
1172 uint8* dst_argb, | 1203 uint8* dst_argb, |
1173 int width); | 1204 int width); |
1174 void I444ToARGBRow_AVX2(const uint8* src_y, | 1205 void I444ToARGBRow_AVX2(const uint8* src_y, |
1175 const uint8* src_u, | 1206 const uint8* src_u, |
1176 const uint8* src_v, | 1207 const uint8* src_v, |
1177 uint8* dst_argb, | 1208 uint8* dst_argb, |
1178 int width); | 1209 int width); |
| 1210 void I444ToABGRMatrixRow_SSSE3(const uint8* src_y, |
| 1211 const uint8* src_u, |
| 1212 const uint8* src_v, |
| 1213 uint8* dst_abgr, |
| 1214 struct YuvConstants* YuvConstants, |
| 1215 int width); |
| 1216 void I444ToABGRMatrixRow_AVX2(const uint8* src_y, |
| 1217 const uint8* src_u, |
| 1218 const uint8* src_v, |
| 1219 uint8* dst_abgr, |
| 1220 struct YuvConstants* YuvConstants, |
| 1221 int width); |
| 1222 void I444ToABGRRow_SSSE3(const uint8* src_y, |
| 1223 const uint8* src_u, |
| 1224 const uint8* src_v, |
| 1225 uint8* dst_abgr, |
| 1226 int width); |
| 1227 void I444ToABGRRow_AVX2(const uint8* src_y, |
| 1228 const uint8* src_u, |
| 1229 const uint8* src_v, |
| 1230 uint8* dst_abgr, |
| 1231 int width); |
1179 void I422ToARGBRow_SSSE3(const uint8* src_y, | 1232 void I422ToARGBRow_SSSE3(const uint8* src_y, |
1180 const uint8* src_u, | 1233 const uint8* src_u, |
1181 const uint8* src_v, | 1234 const uint8* src_v, |
1182 uint8* dst_argb, | 1235 uint8* dst_argb, |
1183 int width); | 1236 int width); |
1184 void I422ToARGBMatrixRow_SSSE3(const uint8* src_y, | 1237 void I422ToARGBMatrixRow_SSSE3(const uint8* src_y, |
1185 const uint8* src_u, | 1238 const uint8* src_u, |
1186 const uint8* src_v, | 1239 const uint8* src_v, |
1187 uint8* dst_argb, | 1240 uint8* dst_argb, |
1188 struct YuvConstants* YuvConstants, | 1241 struct YuvConstants* YuvConstants, |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1375 void I444ToARGBRow_Any_SSSE3(const uint8* src_y, | 1428 void I444ToARGBRow_Any_SSSE3(const uint8* src_y, |
1376 const uint8* src_u, | 1429 const uint8* src_u, |
1377 const uint8* src_v, | 1430 const uint8* src_v, |
1378 uint8* dst_argb, | 1431 uint8* dst_argb, |
1379 int width); | 1432 int width); |
1380 void I444ToARGBRow_Any_AVX2(const uint8* src_y, | 1433 void I444ToARGBRow_Any_AVX2(const uint8* src_y, |
1381 const uint8* src_u, | 1434 const uint8* src_u, |
1382 const uint8* src_v, | 1435 const uint8* src_v, |
1383 uint8* dst_argb, | 1436 uint8* dst_argb, |
1384 int width); | 1437 int width); |
| 1438 void I444ToABGRRow_Any_SSSE3(const uint8* src_y, |
| 1439 const uint8* src_u, |
| 1440 const uint8* src_v, |
| 1441 uint8* dst_abgr, |
| 1442 int width); |
| 1443 void I444ToABGRRow_Any_AVX2(const uint8* src_y, |
| 1444 const uint8* src_u, |
| 1445 const uint8* src_v, |
| 1446 uint8* dst_abgr, |
| 1447 int width); |
1385 void I422ToARGBRow_Any_SSSE3(const uint8* src_y, | 1448 void I422ToARGBRow_Any_SSSE3(const uint8* src_y, |
1386 const uint8* src_u, | 1449 const uint8* src_u, |
1387 const uint8* src_v, | 1450 const uint8* src_v, |
1388 uint8* dst_argb, | 1451 uint8* dst_argb, |
1389 int width); | 1452 int width); |
1390 void I411ToARGBRow_Any_SSSE3(const uint8* src_y, | 1453 void I411ToARGBRow_Any_SSSE3(const uint8* src_y, |
1391 const uint8* src_u, | 1454 const uint8* src_u, |
1392 const uint8* src_v, | 1455 const uint8* src_v, |
1393 uint8* dst_argb, | 1456 uint8* dst_argb, |
1394 int width); | 1457 int width); |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2060 void ARGBLumaColorTableRow_SSSE3(const uint8* src_argb, uint8* dst_argb, | 2123 void ARGBLumaColorTableRow_SSSE3(const uint8* src_argb, uint8* dst_argb, |
2061 int width, | 2124 int width, |
2062 const uint8* luma, uint32 lumacoeff); | 2125 const uint8* luma, uint32 lumacoeff); |
2063 | 2126 |
2064 #ifdef __cplusplus | 2127 #ifdef __cplusplus |
2065 } // extern "C" | 2128 } // extern "C" |
2066 } // namespace libyuv | 2129 } // namespace libyuv |
2067 #endif | 2130 #endif |
2068 | 2131 |
2069 #endif // INCLUDE_LIBYUV_ROW_H_ NOLINT | 2132 #endif // INCLUDE_LIBYUV_ROW_H_ NOLINT |
OLD | NEW |