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

Side by Side Diff: source/convert_argb.cc

Issue 2430313005: Add MSA optimized I422ToARGBRow_MSA and I422ToRGBARow_MSA functions (Closed)
Patch Set: Created 4 years, 2 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 #endif 95 #endif
96 #if defined(HAS_I422TOARGBROW_DSPR2) 96 #if defined(HAS_I422TOARGBROW_DSPR2)
97 if (TestCpuFlag(kCpuHasDSPR2) && IS_ALIGNED(width, 4) && 97 if (TestCpuFlag(kCpuHasDSPR2) && IS_ALIGNED(width, 4) &&
98 IS_ALIGNED(src_y, 4) && IS_ALIGNED(src_stride_y, 4) && 98 IS_ALIGNED(src_y, 4) && IS_ALIGNED(src_stride_y, 4) &&
99 IS_ALIGNED(src_u, 2) && IS_ALIGNED(src_stride_u, 2) && 99 IS_ALIGNED(src_u, 2) && IS_ALIGNED(src_stride_u, 2) &&
100 IS_ALIGNED(src_v, 2) && IS_ALIGNED(src_stride_v, 2) && 100 IS_ALIGNED(src_v, 2) && IS_ALIGNED(src_stride_v, 2) &&
101 IS_ALIGNED(dst_argb, 4) && IS_ALIGNED(dst_stride_argb, 4)) { 101 IS_ALIGNED(dst_argb, 4) && IS_ALIGNED(dst_stride_argb, 4)) {
102 I422ToARGBRow = I422ToARGBRow_DSPR2; 102 I422ToARGBRow = I422ToARGBRow_DSPR2;
103 } 103 }
104 #endif 104 #endif
105 #if defined(HAS_I422TOARGBROW_MSA)
106 if (TestCpuFlag(kCpuHasMSA)) {
107 I422ToARGBRow = I422ToARGBRow_Any_MSA;
108 if (IS_ALIGNED(width, 8)) {
109 I422ToARGBRow = I422ToARGBRow_MSA;
110 }
111 }
112 #endif
105 113
106 for (y = 0; y < height; ++y) { 114 for (y = 0; y < height; ++y) {
107 I422ToARGBRow(src_y, src_u, src_v, dst_argb, yuvconstants, width); 115 I422ToARGBRow(src_y, src_u, src_v, dst_argb, yuvconstants, width);
108 dst_argb += dst_stride_argb; 116 dst_argb += dst_stride_argb;
109 src_y += src_stride_y; 117 src_y += src_stride_y;
110 if (y & 1) { 118 if (y & 1) {
111 src_u += src_stride_u; 119 src_u += src_stride_u;
112 src_v += src_stride_v; 120 src_v += src_stride_v;
113 } 121 }
114 } 122 }
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 #endif 273 #endif
266 #if defined(HAS_I422TOARGBROW_DSPR2) 274 #if defined(HAS_I422TOARGBROW_DSPR2)
267 if (TestCpuFlag(kCpuHasDSPR2) && IS_ALIGNED(width, 4) && 275 if (TestCpuFlag(kCpuHasDSPR2) && IS_ALIGNED(width, 4) &&
268 IS_ALIGNED(src_y, 4) && IS_ALIGNED(src_stride_y, 4) && 276 IS_ALIGNED(src_y, 4) && IS_ALIGNED(src_stride_y, 4) &&
269 IS_ALIGNED(src_u, 2) && IS_ALIGNED(src_stride_u, 2) && 277 IS_ALIGNED(src_u, 2) && IS_ALIGNED(src_stride_u, 2) &&
270 IS_ALIGNED(src_v, 2) && IS_ALIGNED(src_stride_v, 2) && 278 IS_ALIGNED(src_v, 2) && IS_ALIGNED(src_stride_v, 2) &&
271 IS_ALIGNED(dst_argb, 4) && IS_ALIGNED(dst_stride_argb, 4)) { 279 IS_ALIGNED(dst_argb, 4) && IS_ALIGNED(dst_stride_argb, 4)) {
272 I422ToARGBRow = I422ToARGBRow_DSPR2; 280 I422ToARGBRow = I422ToARGBRow_DSPR2;
273 } 281 }
274 #endif 282 #endif
283 #if defined(HAS_I422TOARGBROW_MSA)
284 if (TestCpuFlag(kCpuHasMSA)) {
285 I422ToARGBRow = I422ToARGBRow_Any_MSA;
286 if (IS_ALIGNED(width, 8)) {
287 I422ToARGBRow = I422ToARGBRow_MSA;
288 }
289 }
290 #endif
275 291
276 for (y = 0; y < height; ++y) { 292 for (y = 0; y < height; ++y) {
277 I422ToARGBRow(src_y, src_u, src_v, dst_argb, yuvconstants, width); 293 I422ToARGBRow(src_y, src_u, src_v, dst_argb, yuvconstants, width);
278 dst_argb += dst_stride_argb; 294 dst_argb += dst_stride_argb;
279 src_y += src_stride_y; 295 src_y += src_stride_y;
280 src_u += src_stride_u; 296 src_u += src_stride_u;
281 src_v += src_stride_v; 297 src_v += src_stride_v;
282 } 298 }
283 return 0; 299 return 0;
284 } 300 }
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 src_uyvy += src_stride_uyvy; 1402 src_uyvy += src_stride_uyvy;
1387 dst_argb += dst_stride_argb; 1403 dst_argb += dst_stride_argb;
1388 } 1404 }
1389 return 0; 1405 return 0;
1390 } 1406 }
1391 1407
1392 #ifdef __cplusplus 1408 #ifdef __cplusplus
1393 } // extern "C" 1409 } // extern "C"
1394 } // namespace libyuv 1410 } // namespace libyuv
1395 #endif 1411 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698