| 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 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1436 } | 1436 } |
| 1437 #endif | 1437 #endif |
| 1438 #if defined(HAS_NV12TORGB565ROW_NEON) | 1438 #if defined(HAS_NV12TORGB565ROW_NEON) |
| 1439 if (TestCpuFlag(kCpuHasNEON)) { | 1439 if (TestCpuFlag(kCpuHasNEON)) { |
| 1440 NV12ToRGB565Row = NV12ToRGB565Row_Any_NEON; | 1440 NV12ToRGB565Row = NV12ToRGB565Row_Any_NEON; |
| 1441 if (IS_ALIGNED(width, 8)) { | 1441 if (IS_ALIGNED(width, 8)) { |
| 1442 NV12ToRGB565Row = NV12ToRGB565Row_NEON; | 1442 NV12ToRGB565Row = NV12ToRGB565Row_NEON; |
| 1443 } | 1443 } |
| 1444 } | 1444 } |
| 1445 #endif | 1445 #endif |
| 1446 #if defined(HAS_NV12TORGB565ROW_MSA) |
| 1447 if (TestCpuFlag(kCpuHasMSA)) { |
| 1448 NV12ToRGB565Row = NV12ToRGB565Row_Any_MSA; |
| 1449 if (IS_ALIGNED(width, 8)) { |
| 1450 NV12ToRGB565Row = NV12ToRGB565Row_MSA; |
| 1451 } |
| 1452 } |
| 1453 #endif |
| 1446 | 1454 |
| 1447 for (y = 0; y < height; ++y) { | 1455 for (y = 0; y < height; ++y) { |
| 1448 NV12ToRGB565Row(src_y, src_uv, dst_rgb565, &kYuvI601Constants, width); | 1456 NV12ToRGB565Row(src_y, src_uv, dst_rgb565, &kYuvI601Constants, width); |
| 1449 dst_rgb565 += dst_stride_rgb565; | 1457 dst_rgb565 += dst_stride_rgb565; |
| 1450 src_y += src_stride_y; | 1458 src_y += src_stride_y; |
| 1451 if (y & 1) { | 1459 if (y & 1) { |
| 1452 src_uv += src_stride_uv; | 1460 src_uv += src_stride_uv; |
| 1453 } | 1461 } |
| 1454 } | 1462 } |
| 1455 return 0; | 1463 return 0; |
| (...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2644 } | 2652 } |
| 2645 #endif | 2653 #endif |
| 2646 #if defined(HAS_SOBELROW_NEON) | 2654 #if defined(HAS_SOBELROW_NEON) |
| 2647 if (TestCpuFlag(kCpuHasNEON)) { | 2655 if (TestCpuFlag(kCpuHasNEON)) { |
| 2648 SobelRow = SobelRow_Any_NEON; | 2656 SobelRow = SobelRow_Any_NEON; |
| 2649 if (IS_ALIGNED(width, 8)) { | 2657 if (IS_ALIGNED(width, 8)) { |
| 2650 SobelRow = SobelRow_NEON; | 2658 SobelRow = SobelRow_NEON; |
| 2651 } | 2659 } |
| 2652 } | 2660 } |
| 2653 #endif | 2661 #endif |
| 2662 #if defined(HAS_SOBELROW_MSA) |
| 2663 if (TestCpuFlag(kCpuHasMSA)) { |
| 2664 SobelRow = SobelRow_Any_MSA; |
| 2665 if (IS_ALIGNED(width, 16)) { |
| 2666 SobelRow = SobelRow_MSA; |
| 2667 } |
| 2668 } |
| 2669 #endif |
| 2654 return ARGBSobelize(src_argb, src_stride_argb, dst_argb, dst_stride_argb, | 2670 return ARGBSobelize(src_argb, src_stride_argb, dst_argb, dst_stride_argb, |
| 2655 width, height, SobelRow); | 2671 width, height, SobelRow); |
| 2656 } | 2672 } |
| 2657 | 2673 |
| 2658 // Sobel ARGB effect with planar output. | 2674 // Sobel ARGB effect with planar output. |
| 2659 LIBYUV_API | 2675 LIBYUV_API |
| 2660 int ARGBSobelToPlane(const uint8* src_argb, | 2676 int ARGBSobelToPlane(const uint8* src_argb, |
| 2661 int src_stride_argb, | 2677 int src_stride_argb, |
| 2662 uint8* dst_y, | 2678 uint8* dst_y, |
| 2663 int dst_stride_y, | 2679 int dst_stride_y, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 2674 } | 2690 } |
| 2675 #endif | 2691 #endif |
| 2676 #if defined(HAS_SOBELTOPLANEROW_NEON) | 2692 #if defined(HAS_SOBELTOPLANEROW_NEON) |
| 2677 if (TestCpuFlag(kCpuHasNEON)) { | 2693 if (TestCpuFlag(kCpuHasNEON)) { |
| 2678 SobelToPlaneRow = SobelToPlaneRow_Any_NEON; | 2694 SobelToPlaneRow = SobelToPlaneRow_Any_NEON; |
| 2679 if (IS_ALIGNED(width, 16)) { | 2695 if (IS_ALIGNED(width, 16)) { |
| 2680 SobelToPlaneRow = SobelToPlaneRow_NEON; | 2696 SobelToPlaneRow = SobelToPlaneRow_NEON; |
| 2681 } | 2697 } |
| 2682 } | 2698 } |
| 2683 #endif | 2699 #endif |
| 2700 #if defined(HAS_SOBELTOPLANEROW_MSA) |
| 2701 if (TestCpuFlag(kCpuHasMSA)) { |
| 2702 SobelToPlaneRow = SobelToPlaneRow_Any_MSA; |
| 2703 if (IS_ALIGNED(width, 32)) { |
| 2704 SobelToPlaneRow = SobelToPlaneRow_MSA; |
| 2705 } |
| 2706 } |
| 2707 #endif |
| 2684 return ARGBSobelize(src_argb, src_stride_argb, dst_y, dst_stride_y, width, | 2708 return ARGBSobelize(src_argb, src_stride_argb, dst_y, dst_stride_y, width, |
| 2685 height, SobelToPlaneRow); | 2709 height, SobelToPlaneRow); |
| 2686 } | 2710 } |
| 2687 | 2711 |
| 2688 // SobelXY ARGB effect. | 2712 // SobelXY ARGB effect. |
| 2689 // Similar to Sobel, but also stores Sobel X in R and Sobel Y in B. G = Sobel. | 2713 // Similar to Sobel, but also stores Sobel X in R and Sobel Y in B. G = Sobel. |
| 2690 LIBYUV_API | 2714 LIBYUV_API |
| 2691 int ARGBSobelXY(const uint8* src_argb, | 2715 int ARGBSobelXY(const uint8* src_argb, |
| 2692 int src_stride_argb, | 2716 int src_stride_argb, |
| 2693 uint8* dst_argb, | 2717 uint8* dst_argb, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2705 } | 2729 } |
| 2706 #endif | 2730 #endif |
| 2707 #if defined(HAS_SOBELXYROW_NEON) | 2731 #if defined(HAS_SOBELXYROW_NEON) |
| 2708 if (TestCpuFlag(kCpuHasNEON)) { | 2732 if (TestCpuFlag(kCpuHasNEON)) { |
| 2709 SobelXYRow = SobelXYRow_Any_NEON; | 2733 SobelXYRow = SobelXYRow_Any_NEON; |
| 2710 if (IS_ALIGNED(width, 8)) { | 2734 if (IS_ALIGNED(width, 8)) { |
| 2711 SobelXYRow = SobelXYRow_NEON; | 2735 SobelXYRow = SobelXYRow_NEON; |
| 2712 } | 2736 } |
| 2713 } | 2737 } |
| 2714 #endif | 2738 #endif |
| 2739 #if defined(HAS_SOBELXYROW_MSA) |
| 2740 if (TestCpuFlag(kCpuHasMSA)) { |
| 2741 SobelXYRow = SobelXYRow_Any_MSA; |
| 2742 if (IS_ALIGNED(width, 16)) { |
| 2743 SobelXYRow = SobelXYRow_MSA; |
| 2744 } |
| 2745 } |
| 2746 #endif |
| 2715 return ARGBSobelize(src_argb, src_stride_argb, dst_argb, dst_stride_argb, | 2747 return ARGBSobelize(src_argb, src_stride_argb, dst_argb, dst_stride_argb, |
| 2716 width, height, SobelXYRow); | 2748 width, height, SobelXYRow); |
| 2717 } | 2749 } |
| 2718 | 2750 |
| 2719 // Apply a 4x4 polynomial to each ARGB pixel. | 2751 // Apply a 4x4 polynomial to each ARGB pixel. |
| 2720 LIBYUV_API | 2752 LIBYUV_API |
| 2721 int ARGBPolynomial(const uint8* src_argb, | 2753 int ARGBPolynomial(const uint8* src_argb, |
| 2722 int src_stride_argb, | 2754 int src_stride_argb, |
| 2723 uint8* dst_argb, | 2755 uint8* dst_argb, |
| 2724 int dst_stride_argb, | 2756 int dst_stride_argb, |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3232 } | 3264 } |
| 3233 free_aligned_buffer_64(rows); | 3265 free_aligned_buffer_64(rows); |
| 3234 } | 3266 } |
| 3235 return 0; | 3267 return 0; |
| 3236 } | 3268 } |
| 3237 | 3269 |
| 3238 #ifdef __cplusplus | 3270 #ifdef __cplusplus |
| 3239 } // extern "C" | 3271 } // extern "C" |
| 3240 } // namespace libyuv | 3272 } // namespace libyuv |
| 3241 #endif | 3273 #endif |
| OLD | NEW |