OLD | NEW |
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 Loading... |
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)) { |
| 69 TransposeWx8 = TransposeWx8_MSA; |
| 70 } |
| 71 } |
| 72 #endif |
65 | 73 |
66 // Work across the source in 8x8 tiles | 74 // Work across the source in 8x8 tiles |
67 while (i >= 8) { | 75 while (i >= 8) { |
68 TransposeWx8(src, src_stride, dst, dst_stride, width); | 76 TransposeWx8(src, src_stride, dst, dst_stride, width); |
69 src += 8 * src_stride; // Go down 8 rows. | 77 src += 8 * src_stride; // Go down 8 rows. |
70 dst += 8; // Move over 8 columns. | 78 dst += 8; // Move over 8 columns. |
71 i -= 8; | 79 i -= 8; |
72 } | 80 } |
73 | 81 |
74 if (i > 0) { | 82 if (i > 0) { |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 TransposeUVWx8 = TransposeUVWx8_SSE2; | 233 TransposeUVWx8 = TransposeUVWx8_SSE2; |
226 } | 234 } |
227 } | 235 } |
228 #endif | 236 #endif |
229 #if defined(HAS_TRANSPOSEUVWX8_DSPR2) | 237 #if defined(HAS_TRANSPOSEUVWX8_DSPR2) |
230 if (TestCpuFlag(kCpuHasDSPR2) && IS_ALIGNED(width, 2) && IS_ALIGNED(src, 4) && | 238 if (TestCpuFlag(kCpuHasDSPR2) && IS_ALIGNED(width, 2) && IS_ALIGNED(src, 4) && |
231 IS_ALIGNED(src_stride, 4)) { | 239 IS_ALIGNED(src_stride, 4)) { |
232 TransposeUVWx8 = TransposeUVWx8_DSPR2; | 240 TransposeUVWx8 = TransposeUVWx8_DSPR2; |
233 } | 241 } |
234 #endif | 242 #endif |
| 243 #if defined(HAS_TRANSPOSEUVWX8_MSA) |
| 244 if (TestCpuFlag(kCpuHasMSA)) { |
| 245 TransposeUVWx8 = TransposeUVWx8_Any_MSA; |
| 246 if (IS_ALIGNED(width, 8)) { |
| 247 TransposeUVWx8 = TransposeUVWx8_MSA; |
| 248 } |
| 249 } |
| 250 #endif |
235 | 251 |
236 // Work through the source in 8x8 tiles. | 252 // Work through the source in 8x8 tiles. |
237 while (i >= 8) { | 253 while (i >= 8) { |
238 TransposeUVWx8(src, src_stride, dst_a, dst_stride_a, dst_b, dst_stride_b, | 254 TransposeUVWx8(src, src_stride, dst_a, dst_stride_a, dst_b, dst_stride_b, |
239 width); | 255 width); |
240 src += 8 * src_stride; // Go down 8 rows. | 256 src += 8 * src_stride; // Go down 8 rows. |
241 dst_a += 8; // Move over 8 columns. | 257 dst_a += 8; // Move over 8 columns. |
242 dst_b += 8; // Move over 8 columns. | 258 dst_b += 8; // Move over 8 columns. |
243 i -= 8; | 259 i -= 8; |
244 } | 260 } |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 default: | 502 default: |
487 break; | 503 break; |
488 } | 504 } |
489 return -1; | 505 return -1; |
490 } | 506 } |
491 | 507 |
492 #ifdef __cplusplus | 508 #ifdef __cplusplus |
493 } // extern "C" | 509 } // extern "C" |
494 } // namespace libyuv | 510 } // namespace libyuv |
495 #endif | 511 #endif |
OLD | NEW |