OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
| 5 #include "remoting/capturer/differ_block_sse2.h" |
| 6 |
5 #if defined(_MSC_VER) | 7 #if defined(_MSC_VER) |
6 #include <intrin.h> | 8 #include <intrin.h> |
7 #else | 9 #else |
8 #include <mmintrin.h> | 10 #include <mmintrin.h> |
9 #include <emmintrin.h> | 11 #include <emmintrin.h> |
10 #endif | 12 #endif |
11 | 13 |
12 #include "remoting/host/differ_block.h" | 14 #include "remoting/capturer/differ_block.h" |
13 #include "remoting/host/differ_block_internal.h" | |
14 | 15 |
15 namespace remoting { | 16 namespace remoting { |
16 | 17 |
17 extern int BlockDifference_SSE2_W16(const uint8* image1, const uint8* image2, | 18 extern int BlockDifference_SSE2_W16(const uint8* image1, const uint8* image2, |
18 int stride) { | 19 int stride) { |
19 __m128i acc = _mm_setzero_si128(); | 20 __m128i acc = _mm_setzero_si128(); |
20 __m128i v0; | 21 __m128i v0; |
21 __m128i v1; | 22 __m128i v1; |
22 __m128i sad; | 23 __m128i sad; |
23 for (int y = 0; y < kBlockSize; ++y) { | 24 for (int y = 0; y < kBlockSize; ++y) { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 int diff = _mm_cvtsi128_si32(sad); | 103 int diff = _mm_cvtsi128_si32(sad); |
103 if (diff) | 104 if (diff) |
104 return 1; | 105 return 1; |
105 image1 += stride; | 106 image1 += stride; |
106 image2 += stride; | 107 image2 += stride; |
107 } | 108 } |
108 return 0; | 109 return 0; |
109 } | 110 } |
110 | 111 |
111 } // namespace remoting | 112 } // namespace remoting |
OLD | NEW |