| 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 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 } | 689 } |
| 690 #endif | 690 #endif |
| 691 #if defined(HAS_BGRATOUVROW_DSPR2) | 691 #if defined(HAS_BGRATOUVROW_DSPR2) |
| 692 if (TestCpuFlag(kCpuHasDSPR2)) { | 692 if (TestCpuFlag(kCpuHasDSPR2)) { |
| 693 BGRAToUVRow = BGRAToUVRow_Any_DSPR2; | 693 BGRAToUVRow = BGRAToUVRow_Any_DSPR2; |
| 694 if (IS_ALIGNED(width, 16)) { | 694 if (IS_ALIGNED(width, 16)) { |
| 695 BGRAToUVRow = BGRAToUVRow_DSPR2; | 695 BGRAToUVRow = BGRAToUVRow_DSPR2; |
| 696 } | 696 } |
| 697 } | 697 } |
| 698 #endif | 698 #endif |
| 699 #if defined(HAS_BGRATOYROW_MSA) |
| 700 if (TestCpuFlag(kCpuHasMSA)) { |
| 701 BGRAToYRow = BGRAToYRow_Any_MSA; |
| 702 if (IS_ALIGNED(width, 16)) { |
| 703 BGRAToYRow = BGRAToYRow_MSA; |
| 704 } |
| 705 } |
| 706 #endif |
| 707 #if defined(HAS_BGRATOUVROW_MSA) |
| 708 if (TestCpuFlag(kCpuHasMSA)) { |
| 709 BGRAToUVRow = BGRAToUVRow_Any_MSA; |
| 710 if (IS_ALIGNED(width, 16)) { |
| 711 BGRAToUVRow = BGRAToUVRow_MSA; |
| 712 } |
| 713 } |
| 714 #endif |
| 699 | 715 |
| 700 for (y = 0; y < height - 1; y += 2) { | 716 for (y = 0; y < height - 1; y += 2) { |
| 701 BGRAToUVRow(src_bgra, src_stride_bgra, dst_u, dst_v, width); | 717 BGRAToUVRow(src_bgra, src_stride_bgra, dst_u, dst_v, width); |
| 702 BGRAToYRow(src_bgra, dst_y, width); | 718 BGRAToYRow(src_bgra, dst_y, width); |
| 703 BGRAToYRow(src_bgra + src_stride_bgra, dst_y + dst_stride_y, width); | 719 BGRAToYRow(src_bgra + src_stride_bgra, dst_y + dst_stride_y, width); |
| 704 src_bgra += src_stride_bgra * 2; | 720 src_bgra += src_stride_bgra * 2; |
| 705 dst_y += dst_stride_y * 2; | 721 dst_y += dst_stride_y * 2; |
| 706 dst_u += dst_stride_u; | 722 dst_u += dst_stride_u; |
| 707 dst_v += dst_stride_v; | 723 dst_v += dst_stride_v; |
| 708 } | 724 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 } | 790 } |
| 775 #endif | 791 #endif |
| 776 #if defined(HAS_ABGRTOUVROW_DSPR2) | 792 #if defined(HAS_ABGRTOUVROW_DSPR2) |
| 777 if (TestCpuFlag(kCpuHasDSPR2)) { | 793 if (TestCpuFlag(kCpuHasDSPR2)) { |
| 778 ABGRToUVRow = ABGRToUVRow_Any_DSPR2; | 794 ABGRToUVRow = ABGRToUVRow_Any_DSPR2; |
| 779 if (IS_ALIGNED(width, 16)) { | 795 if (IS_ALIGNED(width, 16)) { |
| 780 ABGRToUVRow = ABGRToUVRow_DSPR2; | 796 ABGRToUVRow = ABGRToUVRow_DSPR2; |
| 781 } | 797 } |
| 782 } | 798 } |
| 783 #endif | 799 #endif |
| 800 #if defined(HAS_ABGRTOYROW_MSA) |
| 801 if (TestCpuFlag(kCpuHasMSA)) { |
| 802 ABGRToYRow = ABGRToYRow_Any_MSA; |
| 803 if (IS_ALIGNED(width, 16)) { |
| 804 ABGRToYRow = ABGRToYRow_MSA; |
| 805 } |
| 806 } |
| 807 #endif |
| 808 #if defined(HAS_ABGRTOUVROW_MSA) |
| 809 if (TestCpuFlag(kCpuHasMSA)) { |
| 810 ABGRToUVRow = ABGRToUVRow_Any_MSA; |
| 811 if (IS_ALIGNED(width, 16)) { |
| 812 ABGRToUVRow = ABGRToUVRow_MSA; |
| 813 } |
| 814 } |
| 815 #endif |
| 784 | 816 |
| 785 for (y = 0; y < height - 1; y += 2) { | 817 for (y = 0; y < height - 1; y += 2) { |
| 786 ABGRToUVRow(src_abgr, src_stride_abgr, dst_u, dst_v, width); | 818 ABGRToUVRow(src_abgr, src_stride_abgr, dst_u, dst_v, width); |
| 787 ABGRToYRow(src_abgr, dst_y, width); | 819 ABGRToYRow(src_abgr, dst_y, width); |
| 788 ABGRToYRow(src_abgr + src_stride_abgr, dst_y + dst_stride_y, width); | 820 ABGRToYRow(src_abgr + src_stride_abgr, dst_y + dst_stride_y, width); |
| 789 src_abgr += src_stride_abgr * 2; | 821 src_abgr += src_stride_abgr * 2; |
| 790 dst_y += dst_stride_y * 2; | 822 dst_y += dst_stride_y * 2; |
| 791 dst_u += dst_stride_u; | 823 dst_u += dst_stride_u; |
| 792 dst_v += dst_stride_v; | 824 dst_v += dst_stride_v; |
| 793 } | 825 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 } | 891 } |
| 860 #endif | 892 #endif |
| 861 #if defined(HAS_RGBATOUVROW_DSPR2) | 893 #if defined(HAS_RGBATOUVROW_DSPR2) |
| 862 if (TestCpuFlag(kCpuHasDSPR2)) { | 894 if (TestCpuFlag(kCpuHasDSPR2)) { |
| 863 RGBAToUVRow = RGBAToUVRow_Any_DSPR2; | 895 RGBAToUVRow = RGBAToUVRow_Any_DSPR2; |
| 864 if (IS_ALIGNED(width, 16)) { | 896 if (IS_ALIGNED(width, 16)) { |
| 865 RGBAToUVRow = RGBAToUVRow_DSPR2; | 897 RGBAToUVRow = RGBAToUVRow_DSPR2; |
| 866 } | 898 } |
| 867 } | 899 } |
| 868 #endif | 900 #endif |
| 901 #if defined(HAS_RGBATOYROW_MSA) |
| 902 if (TestCpuFlag(kCpuHasMSA)) { |
| 903 RGBAToYRow = RGBAToYRow_Any_MSA; |
| 904 if (IS_ALIGNED(width, 16)) { |
| 905 RGBAToYRow = RGBAToYRow_MSA; |
| 906 } |
| 907 } |
| 908 #endif |
| 909 #if defined(HAS_RGBATOUVROW_MSA) |
| 910 if (TestCpuFlag(kCpuHasMSA)) { |
| 911 RGBAToUVRow = RGBAToUVRow_Any_MSA; |
| 912 if (IS_ALIGNED(width, 16)) { |
| 913 RGBAToUVRow = RGBAToUVRow_MSA; |
| 914 } |
| 915 } |
| 916 #endif |
| 869 | 917 |
| 870 for (y = 0; y < height - 1; y += 2) { | 918 for (y = 0; y < height - 1; y += 2) { |
| 871 RGBAToUVRow(src_rgba, src_stride_rgba, dst_u, dst_v, width); | 919 RGBAToUVRow(src_rgba, src_stride_rgba, dst_u, dst_v, width); |
| 872 RGBAToYRow(src_rgba, dst_y, width); | 920 RGBAToYRow(src_rgba, dst_y, width); |
| 873 RGBAToYRow(src_rgba + src_stride_rgba, dst_y + dst_stride_y, width); | 921 RGBAToYRow(src_rgba + src_stride_rgba, dst_y + dst_stride_y, width); |
| 874 src_rgba += src_stride_rgba * 2; | 922 src_rgba += src_stride_rgba * 2; |
| 875 dst_y += dst_stride_y * 2; | 923 dst_y += dst_stride_y * 2; |
| 876 dst_u += dst_stride_u; | 924 dst_u += dst_stride_u; |
| 877 dst_v += dst_stride_v; | 925 dst_v += dst_stride_v; |
| 878 } | 926 } |
| (...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1657 dst_u += dst_stride_u; | 1705 dst_u += dst_stride_u; |
| 1658 dst_v += dst_stride_v; | 1706 dst_v += dst_stride_v; |
| 1659 } | 1707 } |
| 1660 return 0; | 1708 return 0; |
| 1661 } | 1709 } |
| 1662 | 1710 |
| 1663 #ifdef __cplusplus | 1711 #ifdef __cplusplus |
| 1664 } // extern "C" | 1712 } // extern "C" |
| 1665 } // namespace libyuv | 1713 } // namespace libyuv |
| 1666 #endif | 1714 #endif |
| OLD | NEW |