OLD | NEW |
1 // Copyright 2015 Google Inc. All Rights Reserved. | 1 // Copyright 2015 Google Inc. All Rights Reserved. |
2 // | 2 // |
3 // Use of this source code is governed by a BSD-style license | 3 // Use of this source code is governed by a BSD-style license |
4 // that can be found in the COPYING file in the root of the source | 4 // that can be found in the COPYING file in the root of the source |
5 // tree. An additional intellectual property rights grant can be found | 5 // tree. An additional intellectual property rights grant can be found |
6 // in the file PATENTS. All contributing project authors may | 6 // in the file PATENTS. All contributing project authors may |
7 // be found in the AUTHORS file in the root of the source tree. | 7 // be found in the AUTHORS file in the root of the source tree. |
8 // ----------------------------------------------------------------------------- | 8 // ----------------------------------------------------------------------------- |
9 // | 9 // |
10 // SSE4 version of some decoding functions. | 10 // SSE4 version of some decoding functions. |
11 // | 11 // |
12 // Author: Skal (pascal.massimino@gmail.com) | 12 // Author: Skal (pascal.massimino@gmail.com) |
13 | 13 |
14 #include "./dsp.h" | 14 #include "./dsp.h" |
15 | 15 |
16 #if defined(WEBP_USE_SSE41) | 16 #if defined(WEBP_USE_SSE41) |
17 | 17 |
18 #include <smmintrin.h> | 18 #include <smmintrin.h> |
19 #include "../dec/vp8i.h" | 19 #include "../dec/vp8i.h" |
| 20 #include "../utils/utils.h" |
20 | 21 |
21 static void HE16(uint8_t* dst) { // horizontal | 22 static void HE16(uint8_t* dst) { // horizontal |
22 int j; | 23 int j; |
23 const __m128i kShuffle3 = _mm_set1_epi8(3); | 24 const __m128i kShuffle3 = _mm_set1_epi8(3); |
24 for (j = 16; j > 0; --j) { | 25 for (j = 16; j > 0; --j) { |
25 const __m128i in = _mm_cvtsi32_si128(WebPMemToUint32(dst - 4)); | 26 const __m128i in = _mm_cvtsi32_si128(WebPMemToUint32(dst - 4)); |
26 const __m128i values = _mm_shuffle_epi8(in, kShuffle3); | 27 const __m128i values = _mm_shuffle_epi8(in, kShuffle3); |
27 _mm_storeu_si128((__m128i*)dst, values); | 28 _mm_storeu_si128((__m128i*)dst, values); |
28 dst += BPS; | 29 dst += BPS; |
29 } | 30 } |
30 } | 31 } |
31 | 32 |
32 //------------------------------------------------------------------------------ | 33 //------------------------------------------------------------------------------ |
33 // Entry point | 34 // Entry point |
34 | 35 |
35 extern void VP8DspInitSSE41(void); | 36 extern void VP8DspInitSSE41(void); |
36 | 37 |
37 WEBP_TSAN_IGNORE_FUNCTION void VP8DspInitSSE41(void) { | 38 WEBP_TSAN_IGNORE_FUNCTION void VP8DspInitSSE41(void) { |
38 VP8PredLuma16[3] = HE16; | 39 VP8PredLuma16[3] = HE16; |
39 } | 40 } |
40 | 41 |
41 #else // !WEBP_USE_SSE41 | 42 #else // !WEBP_USE_SSE41 |
42 | 43 |
43 WEBP_DSP_INIT_STUB(VP8DspInitSSE41) | 44 WEBP_DSP_INIT_STUB(VP8DspInitSSE41) |
44 | 45 |
45 #endif // WEBP_USE_SSE41 | 46 #endif // WEBP_USE_SSE41 |
OLD | NEW |