| 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 // SSE2 version of cost functions | 10 // SSE2 version of cost 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_SSE2) | 16 #if defined(WEBP_USE_SSE2) |
| 17 #include <emmintrin.h> | 17 #include <emmintrin.h> |
| 18 | 18 |
| 19 #include "../enc/cost.h" | 19 #include "../enc/cost_enc.h" |
| 20 #include "../enc/vp8enci.h" | 20 #include "../enc/vp8i_enc.h" |
| 21 #include "../utils/utils.h" | 21 #include "../utils/utils.h" |
| 22 | 22 |
| 23 //------------------------------------------------------------------------------ | 23 //------------------------------------------------------------------------------ |
| 24 | 24 |
| 25 static void SetResidualCoeffsSSE2(const int16_t* const coeffs, | 25 static void SetResidualCoeffsSSE2(const int16_t* const coeffs, |
| 26 VP8Residual* const res) { | 26 VP8Residual* const res) { |
| 27 const __m128i c0 = _mm_loadu_si128((const __m128i*)(coeffs + 0)); | 27 const __m128i c0 = _mm_loadu_si128((const __m128i*)(coeffs + 0)); |
| 28 const __m128i c1 = _mm_loadu_si128((const __m128i*)(coeffs + 8)); | 28 const __m128i c1 = _mm_loadu_si128((const __m128i*)(coeffs + 8)); |
| 29 // Use SSE2 to compare 16 values with a single instruction. | 29 // Use SSE2 to compare 16 values with a single instruction. |
| 30 const __m128i zero = _mm_setzero_si128(); | 30 const __m128i zero = _mm_setzero_si128(); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspCostInitSSE2(void) { | 110 WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspCostInitSSE2(void) { |
| 111 VP8SetResidualCoeffs = SetResidualCoeffsSSE2; | 111 VP8SetResidualCoeffs = SetResidualCoeffsSSE2; |
| 112 VP8GetResidualCost = GetResidualCostSSE2; | 112 VP8GetResidualCost = GetResidualCostSSE2; |
| 113 } | 113 } |
| 114 | 114 |
| 115 #else // !WEBP_USE_SSE2 | 115 #else // !WEBP_USE_SSE2 |
| 116 | 116 |
| 117 WEBP_DSP_INIT_STUB(VP8EncDspCostInitSSE2) | 117 WEBP_DSP_INIT_STUB(VP8EncDspCostInitSSE2) |
| 118 | 118 |
| 119 #endif // WEBP_USE_SSE2 | 119 #endif // WEBP_USE_SSE2 |
| OLD | NEW |