Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Side by Side Diff: source/convert_argb.cc

Issue 2600713002: Add MSA optimized RAW/RGB/ARGB to ARGB/Y/UV row functions (Closed)
Patch Set: Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 } 939 }
940 #endif 940 #endif
941 #if defined(HAS_RGB24TOARGBROW_NEON) 941 #if defined(HAS_RGB24TOARGBROW_NEON)
942 if (TestCpuFlag(kCpuHasNEON)) { 942 if (TestCpuFlag(kCpuHasNEON)) {
943 RGB24ToARGBRow = RGB24ToARGBRow_Any_NEON; 943 RGB24ToARGBRow = RGB24ToARGBRow_Any_NEON;
944 if (IS_ALIGNED(width, 8)) { 944 if (IS_ALIGNED(width, 8)) {
945 RGB24ToARGBRow = RGB24ToARGBRow_NEON; 945 RGB24ToARGBRow = RGB24ToARGBRow_NEON;
946 } 946 }
947 } 947 }
948 #endif 948 #endif
949 #if defined(HAS_RGB24TOARGBROW_MSA)
950 if (TestCpuFlag(kCpuHasMSA)) {
951 RGB24ToARGBRow = RGB24ToARGBRow_Any_MSA;
952 if (IS_ALIGNED(width, 16)) {
953 RGB24ToARGBRow = RGB24ToARGBRow_MSA;
954 }
955 }
956 #endif
949 957
950 for (y = 0; y < height; ++y) { 958 for (y = 0; y < height; ++y) {
951 RGB24ToARGBRow(src_rgb24, dst_argb, width); 959 RGB24ToARGBRow(src_rgb24, dst_argb, width);
952 src_rgb24 += src_stride_rgb24; 960 src_rgb24 += src_stride_rgb24;
953 dst_argb += dst_stride_argb; 961 dst_argb += dst_stride_argb;
954 } 962 }
955 return 0; 963 return 0;
956 } 964 }
957 965
958 // Convert RAW to ARGB. 966 // Convert RAW to ARGB.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 } 998 }
991 #endif 999 #endif
992 #if defined(HAS_RAWTOARGBROW_NEON) 1000 #if defined(HAS_RAWTOARGBROW_NEON)
993 if (TestCpuFlag(kCpuHasNEON)) { 1001 if (TestCpuFlag(kCpuHasNEON)) {
994 RAWToARGBRow = RAWToARGBRow_Any_NEON; 1002 RAWToARGBRow = RAWToARGBRow_Any_NEON;
995 if (IS_ALIGNED(width, 8)) { 1003 if (IS_ALIGNED(width, 8)) {
996 RAWToARGBRow = RAWToARGBRow_NEON; 1004 RAWToARGBRow = RAWToARGBRow_NEON;
997 } 1005 }
998 } 1006 }
999 #endif 1007 #endif
1008 #if defined(HAS_RAWTOARGBROW_MSA)
1009 if (TestCpuFlag(kCpuHasMSA)) {
1010 RAWToARGBRow = RAWToARGBRow_Any_MSA;
1011 if (IS_ALIGNED(width, 16)) {
1012 RAWToARGBRow = RAWToARGBRow_MSA;
1013 }
1014 }
1015 #endif
1000 1016
1001 for (y = 0; y < height; ++y) { 1017 for (y = 0; y < height; ++y) {
1002 RAWToARGBRow(src_raw, dst_argb, width); 1018 RAWToARGBRow(src_raw, dst_argb, width);
1003 src_raw += src_stride_raw; 1019 src_raw += src_stride_raw;
1004 dst_argb += dst_stride_argb; 1020 dst_argb += dst_stride_argb;
1005 } 1021 }
1006 return 0; 1022 return 0;
1007 } 1023 }
1008 1024
1009 // Convert RGB565 to ARGB. 1025 // Convert RGB565 to ARGB.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 } 1065 }
1050 #endif 1066 #endif
1051 #if defined(HAS_RGB565TOARGBROW_NEON) 1067 #if defined(HAS_RGB565TOARGBROW_NEON)
1052 if (TestCpuFlag(kCpuHasNEON)) { 1068 if (TestCpuFlag(kCpuHasNEON)) {
1053 RGB565ToARGBRow = RGB565ToARGBRow_Any_NEON; 1069 RGB565ToARGBRow = RGB565ToARGBRow_Any_NEON;
1054 if (IS_ALIGNED(width, 8)) { 1070 if (IS_ALIGNED(width, 8)) {
1055 RGB565ToARGBRow = RGB565ToARGBRow_NEON; 1071 RGB565ToARGBRow = RGB565ToARGBRow_NEON;
1056 } 1072 }
1057 } 1073 }
1058 #endif 1074 #endif
1075 #if defined(HAS_RGB565TOARGBROW_MSA)
1076 if (TestCpuFlag(kCpuHasMSA)) {
1077 RGB565ToARGBRow = RGB565ToARGBRow_Any_MSA;
1078 if (IS_ALIGNED(width, 16)) {
1079 RGB565ToARGBRow = RGB565ToARGBRow_MSA;
1080 }
1081 }
1082 #endif
1059 1083
1060 for (y = 0; y < height; ++y) { 1084 for (y = 0; y < height; ++y) {
1061 RGB565ToARGBRow(src_rgb565, dst_argb, width); 1085 RGB565ToARGBRow(src_rgb565, dst_argb, width);
1062 src_rgb565 += src_stride_rgb565; 1086 src_rgb565 += src_stride_rgb565;
1063 dst_argb += dst_stride_argb; 1087 dst_argb += dst_stride_argb;
1064 } 1088 }
1065 return 0; 1089 return 0;
1066 } 1090 }
1067 1091
1068 // Convert ARGB1555 to ARGB. 1092 // Convert ARGB1555 to ARGB.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 } 1132 }
1109 #endif 1133 #endif
1110 #if defined(HAS_ARGB1555TOARGBROW_NEON) 1134 #if defined(HAS_ARGB1555TOARGBROW_NEON)
1111 if (TestCpuFlag(kCpuHasNEON)) { 1135 if (TestCpuFlag(kCpuHasNEON)) {
1112 ARGB1555ToARGBRow = ARGB1555ToARGBRow_Any_NEON; 1136 ARGB1555ToARGBRow = ARGB1555ToARGBRow_Any_NEON;
1113 if (IS_ALIGNED(width, 8)) { 1137 if (IS_ALIGNED(width, 8)) {
1114 ARGB1555ToARGBRow = ARGB1555ToARGBRow_NEON; 1138 ARGB1555ToARGBRow = ARGB1555ToARGBRow_NEON;
1115 } 1139 }
1116 } 1140 }
1117 #endif 1141 #endif
1142 #if defined(HAS_ARGB1555TOARGBROW_MSA)
1143 if (TestCpuFlag(kCpuHasMSA)) {
1144 ARGB1555ToARGBRow = ARGB1555ToARGBRow_Any_MSA;
1145 if (IS_ALIGNED(width, 16)) {
1146 ARGB1555ToARGBRow = ARGB1555ToARGBRow_MSA;
1147 }
1148 }
1149 #endif
1118 1150
1119 for (y = 0; y < height; ++y) { 1151 for (y = 0; y < height; ++y) {
1120 ARGB1555ToARGBRow(src_argb1555, dst_argb, width); 1152 ARGB1555ToARGBRow(src_argb1555, dst_argb, width);
1121 src_argb1555 += src_stride_argb1555; 1153 src_argb1555 += src_stride_argb1555;
1122 dst_argb += dst_stride_argb; 1154 dst_argb += dst_stride_argb;
1123 } 1155 }
1124 return 0; 1156 return 0;
1125 } 1157 }
1126 1158
1127 // Convert ARGB4444 to ARGB. 1159 // Convert ARGB4444 to ARGB.
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
1485 src_uyvy += src_stride_uyvy; 1517 src_uyvy += src_stride_uyvy;
1486 dst_argb += dst_stride_argb; 1518 dst_argb += dst_stride_argb;
1487 } 1519 }
1488 return 0; 1520 return 0;
1489 } 1521 }
1490 1522
1491 #ifdef __cplusplus 1523 #ifdef __cplusplus
1492 } // extern "C" 1524 } // extern "C"
1493 } // namespace libyuv 1525 } // namespace libyuv
1494 #endif 1526 #endif
OLDNEW
« no previous file with comments | « source/convert.cc ('k') | source/row_any.cc » ('j') | source/row_msa.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698