summaryrefslogtreecommitdiff
path: root/vp8
diff options
context:
space:
mode:
authorScott LaVarnway <slavarnway@google.com>2012-10-25 12:19:26 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2012-10-25 12:19:26 -0700
commitbe4e7c5f77ec8413883cf250e8b1103a387261c4 (patch)
tree4a26f2224e2728349f397ff1419f1431767f75f9 /vp8
parentfbf2ac111e2bf104cefe6080e822c626f65753f2 (diff)
parent9ba2efd0340c2e0b9a3ac46ac1c94563552a112b (diff)
downloadlibvpx-be4e7c5f77ec8413883cf250e8b1103a387261c4.tar
libvpx-be4e7c5f77ec8413883cf250e8b1103a387261c4.tar.gz
libvpx-be4e7c5f77ec8413883cf250e8b1103a387261c4.tar.bz2
libvpx-be4e7c5f77ec8413883cf250e8b1103a387261c4.zip
Merge "Added sse2 instrinsic version of vp8_sad16x3" into experimental
Diffstat (limited to 'vp8')
-rw-r--r--vp8/common/rtcd_defs.sh4
-rw-r--r--vp8/common/x86/sadmxn_x86.c50
-rw-r--r--vp8/vp8_common.mk3
3 files changed, 55 insertions, 2 deletions
diff --git a/vp8/common/rtcd_defs.sh b/vp8/common/rtcd_defs.sh
index ea64c9682..90debf5cb 100644
--- a/vp8/common/rtcd_defs.sh
+++ b/vp8/common/rtcd_defs.sh
@@ -177,11 +177,13 @@ vp8_loop_filter_simple_bh_neon=vp8_loop_filter_bhs_neon
#
# sad 16x3, 3x16
#
+if [ "$CONFIG_NEWBESTREFMV" = "yes" ]; then
prototype unsigned int vp8_sad16x3 "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, int max_sad"
-specialize vp8_sad16x3
+specialize vp8_sad16x3 sse2
prototype unsigned int vp8_sad3x16 "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, int max_sad"
specialize vp8_sad3x16
+fi
#
# Encoder functions below this point.
diff --git a/vp8/common/x86/sadmxn_x86.c b/vp8/common/x86/sadmxn_x86.c
new file mode 100644
index 000000000..5057703bd
--- /dev/null
+++ b/vp8/common/x86/sadmxn_x86.c
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <emmintrin.h> // SSE2
+#include "./vpx_config.h"
+#include "./vpx_rtcd.h"
+
+
+#if CONFIG_NEWBESTREFMV
+
+
+#if HAVE_SSE2
+unsigned int vp8_sad16x3_sse2(
+ const unsigned char *src_ptr,
+ int src_stride,
+ const unsigned char *ref_ptr,
+ int ref_stride,
+ int max_sad) {
+ __m128i s0, s1, s2;
+ __m128i r0, r1, r2;
+ __m128i sad;
+
+ (void)max_sad;
+
+ s0 = _mm_loadu_si128((const __m128i *)(src_ptr + 0 * src_stride));
+ s1 = _mm_loadu_si128((const __m128i *)(src_ptr + 1 * src_stride));
+ s2 = _mm_loadu_si128((const __m128i *)(src_ptr + 2 * src_stride));
+
+ r0 = _mm_loadu_si128((const __m128i *)(ref_ptr + 0 * src_stride));
+ r1 = _mm_loadu_si128((const __m128i *)(ref_ptr + 1 * src_stride));
+ r2 = _mm_loadu_si128((const __m128i *)(ref_ptr + 2 * src_stride));
+
+ sad = _mm_sad_epu8(s0, r0);
+ sad = _mm_add_epi16(sad, _mm_sad_epu8(s1, r1));
+ sad = _mm_add_epi16(sad, _mm_sad_epu8(s2, r2));
+ sad = _mm_add_epi16(sad, _mm_srli_si128(sad, 8));
+
+ return _mm_cvtsi128_si32(sad);
+}
+#endif
+
+
+#endif // CONFIG_NEWBESTREFMV
diff --git a/vp8/vp8_common.mk b/vp8/vp8_common.mk
index fbbdec145..d6f31ed79 100644
--- a/vp8/vp8_common.mk
+++ b/vp8/vp8_common.mk
@@ -118,10 +118,11 @@ vp8/common/x86/filter_sse4.c.o: CFLAGS += -msse4
endif
VP8_COMMON_SRCS-$(HAVE_SSE2) += common/x86/filter_sse2.c
+VP8_COMMON_SRCS-$(HAVE_SSE2) += common/x86/sadmxn_x86.c
ifeq ($(HAVE_SSE2),yes)
vp8/common/x86/filter_sse2.c.o: CFLAGS += -msse2
vp8/common/x86/loopfilter_x86.c.o: CFLAGS += -msse2
-vp8/common/loopfilter_filters.c.o: CFLAGS += -msse2
+vp8/common/x86/sadmxn_x86.c.o: CFLAGS += -msse2
endif
VP8_COMMON_SRCS-$(ARCH_ARM) += common/arm/arm_systemdependent.c