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

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: Resolved merge conflicts Created 3 years, 11 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
« no previous file with comments | « source/convert.cc ('k') | source/row_any.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 } 955 }
956 #endif 956 #endif
957 #if defined(HAS_RGB24TOARGBROW_DSPR2) 957 #if defined(HAS_RGB24TOARGBROW_DSPR2)
958 if (TestCpuFlag(kCpuHasDSPR2)) { 958 if (TestCpuFlag(kCpuHasDSPR2)) {
959 RGB24ToARGBRow = RGB24ToARGBRow_Any_DSPR2; 959 RGB24ToARGBRow = RGB24ToARGBRow_Any_DSPR2;
960 if (IS_ALIGNED(width, 8)) { 960 if (IS_ALIGNED(width, 8)) {
961 RGB24ToARGBRow = RGB24ToARGBRow_DSPR2; 961 RGB24ToARGBRow = RGB24ToARGBRow_DSPR2;
962 } 962 }
963 } 963 }
964 #endif 964 #endif
965 #if defined(HAS_RGB24TOARGBROW_MSA)
966 if (TestCpuFlag(kCpuHasMSA)) {
967 RGB24ToARGBRow = RGB24ToARGBRow_Any_MSA;
968 if (IS_ALIGNED(width, 16)) {
969 RGB24ToARGBRow = RGB24ToARGBRow_MSA;
970 }
971 }
972 #endif
965 973
966 for (y = 0; y < height; ++y) { 974 for (y = 0; y < height; ++y) {
967 RGB24ToARGBRow(src_rgb24, dst_argb, width); 975 RGB24ToARGBRow(src_rgb24, dst_argb, width);
968 src_rgb24 += src_stride_rgb24; 976 src_rgb24 += src_stride_rgb24;
969 dst_argb += dst_stride_argb; 977 dst_argb += dst_stride_argb;
970 } 978 }
971 return 0; 979 return 0;
972 } 980 }
973 981
974 // Convert RAW to ARGB. 982 // Convert RAW to ARGB.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 } 1022 }
1015 #endif 1023 #endif
1016 #if defined(HAS_RAWTOARGBROW_DSPR2) 1024 #if defined(HAS_RAWTOARGBROW_DSPR2)
1017 if (TestCpuFlag(kCpuHasDSPR2)) { 1025 if (TestCpuFlag(kCpuHasDSPR2)) {
1018 RAWToARGBRow = RAWToARGBRow_Any_DSPR2; 1026 RAWToARGBRow = RAWToARGBRow_Any_DSPR2;
1019 if (IS_ALIGNED(width, 8)) { 1027 if (IS_ALIGNED(width, 8)) {
1020 RAWToARGBRow = RAWToARGBRow_DSPR2; 1028 RAWToARGBRow = RAWToARGBRow_DSPR2;
1021 } 1029 }
1022 } 1030 }
1023 #endif 1031 #endif
1032 #if defined(HAS_RAWTOARGBROW_MSA)
1033 if (TestCpuFlag(kCpuHasMSA)) {
1034 RAWToARGBRow = RAWToARGBRow_Any_MSA;
1035 if (IS_ALIGNED(width, 16)) {
1036 RAWToARGBRow = RAWToARGBRow_MSA;
1037 }
1038 }
1039 #endif
1024 1040
1025 for (y = 0; y < height; ++y) { 1041 for (y = 0; y < height; ++y) {
1026 RAWToARGBRow(src_raw, dst_argb, width); 1042 RAWToARGBRow(src_raw, dst_argb, width);
1027 src_raw += src_stride_raw; 1043 src_raw += src_stride_raw;
1028 dst_argb += dst_stride_argb; 1044 dst_argb += dst_stride_argb;
1029 } 1045 }
1030 return 0; 1046 return 0;
1031 } 1047 }
1032 1048
1033 // Convert RGB565 to ARGB. 1049 // Convert RGB565 to ARGB.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 } 1097 }
1082 #endif 1098 #endif
1083 #if defined(HAS_RGB565TOARGBROW_DSPR2) 1099 #if defined(HAS_RGB565TOARGBROW_DSPR2)
1084 if (TestCpuFlag(kCpuHasDSPR2)) { 1100 if (TestCpuFlag(kCpuHasDSPR2)) {
1085 RGB565ToARGBRow = RGB565ToARGBRow_Any_DSPR2; 1101 RGB565ToARGBRow = RGB565ToARGBRow_Any_DSPR2;
1086 if (IS_ALIGNED(width, 8)) { 1102 if (IS_ALIGNED(width, 8)) {
1087 RGB565ToARGBRow = RGB565ToARGBRow_DSPR2; 1103 RGB565ToARGBRow = RGB565ToARGBRow_DSPR2;
1088 } 1104 }
1089 } 1105 }
1090 #endif 1106 #endif
1107 #if defined(HAS_RGB565TOARGBROW_MSA)
1108 if (TestCpuFlag(kCpuHasMSA)) {
1109 RGB565ToARGBRow = RGB565ToARGBRow_Any_MSA;
1110 if (IS_ALIGNED(width, 16)) {
1111 RGB565ToARGBRow = RGB565ToARGBRow_MSA;
1112 }
1113 }
1114 #endif
1091 1115
1092 for (y = 0; y < height; ++y) { 1116 for (y = 0; y < height; ++y) {
1093 RGB565ToARGBRow(src_rgb565, dst_argb, width); 1117 RGB565ToARGBRow(src_rgb565, dst_argb, width);
1094 src_rgb565 += src_stride_rgb565; 1118 src_rgb565 += src_stride_rgb565;
1095 dst_argb += dst_stride_argb; 1119 dst_argb += dst_stride_argb;
1096 } 1120 }
1097 return 0; 1121 return 0;
1098 } 1122 }
1099 1123
1100 // Convert ARGB1555 to ARGB. 1124 // Convert ARGB1555 to ARGB.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
1148 } 1172 }
1149 #endif 1173 #endif
1150 #if defined(HAS_ARGB1555TOARGBROW_DSPR2) 1174 #if defined(HAS_ARGB1555TOARGBROW_DSPR2)
1151 if (TestCpuFlag(kCpuHasDSPR2)) { 1175 if (TestCpuFlag(kCpuHasDSPR2)) {
1152 ARGB1555ToARGBRow = ARGB1555ToARGBRow_Any_DSPR2; 1176 ARGB1555ToARGBRow = ARGB1555ToARGBRow_Any_DSPR2;
1153 if (IS_ALIGNED(width, 4)) { 1177 if (IS_ALIGNED(width, 4)) {
1154 ARGB1555ToARGBRow = ARGB1555ToARGBRow_DSPR2; 1178 ARGB1555ToARGBRow = ARGB1555ToARGBRow_DSPR2;
1155 } 1179 }
1156 } 1180 }
1157 #endif 1181 #endif
1182 #if defined(HAS_ARGB1555TOARGBROW_MSA)
1183 if (TestCpuFlag(kCpuHasMSA)) {
1184 ARGB1555ToARGBRow = ARGB1555ToARGBRow_Any_MSA;
1185 if (IS_ALIGNED(width, 16)) {
1186 ARGB1555ToARGBRow = ARGB1555ToARGBRow_MSA;
1187 }
1188 }
1189 #endif
1158 1190
1159 for (y = 0; y < height; ++y) { 1191 for (y = 0; y < height; ++y) {
1160 ARGB1555ToARGBRow(src_argb1555, dst_argb, width); 1192 ARGB1555ToARGBRow(src_argb1555, dst_argb, width);
1161 src_argb1555 += src_stride_argb1555; 1193 src_argb1555 += src_stride_argb1555;
1162 dst_argb += dst_stride_argb; 1194 dst_argb += dst_stride_argb;
1163 } 1195 }
1164 return 0; 1196 return 0;
1165 } 1197 }
1166 1198
1167 // Convert ARGB4444 to ARGB. 1199 // Convert ARGB4444 to ARGB.
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
1549 src_uyvy += src_stride_uyvy; 1581 src_uyvy += src_stride_uyvy;
1550 dst_argb += dst_stride_argb; 1582 dst_argb += dst_stride_argb;
1551 } 1583 }
1552 return 0; 1584 return 0;
1553 } 1585 }
1554 1586
1555 #ifdef __cplusplus 1587 #ifdef __cplusplus
1556 } // extern "C" 1588 } // extern "C"
1557 } // namespace libyuv 1589 } // namespace libyuv
1558 #endif 1590 #endif
OLDNEW
« no previous file with comments | « source/convert.cc ('k') | source/row_any.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698