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

Side by Side Diff: source/planar_functions.cc

Issue 2529983002: Add MSA optimized ARGB Multiply/Add/Subtract row functions (Closed)
Patch Set: Corrected patchset files Created 4 years 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 | « include/libyuv/row.h ('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 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 } 1108 }
1109 #endif 1109 #endif
1110 #if defined(HAS_ARGBMULTIPLYROW_NEON) 1110 #if defined(HAS_ARGBMULTIPLYROW_NEON)
1111 if (TestCpuFlag(kCpuHasNEON)) { 1111 if (TestCpuFlag(kCpuHasNEON)) {
1112 ARGBMultiplyRow = ARGBMultiplyRow_Any_NEON; 1112 ARGBMultiplyRow = ARGBMultiplyRow_Any_NEON;
1113 if (IS_ALIGNED(width, 8)) { 1113 if (IS_ALIGNED(width, 8)) {
1114 ARGBMultiplyRow = ARGBMultiplyRow_NEON; 1114 ARGBMultiplyRow = ARGBMultiplyRow_NEON;
1115 } 1115 }
1116 } 1116 }
1117 #endif 1117 #endif
1118 #if defined(HAS_ARGBMULTIPLYROW_MSA)
1119 if (TestCpuFlag(kCpuHasMSA)) {
1120 ARGBMultiplyRow = ARGBMultiplyRow_Any_MSA;
1121 if (IS_ALIGNED(width, 4)) {
1122 ARGBMultiplyRow = ARGBMultiplyRow_MSA;
1123 }
1124 }
1125 #endif
1118 1126
1119 // Multiply plane 1127 // Multiply plane
1120 for (y = 0; y < height; ++y) { 1128 for (y = 0; y < height; ++y) {
1121 ARGBMultiplyRow(src_argb0, src_argb1, dst_argb, width); 1129 ARGBMultiplyRow(src_argb0, src_argb1, dst_argb, width);
1122 src_argb0 += src_stride_argb0; 1130 src_argb0 += src_stride_argb0;
1123 src_argb1 += src_stride_argb1; 1131 src_argb1 += src_stride_argb1;
1124 dst_argb += dst_stride_argb; 1132 dst_argb += dst_stride_argb;
1125 } 1133 }
1126 return 0; 1134 return 0;
1127 } 1135 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 } 1185 }
1178 #endif 1186 #endif
1179 #if defined(HAS_ARGBADDROW_NEON) 1187 #if defined(HAS_ARGBADDROW_NEON)
1180 if (TestCpuFlag(kCpuHasNEON)) { 1188 if (TestCpuFlag(kCpuHasNEON)) {
1181 ARGBAddRow = ARGBAddRow_Any_NEON; 1189 ARGBAddRow = ARGBAddRow_Any_NEON;
1182 if (IS_ALIGNED(width, 8)) { 1190 if (IS_ALIGNED(width, 8)) {
1183 ARGBAddRow = ARGBAddRow_NEON; 1191 ARGBAddRow = ARGBAddRow_NEON;
1184 } 1192 }
1185 } 1193 }
1186 #endif 1194 #endif
1195 #if defined(HAS_ARGBADDROW_MSA)
1196 if (TestCpuFlag(kCpuHasMSA)) {
1197 ARGBAddRow = ARGBAddRow_Any_MSA;
1198 if (IS_ALIGNED(width, 8)) {
1199 ARGBAddRow = ARGBAddRow_MSA;
1200 }
1201 }
1202 #endif
1187 1203
1188 // Add plane 1204 // Add plane
1189 for (y = 0; y < height; ++y) { 1205 for (y = 0; y < height; ++y) {
1190 ARGBAddRow(src_argb0, src_argb1, dst_argb, width); 1206 ARGBAddRow(src_argb0, src_argb1, dst_argb, width);
1191 src_argb0 += src_stride_argb0; 1207 src_argb0 += src_stride_argb0;
1192 src_argb1 += src_stride_argb1; 1208 src_argb1 += src_stride_argb1;
1193 dst_argb += dst_stride_argb; 1209 dst_argb += dst_stride_argb;
1194 } 1210 }
1195 return 0; 1211 return 0;
1196 } 1212 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1241 } 1257 }
1242 #endif 1258 #endif
1243 #if defined(HAS_ARGBSUBTRACTROW_NEON) 1259 #if defined(HAS_ARGBSUBTRACTROW_NEON)
1244 if (TestCpuFlag(kCpuHasNEON)) { 1260 if (TestCpuFlag(kCpuHasNEON)) {
1245 ARGBSubtractRow = ARGBSubtractRow_Any_NEON; 1261 ARGBSubtractRow = ARGBSubtractRow_Any_NEON;
1246 if (IS_ALIGNED(width, 8)) { 1262 if (IS_ALIGNED(width, 8)) {
1247 ARGBSubtractRow = ARGBSubtractRow_NEON; 1263 ARGBSubtractRow = ARGBSubtractRow_NEON;
1248 } 1264 }
1249 } 1265 }
1250 #endif 1266 #endif
1267 #if defined(HAS_ARGBSUBTRACTROW_MSA)
1268 if (TestCpuFlag(kCpuHasMSA)) {
1269 ARGBSubtractRow = ARGBSubtractRow_Any_MSA;
1270 if (IS_ALIGNED(width, 8)) {
1271 ARGBSubtractRow = ARGBSubtractRow_MSA;
1272 }
1273 }
1274 #endif
1251 1275
1252 // Subtract plane 1276 // Subtract plane
1253 for (y = 0; y < height; ++y) { 1277 for (y = 0; y < height; ++y) {
1254 ARGBSubtractRow(src_argb0, src_argb1, dst_argb, width); 1278 ARGBSubtractRow(src_argb0, src_argb1, dst_argb, width);
1255 src_argb0 += src_stride_argb0; 1279 src_argb0 += src_stride_argb0;
1256 src_argb1 += src_stride_argb1; 1280 src_argb1 += src_stride_argb1;
1257 dst_argb += dst_stride_argb; 1281 dst_argb += dst_stride_argb;
1258 } 1282 }
1259 return 0; 1283 return 0;
1260 } 1284 }
(...skipping 1909 matching lines...) Expand 10 before | Expand all | Expand 10 after
3170 } 3194 }
3171 free_aligned_buffer_64(rows); 3195 free_aligned_buffer_64(rows);
3172 } 3196 }
3173 return 0; 3197 return 0;
3174 } 3198 }
3175 3199
3176 #ifdef __cplusplus 3200 #ifdef __cplusplus
3177 } // extern "C" 3201 } // extern "C"
3178 } // namespace libyuv 3202 } // namespace libyuv
3179 #endif 3203 #endif
OLDNEW
« no previous file with comments | « include/libyuv/row.h ('k') | source/row_any.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698