diff options
author | lixia zhang <zhanglixia-hf@loongson.cn> | 2018-07-04 18:40:48 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2018-07-20 22:53:04 +0000 |
commit | 21be9122aadf7824efe3fc19b2a09ff253a688e1 (patch) | |
tree | d22c41b2361d63169a0bfca4805b3b7990e5e420 /source/rotate.cc | |
parent | 55f5d91f11f929c4c59c32621c3d5457cca3ab0b (diff) | |
download | libyuv-21be9122aadf7824efe3fc19b2a09ff253a688e1.tar.gz |
libyuv:loongson optimize compare/row/scale/rotate files with mmi.
Currently, libyuv supports MIPS SIMD Arch(MSA),
but libyuv does not supports MultiMedia Instruction(MMI)(such as loongson3a platform).
In order to improve performance of libyuv on loongson3a platform,
this provides optimize 98 functions with mmi.
BUG=libyuv:804
Change-Id: I8947626009efad769b3103a867363ece25d79629
Reviewed-on: https://chromium-review.googlesource.com/1122064
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Diffstat (limited to 'source/rotate.cc')
-rwxr-xr-x[-rw-r--r--] | source/rotate.cc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/source/rotate.cc b/source/rotate.cc index f2bed85b..f28a06d3 100644..100755 --- a/source/rotate.cc +++ b/source/rotate.cc @@ -49,6 +49,11 @@ void TransposePlane(const uint8_t* src, } } #endif +#if defined(HAS_TRANSPOSEWX8_MMI) + if (TestCpuFlag(kCpuHasMMI)) { + TransposeWx8 = TransposeWx8_MMI; + } +#endif #if defined(HAS_TRANSPOSEWX8_FAST_SSSE3) if (TestCpuFlag(kCpuHasSSSE3)) { TransposeWx8 = TransposeWx8_Fast_Any_SSSE3; @@ -166,6 +171,14 @@ void RotatePlane180(const uint8_t* src, } } #endif +#if defined(HAS_MIRRORROW_MMI) + if (TestCpuFlag(kCpuHasMMI)) { + MirrorRow = MirrorRow_Any_MMI; + if (IS_ALIGNED(width, 8)) { + MirrorRow = MirrorRow_MMI; + } + } +#endif #if defined(HAS_COPYROW_SSE2) if (TestCpuFlag(kCpuHasSSE2)) { CopyRow = IS_ALIGNED(width, 32) ? CopyRow_SSE2 : CopyRow_Any_SSE2; @@ -186,6 +199,11 @@ void RotatePlane180(const uint8_t* src, CopyRow = IS_ALIGNED(width, 32) ? CopyRow_NEON : CopyRow_Any_NEON; } #endif +#if defined(HAS_COPYROW_MMI) + if (TestCpuFlag(kCpuHasMMI)) { + CopyRow = IS_ALIGNED(width, 8) ? CopyRow_MMI : CopyRow_Any_MMI; + } +#endif // Odd height will harmlessly mirror the middle row twice. for (y = 0; y < half_height; ++y) { @@ -232,6 +250,14 @@ void TransposeUV(const uint8_t* src, } } #endif +#if defined(HAS_TRANSPOSEUVWX8_MMI) + if (TestCpuFlag(kCpuHasMMI)) { + TransposeUVWx8 = TransposeUVWx8_Any_MMI; + if (IS_ALIGNED(width, 4)) { + TransposeUVWx8 = TransposeUVWx8_MMI; + } + } +#endif #if defined(HAS_TRANSPOSEUVWX16_MSA) if (TestCpuFlag(kCpuHasMSA)) { TransposeUVWx16 = TransposeUVWx16_Any_MSA; @@ -331,6 +357,11 @@ void RotateUV180(const uint8_t* src, MirrorUVRow = MirrorUVRow_MSA; } #endif +#if defined(HAS_MIRRORUVROW_MMI) + if (TestCpuFlag(kCpuHasMMI) && IS_ALIGNED(width, 8)) { + MirrorUVRow = MirrorUVRow_MMI; + } +#endif dst_a += dst_stride_a * (height - 1); dst_b += dst_stride_b * (height - 1); |