| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 |
| 11 | #include "libyuv/rotate.h" |
| 12 | #include "libyuv/rotate_row.h" |
| 13 |
| 14 | #include "libyuv/basic_types.h" |
| 15 |
| 16 | #ifdef __cplusplus |
| 17 | namespace libyuv { |
| 18 | extern "C" { |
| 19 | #endif |
| 20 |
| 21 | #define TANY(NAMEANY, TPOS_SIMD, MASK) \ |
| 22 | void NAMEANY(const uint8* src, int src_stride, \ |
| 23 | uint8* dst, int dst_stride, int width) { \ |
| 24 | int r = width & MASK; \ |
| 25 | int n = width - r; \ |
| 26 | if (n > 0) { \ |
| 27 | TPOS_SIMD(src, src_stride, dst, dst_stride, n); \ |
| 28 | } \ |
| 29 | TransposeWx8_C(src + n, src_stride, dst + n * dst_stride, dst_stride, r);\ |
| 30 | } |
| 31 |
| 32 | #ifdef HAS_TRANSPOSEWX8_NEON |
| 33 | TANY(TransposeWx8_Any_NEON, TransposeWx8_NEON, 7) |
| 34 | #endif |
| 35 | #ifdef HAS_TRANSPOSEWX8_SSSE3 |
| 36 | TANY(TransposeWx8_Any_SSSE3, TransposeWx8_SSSE3, 7) |
| 37 | #endif |
| 38 | #ifdef HAS_TRANSPOSEWX8_FAST_SSSE3 |
| 39 | TANY(TransposeWx8_Fast_Any_SSSE3, TransposeWx8_Fast_SSSE3, 15) |
| 40 | #endif |
| 41 | #ifdef HAS_TRANSPOSEWX8_DSPR2 |
| 42 | TANY(TransposeWx8_Any_DSPR2, TransposeWx8_DSPR2, 7) |
| 43 | #endif |
| 44 | #undef TANY |
| 45 |
| 46 | #define TUVANY(NAMEANY, TPOS_SIMD, MASK) \ |
| 47 | void NAMEANY(const uint8* src, int src_stride, \ |
| 48 | uint8* dst_a, int dst_stride_a, \ |
| 49 | uint8* dst_b, int dst_stride_b, int width) { \ |
| 50 | int r = width & MASK; \ |
| 51 | int n = width - r; \ |
| 52 | if (n > 0) { \ |
| 53 | TPOS_SIMD(src, src_stride, dst_a, dst_stride_a, dst_b, dst_stride_b, \ |
| 54 | n); \ |
| 55 | } \ |
| 56 | TransposeUVWx8_C(src + n * 2, src_stride, \ |
| 57 | dst_a + n * dst_stride_a, dst_stride_a, \ |
| 58 | dst_b + n * dst_stride_b, dst_stride_b, r); \ |
| 59 | } |
| 60 |
| 61 | #ifdef HAS_TRANSPOSEUVWX8_NEON |
| 62 | TUVANY(TransposeUVWx8_Any_NEON, TransposeUVWx8_NEON, 7) |
| 63 | #endif |
| 64 | #ifdef HAS_TRANSPOSEUVWX8_SSE2 |
| 65 | TUVANY(TransposeUVWx8_Any_SSE2, TransposeUVWx8_SSE2, 7) |
| 66 | #endif |
| 67 | #ifdef HAS_TRANSPOSEUVWX8_DSPR2 |
| 68 | TUVANY(TransposeUVWx8_Any_DSPR2, TransposeUVWx8_DSPR2, 7) |
| 69 | #endif |
| 70 | #undef TUVANY |
| 71 |
| 72 | #ifdef __cplusplus |
| 73 | } // extern "C" |
| 74 | } // namespace libyuv |
| 75 | #endif |
| 76 |
| 77 |
| 78 |
| 79 |
| 80 |
| 81 |