Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: source/libvpx/vp9/encoder/x86/vp9_avg_intrin_sse2.c

Issue 668403002: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #include <emmintrin.h>
12 #include "vpx_ports/mem.h"
13
14
15 unsigned int vp9_avg_8x8_sse2(const uint8_t *s, int p) {
16 __m128i s0, s1, u0;
17 unsigned int avg = 0;
18 u0 = _mm_setzero_si128();
19 s0 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(s)), u0);
20 s1 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(s + p)), u0);
21 s0 = _mm_adds_epu16(s0, s1);
22 s1 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(s + 2 * p)), u0);
23 s0 = _mm_adds_epu16(s0, s1);
24 s1 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(s + 3 * p)), u0);
25 s0 = _mm_adds_epu16(s0, s1);
26 s1 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(s + 4 * p)), u0);
27 s0 = _mm_adds_epu16(s0, s1);
28 s1 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(s + 5 * p)), u0);
29 s0 = _mm_adds_epu16(s0, s1);
30 s1 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(s + 6 * p)), u0);
31 s0 = _mm_adds_epu16(s0, s1);
32 s1 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)(s + 7 * p)), u0);
33 s0 = _mm_adds_epu16(s0, s1);
34
35 s0 = _mm_adds_epu16(s0, _mm_srli_si128(s0, 8));
36 s0 = _mm_adds_epu16(s0, _mm_srli_epi64(s0, 32));
37 s0 = _mm_adds_epu16(s0, _mm_srli_epi64(s0, 16));
38 avg = _mm_extract_epi16(s0, 0);
39 return (avg + 32) >> 6;
40 }
OLDNEW
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_variance.c ('k') | source/libvpx/vp9/encoder/x86/vp9_denoiser_sse2.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698