| 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 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 __m128i coeff0 = _mm_load_si128((const __m128i *)coeff); | 257 __m128i coeff0 = _mm_load_si128((const __m128i *)coeff); |
| 258 __m128i coeff1 = _mm_load_si128((const __m128i *)(coeff + 64)); | 258 __m128i coeff1 = _mm_load_si128((const __m128i *)(coeff + 64)); |
| 259 __m128i coeff2 = _mm_load_si128((const __m128i *)(coeff + 128)); | 259 __m128i coeff2 = _mm_load_si128((const __m128i *)(coeff + 128)); |
| 260 __m128i coeff3 = _mm_load_si128((const __m128i *)(coeff + 192)); | 260 __m128i coeff3 = _mm_load_si128((const __m128i *)(coeff + 192)); |
| 261 | 261 |
| 262 __m128i b0 = _mm_add_epi16(coeff0, coeff1); | 262 __m128i b0 = _mm_add_epi16(coeff0, coeff1); |
| 263 __m128i b1 = _mm_sub_epi16(coeff0, coeff1); | 263 __m128i b1 = _mm_sub_epi16(coeff0, coeff1); |
| 264 __m128i b2 = _mm_add_epi16(coeff2, coeff3); | 264 __m128i b2 = _mm_add_epi16(coeff2, coeff3); |
| 265 __m128i b3 = _mm_sub_epi16(coeff2, coeff3); | 265 __m128i b3 = _mm_sub_epi16(coeff2, coeff3); |
| 266 | 266 |
| 267 b0 = _mm_srai_epi16(b0, 1); |
| 268 b1 = _mm_srai_epi16(b1, 1); |
| 269 b2 = _mm_srai_epi16(b2, 1); |
| 270 b3 = _mm_srai_epi16(b3, 1); |
| 271 |
| 267 coeff0 = _mm_add_epi16(b0, b2); | 272 coeff0 = _mm_add_epi16(b0, b2); |
| 268 coeff1 = _mm_add_epi16(b1, b3); | 273 coeff1 = _mm_add_epi16(b1, b3); |
| 269 coeff0 = _mm_srai_epi16(coeff0, 1); | |
| 270 coeff1 = _mm_srai_epi16(coeff1, 1); | |
| 271 _mm_store_si128((__m128i *)coeff, coeff0); | 274 _mm_store_si128((__m128i *)coeff, coeff0); |
| 272 _mm_store_si128((__m128i *)(coeff + 64), coeff1); | 275 _mm_store_si128((__m128i *)(coeff + 64), coeff1); |
| 273 | 276 |
| 274 coeff2 = _mm_sub_epi16(b0, b2); | 277 coeff2 = _mm_sub_epi16(b0, b2); |
| 275 coeff3 = _mm_sub_epi16(b1, b3); | 278 coeff3 = _mm_sub_epi16(b1, b3); |
| 276 coeff2 = _mm_srai_epi16(coeff2, 1); | |
| 277 coeff3 = _mm_srai_epi16(coeff3, 1); | |
| 278 _mm_store_si128((__m128i *)(coeff + 128), coeff2); | 279 _mm_store_si128((__m128i *)(coeff + 128), coeff2); |
| 279 _mm_store_si128((__m128i *)(coeff + 192), coeff3); | 280 _mm_store_si128((__m128i *)(coeff + 192), coeff3); |
| 280 | 281 |
| 281 coeff += 8; | 282 coeff += 8; |
| 282 } | 283 } |
| 283 } | 284 } |
| 284 | 285 |
| 285 int16_t vp9_satd_sse2(const int16_t *coeff, int length) { | 286 int16_t vp9_satd_sse2(const int16_t *coeff, int length) { |
| 286 int i; | 287 int i; |
| 287 __m128i sum = _mm_load_si128((const __m128i *)coeff); | 288 __m128i sum = _mm_load_si128((const __m128i *)coeff); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 | 415 |
| 415 v1 = _mm_srli_si128(sse, 8); | 416 v1 = _mm_srli_si128(sse, 8); |
| 416 sse = _mm_add_epi32(sse, v1); | 417 sse = _mm_add_epi32(sse, v1); |
| 417 v1 = _mm_srli_epi64(sse, 32); | 418 v1 = _mm_srli_epi64(sse, 32); |
| 418 sse = _mm_add_epi32(sse, v1); | 419 sse = _mm_add_epi32(sse, v1); |
| 419 | 420 |
| 420 mean = _mm_extract_epi16(sum, 0); | 421 mean = _mm_extract_epi16(sum, 0); |
| 421 | 422 |
| 422 return _mm_cvtsi128_si32(sse) - ((mean * mean) >> (bwl + 2)); | 423 return _mm_cvtsi128_si32(sse) - ((mean * mean) >> (bwl + 2)); |
| 423 } | 424 } |
| OLD | NEW |