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

Side by Side Diff: source/rotate.cc

Issue 2553403002: Add MSA optimized TransposeWx8_MSA and TransposeUVWx8_MSA functions (Closed)
Patch Set: 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
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 #if defined(HAS_TRANSPOSEWX8_DSPR2) 55 #if defined(HAS_TRANSPOSEWX8_DSPR2)
56 if (TestCpuFlag(kCpuHasDSPR2)) { 56 if (TestCpuFlag(kCpuHasDSPR2)) {
57 if (IS_ALIGNED(width, 4) && IS_ALIGNED(src, 4) && 57 if (IS_ALIGNED(width, 4) && IS_ALIGNED(src, 4) &&
58 IS_ALIGNED(src_stride, 4)) { 58 IS_ALIGNED(src_stride, 4)) {
59 TransposeWx8 = TransposeWx8_Fast_DSPR2; 59 TransposeWx8 = TransposeWx8_Fast_DSPR2;
60 } else { 60 } else {
61 TransposeWx8 = TransposeWx8_DSPR2; 61 TransposeWx8 = TransposeWx8_DSPR2;
62 } 62 }
63 } 63 }
64 #endif 64 #endif
65 #if defined(HAS_TRANSPOSEWX8_MSA)
66 if (TestCpuFlag(kCpuHasMSA)) {
67 TransposeWx8 = TransposeWx8_Any_MSA;
68 if (IS_ALIGNED(width, 16)) {
fbarchard1 2016/12/12 19:59:18 missing the matching {
manojkumar.bhosale 2016/12/13 08:52:22 Done.
69 TransposeWx8 = TransposeWx8_MSA;
70 }
71 #endif
65 72
66 // Work across the source in 8x8 tiles 73 // Work across the source in 8x8 tiles
67 while (i >= 8) { 74 while (i >= 8) {
68 TransposeWx8(src, src_stride, dst, dst_stride, width); 75 TransposeWx8(src, src_stride, dst, dst_stride, width);
69 src += 8 * src_stride; // Go down 8 rows. 76 src += 8 * src_stride; // Go down 8 rows.
70 dst += 8; // Move over 8 columns. 77 dst += 8; // Move over 8 columns.
71 i -= 8; 78 i -= 8;
72 } 79 }
73 80
74 if (i > 0) { 81 if (i > 0) {
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 TransposeUVWx8 = TransposeUVWx8_SSE2; 232 TransposeUVWx8 = TransposeUVWx8_SSE2;
226 } 233 }
227 } 234 }
228 #endif 235 #endif
229 #if defined(HAS_TRANSPOSEUVWX8_DSPR2) 236 #if defined(HAS_TRANSPOSEUVWX8_DSPR2)
230 if (TestCpuFlag(kCpuHasDSPR2) && IS_ALIGNED(width, 2) && IS_ALIGNED(src, 4) && 237 if (TestCpuFlag(kCpuHasDSPR2) && IS_ALIGNED(width, 2) && IS_ALIGNED(src, 4) &&
231 IS_ALIGNED(src_stride, 4)) { 238 IS_ALIGNED(src_stride, 4)) {
232 TransposeUVWx8 = TransposeUVWx8_DSPR2; 239 TransposeUVWx8 = TransposeUVWx8_DSPR2;
233 } 240 }
234 #endif 241 #endif
242 #if defined(HAS_TRANSPOSEUVWX8_MSA)
243 if (TestCpuFlag(kCpuHasMSA)) {
244 TransposeUVWx8 = TransposeUVWx8_Any_MSA;
245 if (IS_ALIGNED(width, 8)) {
246 TransposeUVWx8 = TransposeUVWx8_MSA;
247 }
248 }
249 #endif
235 250
236 // Work through the source in 8x8 tiles. 251 // Work through the source in 8x8 tiles.
237 while (i >= 8) { 252 while (i >= 8) {
238 TransposeUVWx8(src, src_stride, dst_a, dst_stride_a, dst_b, dst_stride_b, 253 TransposeUVWx8(src, src_stride, dst_a, dst_stride_a, dst_b, dst_stride_b,
239 width); 254 width);
240 src += 8 * src_stride; // Go down 8 rows. 255 src += 8 * src_stride; // Go down 8 rows.
241 dst_a += 8; // Move over 8 columns. 256 dst_a += 8; // Move over 8 columns.
242 dst_b += 8; // Move over 8 columns. 257 dst_b += 8; // Move over 8 columns.
243 i -= 8; 258 i -= 8;
244 } 259 }
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 default: 501 default:
487 break; 502 break;
488 } 503 }
489 return -1; 504 return -1;
490 } 505 }
491 506
492 #ifdef __cplusplus 507 #ifdef __cplusplus
493 } // extern "C" 508 } // extern "C"
494 } // namespace libyuv 509 } // namespace libyuv
495 #endif 510 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698