OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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> | 11 #include <emmintrin.h> |
| 12 |
| 13 #include "./vp9_rtcd.h" |
12 #include "vpx_ports/mem.h" | 14 #include "vpx_ports/mem.h" |
13 | 15 |
14 void vp9_minmax_8x8_sse2(const uint8_t *s, int p, const uint8_t *d, int dp, | 16 void vp9_minmax_8x8_sse2(const uint8_t *s, int p, const uint8_t *d, int dp, |
15 int *min, int *max) { | 17 int *min, int *max) { |
16 __m128i u0, s0, d0, diff, maxabsdiff, minabsdiff, negdiff, absdiff0, absdiff; | 18 __m128i u0, s0, d0, diff, maxabsdiff, minabsdiff, negdiff, absdiff0, absdiff; |
17 u0 = _mm_setzero_si128(); | 19 u0 = _mm_setzero_si128(); |
18 // Row 0 | 20 // Row 0 |
19 s0 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(s)), u0); | 21 s0 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(s)), u0); |
20 d0 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(d)), u0); | 22 d0 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(d)), u0); |
21 diff = _mm_subs_epi16(s0, d0); | 23 diff = _mm_subs_epi16(s0, d0); |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 | 414 |
413 v1 = _mm_srli_si128(sse, 8); | 415 v1 = _mm_srli_si128(sse, 8); |
414 sse = _mm_add_epi32(sse, v1); | 416 sse = _mm_add_epi32(sse, v1); |
415 v1 = _mm_srli_epi64(sse, 32); | 417 v1 = _mm_srli_epi64(sse, 32); |
416 sse = _mm_add_epi32(sse, v1); | 418 sse = _mm_add_epi32(sse, v1); |
417 | 419 |
418 mean = _mm_extract_epi16(sum, 0); | 420 mean = _mm_extract_epi16(sum, 0); |
419 | 421 |
420 return _mm_cvtsi128_si32(sse) - ((mean * mean) >> (bwl + 2)); | 422 return _mm_cvtsi128_si32(sse) - ((mean * mean) >> (bwl + 2)); |
421 } | 423 } |
OLD | NEW |