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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 #define HAS_I422TORGB24ROW_MSA | 386 #define HAS_I422TORGB24ROW_MSA |
387 #define HAS_ARGBTORGB24ROW_MSA | 387 #define HAS_ARGBTORGB24ROW_MSA |
388 #define HAS_ARGBTORAWROW_MSA | 388 #define HAS_ARGBTORAWROW_MSA |
389 #define HAS_ARGBTORGB565ROW_MSA | 389 #define HAS_ARGBTORGB565ROW_MSA |
390 #define HAS_ARGBTOARGB1555ROW_MSA | 390 #define HAS_ARGBTOARGB1555ROW_MSA |
391 #define HAS_ARGBTOARGB4444ROW_MSA | 391 #define HAS_ARGBTOARGB4444ROW_MSA |
392 #define HAS_ARGBTOUV444ROW_MSA | 392 #define HAS_ARGBTOUV444ROW_MSA |
393 #define HAS_ARGBMULTIPLYROW_MSA | 393 #define HAS_ARGBMULTIPLYROW_MSA |
394 #define HAS_ARGBADDROW_MSA | 394 #define HAS_ARGBADDROW_MSA |
395 #define HAS_ARGBSUBTRACTROW_MSA | 395 #define HAS_ARGBSUBTRACTROW_MSA |
| 396 #define HAS_ARGBATTENUATEROW_MSA |
| 397 #define HAS_ARGBTORGB565DITHERROW_MSA |
| 398 #define HAS_ARGBSHUFFLEROW_MSA |
| 399 #define HAS_ARGBSHADEROW_MSA |
| 400 #define HAS_ARGBGRAYROW_MSA |
| 401 #define HAS_ARGBSEPIAROW_MSA |
396 #endif | 402 #endif |
397 | 403 |
398 #if defined(_MSC_VER) && !defined(__CLR_VER) && !defined(__clang__) | 404 #if defined(_MSC_VER) && !defined(__CLR_VER) && !defined(__clang__) |
399 #if defined(VISUALC_HAS_AVX2) | 405 #if defined(VISUALC_HAS_AVX2) |
400 #define SIMD_ALIGNED(var) __declspec(align(32)) var | 406 #define SIMD_ALIGNED(var) __declspec(align(32)) var |
401 #else | 407 #else |
402 #define SIMD_ALIGNED(var) __declspec(align(16)) var | 408 #define SIMD_ALIGNED(var) __declspec(align(16)) var |
403 #endif | 409 #endif |
404 typedef __declspec(align(16)) int16 vec16[8]; | 410 typedef __declspec(align(16)) int16 vec16[8]; |
405 typedef __declspec(align(16)) int32 vec32[4]; | 411 typedef __declspec(align(16)) int32 vec32[4]; |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 const uint8* shuffler, | 1191 const uint8* shuffler, |
1186 int width); | 1192 int width); |
1187 void ARGBShuffleRow_AVX2(const uint8* src_argb, | 1193 void ARGBShuffleRow_AVX2(const uint8* src_argb, |
1188 uint8* dst_argb, | 1194 uint8* dst_argb, |
1189 const uint8* shuffler, | 1195 const uint8* shuffler, |
1190 int width); | 1196 int width); |
1191 void ARGBShuffleRow_NEON(const uint8* src_argb, | 1197 void ARGBShuffleRow_NEON(const uint8* src_argb, |
1192 uint8* dst_argb, | 1198 uint8* dst_argb, |
1193 const uint8* shuffler, | 1199 const uint8* shuffler, |
1194 int width); | 1200 int width); |
| 1201 void ARGBShuffleRow_MSA(const uint8* src_argb, |
| 1202 uint8* dst_argb, |
| 1203 const uint8* shuffler, |
| 1204 int width); |
1195 void ARGBShuffleRow_Any_SSE2(const uint8* src_argb, | 1205 void ARGBShuffleRow_Any_SSE2(const uint8* src_argb, |
1196 uint8* dst_argb, | 1206 uint8* dst_argb, |
1197 const uint8* shuffler, | 1207 const uint8* shuffler, |
1198 int width); | 1208 int width); |
1199 void ARGBShuffleRow_Any_SSSE3(const uint8* src_argb, | 1209 void ARGBShuffleRow_Any_SSSE3(const uint8* src_argb, |
1200 uint8* dst_argb, | 1210 uint8* dst_argb, |
1201 const uint8* shuffler, | 1211 const uint8* shuffler, |
1202 int width); | 1212 int width); |
1203 void ARGBShuffleRow_Any_AVX2(const uint8* src_argb, | 1213 void ARGBShuffleRow_Any_AVX2(const uint8* src_argb, |
1204 uint8* dst_argb, | 1214 uint8* dst_argb, |
1205 const uint8* shuffler, | 1215 const uint8* shuffler, |
1206 int width); | 1216 int width); |
1207 void ARGBShuffleRow_Any_NEON(const uint8* src_argb, | 1217 void ARGBShuffleRow_Any_NEON(const uint8* src_argb, |
1208 uint8* dst_argb, | 1218 uint8* dst_argb, |
1209 const uint8* shuffler, | 1219 const uint8* shuffler, |
1210 int width); | 1220 int width); |
| 1221 void ARGBShuffleRow_Any_MSA(const uint8* src_argb, |
| 1222 uint8* dst_argb, |
| 1223 const uint8* shuffler, |
| 1224 int width); |
1211 | 1225 |
1212 void RGB24ToARGBRow_SSSE3(const uint8* src_rgb24, uint8* dst_argb, int width); | 1226 void RGB24ToARGBRow_SSSE3(const uint8* src_rgb24, uint8* dst_argb, int width); |
1213 void RAWToARGBRow_SSSE3(const uint8* src_raw, uint8* dst_argb, int width); | 1227 void RAWToARGBRow_SSSE3(const uint8* src_raw, uint8* dst_argb, int width); |
1214 void RAWToRGB24Row_SSSE3(const uint8* src_raw, uint8* dst_rgb24, int width); | 1228 void RAWToRGB24Row_SSSE3(const uint8* src_raw, uint8* dst_rgb24, int width); |
1215 void RGB565ToARGBRow_SSE2(const uint8* src_rgb565, uint8* dst_argb, int width); | 1229 void RGB565ToARGBRow_SSE2(const uint8* src_rgb565, uint8* dst_argb, int width); |
1216 void ARGB1555ToARGBRow_SSE2(const uint8* src_argb1555, | 1230 void ARGB1555ToARGBRow_SSE2(const uint8* src_argb1555, |
1217 uint8* dst_argb, | 1231 uint8* dst_argb, |
1218 int width); | 1232 int width); |
1219 void ARGB4444ToARGBRow_SSE2(const uint8* src_argb4444, | 1233 void ARGB4444ToARGBRow_SSE2(const uint8* src_argb4444, |
1220 uint8* dst_argb, | 1234 uint8* dst_argb, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1319 void ARGBToARGB4444Row_NEON(const uint8* src_argb, uint8* dst_rgb, int width); | 1333 void ARGBToARGB4444Row_NEON(const uint8* src_argb, uint8* dst_rgb, int width); |
1320 void ARGBToRGB565DitherRow_NEON(const uint8* src_argb, | 1334 void ARGBToRGB565DitherRow_NEON(const uint8* src_argb, |
1321 uint8* dst_rgb, | 1335 uint8* dst_rgb, |
1322 const uint32 dither4, | 1336 const uint32 dither4, |
1323 int width); | 1337 int width); |
1324 void ARGBToRGB24Row_MSA(const uint8* src_argb, uint8* dst_rgb, int width); | 1338 void ARGBToRGB24Row_MSA(const uint8* src_argb, uint8* dst_rgb, int width); |
1325 void ARGBToRAWRow_MSA(const uint8* src_argb, uint8* dst_rgb, int width); | 1339 void ARGBToRAWRow_MSA(const uint8* src_argb, uint8* dst_rgb, int width); |
1326 void ARGBToRGB565Row_MSA(const uint8* src_argb, uint8* dst_rgb, int width); | 1340 void ARGBToRGB565Row_MSA(const uint8* src_argb, uint8* dst_rgb, int width); |
1327 void ARGBToARGB1555Row_MSA(const uint8* src_argb, uint8* dst_rgb, int width); | 1341 void ARGBToARGB1555Row_MSA(const uint8* src_argb, uint8* dst_rgb, int width); |
1328 void ARGBToARGB4444Row_MSA(const uint8* src_argb, uint8* dst_rgb, int width); | 1342 void ARGBToARGB4444Row_MSA(const uint8* src_argb, uint8* dst_rgb, int width); |
| 1343 void ARGBToRGB565DitherRow_MSA(const uint8* src_argb, |
| 1344 uint8* dst_rgb, |
| 1345 const uint32 dither4, |
| 1346 int width); |
1329 | 1347 |
1330 void ARGBToRGBARow_C(const uint8* src_argb, uint8* dst_rgb, int width); | 1348 void ARGBToRGBARow_C(const uint8* src_argb, uint8* dst_rgb, int width); |
1331 void ARGBToRGB24Row_C(const uint8* src_argb, uint8* dst_rgb, int width); | 1349 void ARGBToRGB24Row_C(const uint8* src_argb, uint8* dst_rgb, int width); |
1332 void ARGBToRAWRow_C(const uint8* src_argb, uint8* dst_rgb, int width); | 1350 void ARGBToRAWRow_C(const uint8* src_argb, uint8* dst_rgb, int width); |
1333 void ARGBToRGB565Row_C(const uint8* src_argb, uint8* dst_rgb, int width); | 1351 void ARGBToRGB565Row_C(const uint8* src_argb, uint8* dst_rgb, int width); |
1334 void ARGBToARGB1555Row_C(const uint8* src_argb, uint8* dst_rgb, int width); | 1352 void ARGBToARGB1555Row_C(const uint8* src_argb, uint8* dst_rgb, int width); |
1335 void ARGBToARGB4444Row_C(const uint8* src_argb, uint8* dst_rgb, int width); | 1353 void ARGBToARGB4444Row_C(const uint8* src_argb, uint8* dst_rgb, int width); |
1336 | 1354 |
1337 void J400ToARGBRow_SSE2(const uint8* src_y, uint8* dst_argb, int width); | 1355 void J400ToARGBRow_SSE2(const uint8* src_y, uint8* dst_argb, int width); |
1338 void J400ToARGBRow_AVX2(const uint8* src_y, uint8* dst_argb, int width); | 1356 void J400ToARGBRow_AVX2(const uint8* src_y, uint8* dst_argb, int width); |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1940 int width); | 1958 int width); |
1941 void ARGBToRGB24Row_Any_MSA(const uint8* src_argb, uint8* dst_rgb, int width); | 1959 void ARGBToRGB24Row_Any_MSA(const uint8* src_argb, uint8* dst_rgb, int width); |
1942 void ARGBToRAWRow_Any_MSA(const uint8* src_argb, uint8* dst_rgb, int width); | 1960 void ARGBToRAWRow_Any_MSA(const uint8* src_argb, uint8* dst_rgb, int width); |
1943 void ARGBToRGB565Row_Any_MSA(const uint8* src_argb, uint8* dst_rgb, int width); | 1961 void ARGBToRGB565Row_Any_MSA(const uint8* src_argb, uint8* dst_rgb, int width); |
1944 void ARGBToARGB1555Row_Any_MSA(const uint8* src_argb, | 1962 void ARGBToARGB1555Row_Any_MSA(const uint8* src_argb, |
1945 uint8* dst_rgb, | 1963 uint8* dst_rgb, |
1946 int width); | 1964 int width); |
1947 void ARGBToARGB4444Row_Any_MSA(const uint8* src_argb, | 1965 void ARGBToARGB4444Row_Any_MSA(const uint8* src_argb, |
1948 uint8* dst_rgb, | 1966 uint8* dst_rgb, |
1949 int width); | 1967 int width); |
| 1968 void ARGBToRGB565DitherRow_Any_MSA(const uint8* src_argb, |
| 1969 uint8* dst_rgb, |
| 1970 const uint32 dither4, |
| 1971 int width); |
1950 | 1972 |
1951 void I444ToARGBRow_Any_NEON(const uint8* src_y, | 1973 void I444ToARGBRow_Any_NEON(const uint8* src_y, |
1952 const uint8* src_u, | 1974 const uint8* src_u, |
1953 const uint8* src_v, | 1975 const uint8* src_v, |
1954 uint8* dst_argb, | 1976 uint8* dst_argb, |
1955 const struct YuvConstants* yuvconstants, | 1977 const struct YuvConstants* yuvconstants, |
1956 int width); | 1978 int width); |
1957 void I422ToARGBRow_Any_NEON(const uint8* src_y, | 1979 void I422ToARGBRow_Any_NEON(const uint8* src_y, |
1958 const uint8* src_u, | 1980 const uint8* src_u, |
1959 const uint8* src_v, | 1981 const uint8* src_v, |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2337 const uint8* src_u, | 2359 const uint8* src_u, |
2338 const uint8* src_v, | 2360 const uint8* src_v, |
2339 uint8* dst_uyvy, | 2361 uint8* dst_uyvy, |
2340 int width); | 2362 int width); |
2341 | 2363 |
2342 // Effects related row functions. | 2364 // Effects related row functions. |
2343 void ARGBAttenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width); | 2365 void ARGBAttenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width); |
2344 void ARGBAttenuateRow_SSSE3(const uint8* src_argb, uint8* dst_argb, int width); | 2366 void ARGBAttenuateRow_SSSE3(const uint8* src_argb, uint8* dst_argb, int width); |
2345 void ARGBAttenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width); | 2367 void ARGBAttenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width); |
2346 void ARGBAttenuateRow_NEON(const uint8* src_argb, uint8* dst_argb, int width); | 2368 void ARGBAttenuateRow_NEON(const uint8* src_argb, uint8* dst_argb, int width); |
| 2369 void ARGBAttenuateRow_MSA(const uint8* src_argb, uint8* dst_argb, int width); |
2347 void ARGBAttenuateRow_Any_SSE2(const uint8* src_argb, | 2370 void ARGBAttenuateRow_Any_SSE2(const uint8* src_argb, |
2348 uint8* dst_argb, | 2371 uint8* dst_argb, |
2349 int width); | 2372 int width); |
2350 void ARGBAttenuateRow_Any_SSSE3(const uint8* src_argb, | 2373 void ARGBAttenuateRow_Any_SSSE3(const uint8* src_argb, |
2351 uint8* dst_argb, | 2374 uint8* dst_argb, |
2352 int width); | 2375 int width); |
2353 void ARGBAttenuateRow_Any_AVX2(const uint8* src_argb, | 2376 void ARGBAttenuateRow_Any_AVX2(const uint8* src_argb, |
2354 uint8* dst_argb, | 2377 uint8* dst_argb, |
2355 int width); | 2378 int width); |
2356 void ARGBAttenuateRow_Any_NEON(const uint8* src_argb, | 2379 void ARGBAttenuateRow_Any_NEON(const uint8* src_argb, |
2357 uint8* dst_argb, | 2380 uint8* dst_argb, |
2358 int width); | 2381 int width); |
| 2382 void ARGBAttenuateRow_Any_MSA(const uint8* src_argb, |
| 2383 uint8* dst_argb, |
| 2384 int width); |
2359 | 2385 |
2360 // Inverse table for unattenuate, shared by C and SSE2. | 2386 // Inverse table for unattenuate, shared by C and SSE2. |
2361 extern const uint32 fixed_invtbl8[256]; | 2387 extern const uint32 fixed_invtbl8[256]; |
2362 void ARGBUnattenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width); | 2388 void ARGBUnattenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width); |
2363 void ARGBUnattenuateRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width); | 2389 void ARGBUnattenuateRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width); |
2364 void ARGBUnattenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width); | 2390 void ARGBUnattenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width); |
2365 void ARGBUnattenuateRow_Any_SSE2(const uint8* src_argb, | 2391 void ARGBUnattenuateRow_Any_SSE2(const uint8* src_argb, |
2366 uint8* dst_argb, | 2392 uint8* dst_argb, |
2367 int width); | 2393 int width); |
2368 void ARGBUnattenuateRow_Any_AVX2(const uint8* src_argb, | 2394 void ARGBUnattenuateRow_Any_AVX2(const uint8* src_argb, |
2369 uint8* dst_argb, | 2395 uint8* dst_argb, |
2370 int width); | 2396 int width); |
2371 | 2397 |
2372 void ARGBGrayRow_C(const uint8* src_argb, uint8* dst_argb, int width); | 2398 void ARGBGrayRow_C(const uint8* src_argb, uint8* dst_argb, int width); |
2373 void ARGBGrayRow_SSSE3(const uint8* src_argb, uint8* dst_argb, int width); | 2399 void ARGBGrayRow_SSSE3(const uint8* src_argb, uint8* dst_argb, int width); |
2374 void ARGBGrayRow_NEON(const uint8* src_argb, uint8* dst_argb, int width); | 2400 void ARGBGrayRow_NEON(const uint8* src_argb, uint8* dst_argb, int width); |
| 2401 void ARGBGrayRow_MSA(const uint8* src_argb, uint8* dst_argb, int width); |
2375 | 2402 |
2376 void ARGBSepiaRow_C(uint8* dst_argb, int width); | 2403 void ARGBSepiaRow_C(uint8* dst_argb, int width); |
2377 void ARGBSepiaRow_SSSE3(uint8* dst_argb, int width); | 2404 void ARGBSepiaRow_SSSE3(uint8* dst_argb, int width); |
2378 void ARGBSepiaRow_NEON(uint8* dst_argb, int width); | 2405 void ARGBSepiaRow_NEON(uint8* dst_argb, int width); |
| 2406 void ARGBSepiaRow_MSA(uint8* dst_argb, int width); |
2379 | 2407 |
2380 void ARGBColorMatrixRow_C(const uint8* src_argb, | 2408 void ARGBColorMatrixRow_C(const uint8* src_argb, |
2381 uint8* dst_argb, | 2409 uint8* dst_argb, |
2382 const int8* matrix_argb, | 2410 const int8* matrix_argb, |
2383 int width); | 2411 int width); |
2384 void ARGBColorMatrixRow_SSSE3(const uint8* src_argb, | 2412 void ARGBColorMatrixRow_SSSE3(const uint8* src_argb, |
2385 uint8* dst_argb, | 2413 uint8* dst_argb, |
2386 const int8* matrix_argb, | 2414 const int8* matrix_argb, |
2387 int width); | 2415 int width); |
2388 void ARGBColorMatrixRow_NEON(const uint8* src_argb, | 2416 void ARGBColorMatrixRow_NEON(const uint8* src_argb, |
(...skipping 28 matching lines...) Expand all Loading... |
2417 int width, | 2445 int width, |
2418 uint32 value); | 2446 uint32 value); |
2419 void ARGBShadeRow_SSE2(const uint8* src_argb, | 2447 void ARGBShadeRow_SSE2(const uint8* src_argb, |
2420 uint8* dst_argb, | 2448 uint8* dst_argb, |
2421 int width, | 2449 int width, |
2422 uint32 value); | 2450 uint32 value); |
2423 void ARGBShadeRow_NEON(const uint8* src_argb, | 2451 void ARGBShadeRow_NEON(const uint8* src_argb, |
2424 uint8* dst_argb, | 2452 uint8* dst_argb, |
2425 int width, | 2453 int width, |
2426 uint32 value); | 2454 uint32 value); |
| 2455 void ARGBShadeRow_MSA(const uint8* src_argb, |
| 2456 uint8* dst_argb, |
| 2457 int width, |
| 2458 uint32 value); |
2427 | 2459 |
2428 // Used for blur. | 2460 // Used for blur. |
2429 void CumulativeSumToAverageRow_SSE2(const int32* topleft, | 2461 void CumulativeSumToAverageRow_SSE2(const int32* topleft, |
2430 const int32* botleft, | 2462 const int32* botleft, |
2431 int width, | 2463 int width, |
2432 int area, | 2464 int area, |
2433 uint8* dst, | 2465 uint8* dst, |
2434 int count); | 2466 int count); |
2435 void ComputeCumulativeSumRow_SSE2(const uint8* row, | 2467 void ComputeCumulativeSumRow_SSE2(const uint8* row, |
2436 int32* cumsum, | 2468 int32* cumsum, |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2659 int width, | 2691 int width, |
2660 const uint8* luma, | 2692 const uint8* luma, |
2661 uint32 lumacoeff); | 2693 uint32 lumacoeff); |
2662 | 2694 |
2663 #ifdef __cplusplus | 2695 #ifdef __cplusplus |
2664 } // extern "C" | 2696 } // extern "C" |
2665 } // namespace libyuv | 2697 } // namespace libyuv |
2666 #endif | 2698 #endif |
2667 | 2699 |
2668 #endif // INCLUDE_LIBYUV_ROW_H_ | 2700 #endif // INCLUDE_LIBYUV_ROW_H_ |
OLD | NEW |