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

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

Issue 1124333011: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: only update to last nights LKGR Created 5 years, 7 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
OLDNEW
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 26 matching lines...) Expand all
37 (int)zbin_ptr[0]); 37 (int)zbin_ptr[0]);
38 zbins[1] = _mm_set1_epi32((int)zbin_ptr[1]); 38 zbins[1] = _mm_set1_epi32((int)zbin_ptr[1]);
39 39
40 nzbins[0] = _mm_setzero_si128(); 40 nzbins[0] = _mm_setzero_si128();
41 nzbins[1] = _mm_setzero_si128(); 41 nzbins[1] = _mm_setzero_si128();
42 nzbins[0] = _mm_sub_epi32(nzbins[0], zbins[0]); 42 nzbins[0] = _mm_sub_epi32(nzbins[0], zbins[0]);
43 nzbins[1] = _mm_sub_epi32(nzbins[1], zbins[1]); 43 nzbins[1] = _mm_sub_epi32(nzbins[1], zbins[1]);
44 44
45 (void)scan; 45 (void)scan;
46 46
47 vpx_memset(qcoeff_ptr, 0, count * sizeof(*qcoeff_ptr)); 47 memset(qcoeff_ptr, 0, count * sizeof(*qcoeff_ptr));
48 vpx_memset(dqcoeff_ptr, 0, count * sizeof(*dqcoeff_ptr)); 48 memset(dqcoeff_ptr, 0, count * sizeof(*dqcoeff_ptr));
49 49
50 if (!skip_block) { 50 if (!skip_block) {
51 // Pre-scan pass 51 // Pre-scan pass
52 for (i = ((int)count / 4) - 1; i >= 0; i--) { 52 for (i = ((int)count / 4) - 1; i >= 0; i--) {
53 __m128i coeffs, cmp1, cmp2; 53 __m128i coeffs, cmp1, cmp2;
54 int test; 54 int test;
55 coeffs = _mm_load_si128((const __m128i *)(coeff_ptr + i * 4)); 55 coeffs = _mm_load_si128((const __m128i *)(coeff_ptr + i * 4));
56 cmp1 = _mm_cmplt_epi32(coeffs, zbins[i != 0]); 56 cmp1 = _mm_cmplt_epi32(coeffs, zbins[i != 0]);
57 cmp2 = _mm_cmpgt_epi32(coeffs, nzbins[i != 0]); 57 cmp2 = _mm_cmpgt_epi32(coeffs, nzbins[i != 0]);
58 cmp1 = _mm_and_si128(cmp1, cmp2); 58 cmp1 = _mm_and_si128(cmp1, cmp2);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 zbin1_tmp, 125 zbin1_tmp,
126 zbin1_tmp, 126 zbin1_tmp,
127 zbin0_tmp); 127 zbin0_tmp);
128 zbins[1] = _mm_set1_epi32(zbin1_tmp); 128 zbins[1] = _mm_set1_epi32(zbin1_tmp);
129 129
130 nzbins[0] = _mm_setzero_si128(); 130 nzbins[0] = _mm_setzero_si128();
131 nzbins[1] = _mm_setzero_si128(); 131 nzbins[1] = _mm_setzero_si128();
132 nzbins[0] = _mm_sub_epi32(nzbins[0], zbins[0]); 132 nzbins[0] = _mm_sub_epi32(nzbins[0], zbins[0]);
133 nzbins[1] = _mm_sub_epi32(nzbins[1], zbins[1]); 133 nzbins[1] = _mm_sub_epi32(nzbins[1], zbins[1]);
134 134
135 vpx_memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr)); 135 memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr));
136 vpx_memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr)); 136 memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr));
137 137
138 if (!skip_block) { 138 if (!skip_block) {
139 // Pre-scan pass 139 // Pre-scan pass
140 for (i = 0; i < n_coeffs / 4; i++) { 140 for (i = 0; i < n_coeffs / 4; i++) {
141 __m128i coeffs, cmp1, cmp2; 141 __m128i coeffs, cmp1, cmp2;
142 int test; 142 int test;
143 coeffs = _mm_load_si128((const __m128i *)(coeff_ptr + i * 4)); 143 coeffs = _mm_load_si128((const __m128i *)(coeff_ptr + i * 4));
144 cmp1 = _mm_cmplt_epi32(coeffs, zbins[i != 0]); 144 cmp1 = _mm_cmplt_epi32(coeffs, zbins[i != 0]);
145 cmp2 = _mm_cmpgt_epi32(coeffs, nzbins[i != 0]); 145 cmp2 = _mm_cmpgt_epi32(coeffs, nzbins[i != 0]);
146 cmp1 = _mm_and_si128(cmp1, cmp2); 146 cmp1 = _mm_and_si128(cmp1, cmp2);
(...skipping 24 matching lines...) Expand all
171 qcoeff_ptr[rc] = (tmp ^ coeff_sign) - coeff_sign; 171 qcoeff_ptr[rc] = (tmp ^ coeff_sign) - coeff_sign;
172 dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0] / 2; 172 dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0] / 2;
173 173
174 if (tmp) 174 if (tmp)
175 eob = iscan[idx_arr[i]] > eob ? iscan[idx_arr[i]] : eob; 175 eob = iscan[idx_arr[i]] > eob ? iscan[idx_arr[i]] : eob;
176 } 176 }
177 } 177 }
178 *eob_ptr = eob + 1; 178 *eob_ptr = eob + 1;
179 } 179 }
180 #endif 180 #endif
OLDNEW
« no previous file with comments | « source/libvpx/vp9/encoder/x86/vp9_error_sse2.asm ('k') | source/libvpx/vp9/encoder/x86/vp9_highbd_sad4d_sse2.asm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698