aboutsummaryrefslogtreecommitdiff
path: root/source/scale_argb.cc
diff options
context:
space:
mode:
authorManojkumar Bhosale <manojkumar.bhosale@imgtec.com>2017-02-22 16:06:37 +0530
committerFrank Barchard <fbarchard@google.com>2017-02-23 01:42:22 +0000
commit45b176d153c61732d81b2df0109bd292e67d2b6b (patch)
tree5a410854559b10c0b58d00c827a22d286a35d033 /source/scale_argb.cc
parenta041b0ae03c0b58ccb6598a846a268c3b2cabf65 (diff)
downloadlibyuv-45b176d153c61732d81b2df0109bd292e67d2b6b.tar.gz
Add MSA optimized Interpolate/MergeUV/Misc functions
BUG=libyuv:634 Change-Id: If8d60bd57f01fe95bc2fd26196466574195cc126 Performance Gain (vs C auto-vectorized) InterpolateRow_MSA - ~3.3x InterpolateRow_Any_MSA - ~2.5x ARGBSetRow_MSA - ~1.0x ARGBSetRow_Any_MSA - ~1.0x ARGBToRGB24Row_MSA - ~1.9x ARGBToRGB24Row_Any_MSA - ~1.6x MergeUVRow_MSA - ~1.6x MergeUVRow_Any_MSA - ~1.2x Performance Gain (vs C non-vectorized) InterpolateRow_MSA - ~11.3x InterpolateRow_Any_MSA - ~ 7.9x ARGBSetRow_MSA - ~ 6.2x ARGBSetRow_Any_MSA - ~ 4.0x ARGBToRGB24Row_MSA - ~ 9.9x ARGBToRGB24Row_Any_MSA - ~ 8.4x MergeUVRow_MSA - ~12.7x MergeUVRow_Any_MSA - ~ 8.0x Change-Id: If8d60bd57f01fe95bc2fd26196466574195cc126 Reviewed-on: https://chromium-review.googlesource.com/445817 Reviewed-by: Frank Barchard <fbarchard@google.com> Commit-Queue: Frank Barchard <fbarchard@google.com>
Diffstat (limited to 'source/scale_argb.cc')
-rw-r--r--source/scale_argb.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/source/scale_argb.cc b/source/scale_argb.cc
index dc982d9e..1ea28f0d 100644
--- a/source/scale_argb.cc
+++ b/source/scale_argb.cc
@@ -315,6 +315,14 @@ static void ScaleARGBBilinearDown(int src_width,
}
}
#endif
+#if defined(HAS_INTERPOLATEROW_MSA)
+ if (TestCpuFlag(kCpuHasMSA)) {
+ InterpolateRow = InterpolateRow_Any_MSA;
+ if (IS_ALIGNED(clip_src_width, 32)) {
+ InterpolateRow = InterpolateRow_MSA;
+ }
+ }
+#endif
#if defined(HAS_SCALEARGBFILTERCOLS_SSSE3)
if (TestCpuFlag(kCpuHasSSSE3) && src_width < 32768) {
ScaleARGBFilterCols = ScaleARGBFilterCols_SSSE3;
@@ -409,6 +417,14 @@ static void ScaleARGBBilinearUp(int src_width,
InterpolateRow = InterpolateRow_DSPR2;
}
#endif
+#if defined(HAS_INTERPOLATEROW_MSA)
+ if (TestCpuFlag(kCpuHasMSA)) {
+ InterpolateRow = InterpolateRow_Any_MSA;
+ if (IS_ALIGNED(dst_width, 8)) {
+ InterpolateRow = InterpolateRow_MSA;
+ }
+ }
+#endif
if (src_width >= 32768) {
ScaleARGBFilterCols =
filtering ? ScaleARGBFilterCols64_C : ScaleARGBCols64_C;
@@ -598,6 +614,14 @@ static void ScaleYUVToARGBBilinearUp(int src_width,
InterpolateRow = InterpolateRow_DSPR2;
}
#endif
+#if defined(HAS_INTERPOLATEROW_MSA)
+ if (TestCpuFlag(kCpuHasMSA)) {
+ InterpolateRow = InterpolateRow_Any_MSA;
+ if (IS_ALIGNED(dst_width, 8)) {
+ InterpolateRow = InterpolateRow_MSA;
+ }
+ }
+#endif
void (*ScaleARGBFilterCols)(uint8 * dst_argb, const uint8* src_argb,
int dst_width, int x, int dx) =