OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include <emmintrin.h> // SSE2 | 11 #include <emmintrin.h> // SSE2 |
12 #include "./vpx_config.h" | 12 #include "./vpx_config.h" |
13 #include "./vp9_rtcd.h" | 13 #include "./vp9_rtcd.h" |
14 #include "vpx/vpx_integer.h" | 14 #include "vpx/vpx_integer.h" |
| 15 #include "vpx_ports/emmintrin_compat.h" |
15 | 16 |
16 #if HAVE_SSE2 | 17 #if HAVE_SSE2 |
17 unsigned int vp9_sad16x3_sse2( | 18 unsigned int vp9_sad16x3_sse2( |
18 const unsigned char *src_ptr, | 19 const unsigned char *src_ptr, |
19 int src_stride, | 20 int src_stride, |
20 const unsigned char *ref_ptr, | 21 const unsigned char *ref_ptr, |
21 int ref_stride) { | 22 int ref_stride) { |
22 __m128i s0, s1, s2; | 23 __m128i s0, s1, s2; |
23 __m128i r0, r1, r2; | 24 __m128i r0, r1, r2; |
24 __m128i sad; | 25 __m128i sad; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 91 |
91 src_ptr += src_stride*4; | 92 src_ptr += src_stride*4; |
92 ref_ptr += ref_stride*4; | 93 ref_ptr += ref_stride*4; |
93 } | 94 } |
94 | 95 |
95 sad = _mm_add_epi16(sad, _mm_srli_si128(sad, 8)); | 96 sad = _mm_add_epi16(sad, _mm_srli_si128(sad, 8)); |
96 return _mm_cvtsi128_si32(sad); | 97 return _mm_cvtsi128_si32(sad); |
97 } | 98 } |
98 | 99 |
99 #endif | 100 #endif |
OLD | NEW |