diff options
author | Manojkumar Bhosale <manojkumar.bhosale@imgtec.com> | 2016-12-15 12:06:02 +0530 |
---|---|---|
committer | Manojkumar Bhosale <manojkumar.bhosale@imgtec.com> | 2016-12-15 12:06:02 +0530 |
commit | a899dea25167749697ecd97de57e07db9d85a841 (patch) | |
tree | 32c2716b9bb50730264066f931bf5967e0409bcb /source/convert_from_argb.cc | |
parent | 6fa5e4eb780b67fe3275a529c6c0da9ea7b58cff (diff) | |
download | libyuv-a899dea25167749697ecd97de57e07db9d85a841.tar.gz |
Add MSA optimized ARGB Attenuate/RGB565/Shuffle/Shader/Gray/Sepia row functions
R=fbarchard@google.com
BUG=libyuv:634
Performance Gain (vs C vectorized)
ARGBAttenuateRow_MSA - ~1.1x
ARGBAttenuateRow_Any_MSA - ~1.1x
ARGBToRGB565DitherRow_MSA - ~6.4x
ARGBToRGB565DitherRow_Any_MSA - ~6.2x
ARGBShuffleRow_MSA - ~5.1x
ARGBShuffleRow_Any_MSA - ~1.9x
ARGBShadeRow_MSA - ~1.1x
ARGBGrayRow_MSA - ~2.6x
ARGBSepiaRow_MSA - ~11.6x
Performance Gain (vs C non-vectorized)
ARGBAttenuateRow_MSA - ~2.46x
ARGBAttenuateRow_Any_MSA - ~2.45x
ARGBToRGB565DitherRow_MSA - ~9.4x
ARGBToRGB565DitherRow_Any_MSA - ~12.5x
ARGBShuffleRow_MSA - ~5.2x
ARGBShuffleRow_Any_MSA - ~1.9x
ARGBShadeRow_MSA - ~4.3x
ARGBGrayRow_MSA - ~10.5x
ARGBSepiaRow_MSA - ~12.2x
Review-Url: https://codereview.chromium.org/2559693002 .
Diffstat (limited to 'source/convert_from_argb.cc')
-rw-r--r-- | source/convert_from_argb.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/convert_from_argb.cc b/source/convert_from_argb.cc index 41df216d..81b59ba2 100644 --- a/source/convert_from_argb.cc +++ b/source/convert_from_argb.cc @@ -977,6 +977,15 @@ int ARGBToRGB565Dither(const uint8* src_argb, } } #endif +#if defined(HAS_ARGBTORGB565DITHERROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_Any_MSA; + if (IS_ALIGNED(width, 8)) { + ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_MSA; + } + } +#endif + for (y = 0; y < height; ++y) { ARGBToRGB565DitherRow(src_argb, dst_rgb565, *(uint32*)(dither4x4 + ((y & 3) << 2)), |