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

Side by Side Diff: source/libvpx/vp8/common/x86/variance_sse2.c

Issue 1162573005: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 years, 6 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) 2010 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2010 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
11 #include "./vp8_rtcd.h"
11 #include "vpx_config.h" 12 #include "vpx_config.h"
12 #include "vp8/common/variance.h" 13 #include "vp8/common/variance.h"
13 #include "vpx_ports/mem.h" 14 #include "vpx_ports/mem.h"
14 #include "vp8/common/x86/filter_x86.h" 15 #include "vp8/common/x86/filter_x86.h"
15 16
16 extern void filter_block1d_h6_mmx(const unsigned char *src_ptr, unsigned short * output_ptr, unsigned int src_pixels_per_line, unsigned int pixel_step, unsigned int output_height, unsigned int output_width, short *filter); 17 extern void filter_block1d_h6_mmx(const unsigned char *src_ptr, unsigned short * output_ptr, unsigned int src_pixels_per_line, unsigned int pixel_step, unsigned int output_height, unsigned int output_width, short *filter);
17 extern void filter_block1d_v6_mmx(const short *src_ptr, unsigned char *output_pt r, unsigned int pixels_per_line, unsigned int pixel_step, unsigned int output_he ight, unsigned int output_width, short *filter); 18 extern void filter_block1d_v6_mmx(const short *src_ptr, unsigned char *output_pt r, unsigned int pixels_per_line, unsigned int pixel_step, unsigned int output_he ight, unsigned int output_width, short *filter);
18 extern void filter_block1d8_h6_sse2(const unsigned char *src_ptr, unsigned short *output_ptr, unsigned int src_pixels_per_line, unsigned int pixel_step, unsigne d int output_height, unsigned int output_width, short *filter); 19 extern void filter_block1d8_h6_sse2(const unsigned char *src_ptr, unsigned short *output_ptr, unsigned int src_pixels_per_line, unsigned int pixel_step, unsigne d int output_height, unsigned int output_width, short *filter);
19 extern void filter_block1d8_v6_sse2(const short *src_ptr, unsigned char *output_ ptr, unsigned int pixels_per_line, unsigned int pixel_step, unsigned int output_ height, unsigned int output_width, short *filter); 20 extern void filter_block1d8_v6_sse2(const short *src_ptr, unsigned char *output_ ptr, unsigned int pixels_per_line, unsigned int pixel_step, unsigned int output_ height, unsigned int output_width, short *filter);
20 21
21 extern void vp8_filter_block2d_bil4x4_var_mmx 22 extern void vp8_filter_block2d_bil4x4_var_mmx
22 ( 23 (
23 const unsigned char *ref_ptr, 24 const unsigned char *ref_ptr,
24 int ref_pixels_per_line, 25 int ref_pixels_per_line,
25 const unsigned char *src_ptr, 26 const unsigned char *src_ptr,
26 int src_pixels_per_line, 27 int src_pixels_per_line,
27 const short *HFilter, 28 const short *HFilter,
28 const short *VFilter, 29 const short *VFilter,
29 int *sum, 30 int *sum,
30 unsigned int *sumsquared 31 unsigned int *sumsquared
31 ); 32 );
32 33
33 extern unsigned int vp8_get4x4var_mmx
34 (
35 const unsigned char *src_ptr,
36 int source_stride,
37 const unsigned char *ref_ptr,
38 int recon_stride,
39 unsigned int *SSE,
40 int *Sum
41 );
42
43 unsigned int vp8_get_mb_ss_sse2
44 (
45 const short *src_ptr
46 );
47 unsigned int vp8_get16x16var_sse2
48 (
49 const unsigned char *src_ptr,
50 int source_stride,
51 const unsigned char *ref_ptr,
52 int recon_stride,
53 unsigned int *SSE,
54 int *Sum
55 );
56 unsigned int vp8_get8x8var_sse2
57 (
58 const unsigned char *src_ptr,
59 int source_stride,
60 const unsigned char *ref_ptr,
61 int recon_stride,
62 unsigned int *SSE,
63 int *Sum
64 );
65 void vp8_filter_block2d_bil_var_sse2 34 void vp8_filter_block2d_bil_var_sse2
66 ( 35 (
67 const unsigned char *ref_ptr, 36 const unsigned char *ref_ptr,
68 int ref_pixels_per_line, 37 int ref_pixels_per_line,
69 const unsigned char *src_ptr, 38 const unsigned char *src_ptr,
70 int src_pixels_per_line, 39 int src_pixels_per_line,
71 unsigned int Height, 40 unsigned int Height,
72 int xoffset, 41 int xoffset,
73 int yoffset, 42 int yoffset,
74 int *sum, 43 int *sum,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 ( 97 (
129 const unsigned char *ref_ptr, 98 const unsigned char *ref_ptr,
130 int ref_pixels_per_line, 99 int ref_pixels_per_line,
131 const unsigned char *src_ptr, 100 const unsigned char *src_ptr,
132 int src_pixels_per_line, 101 int src_pixels_per_line,
133 unsigned int Height, 102 unsigned int Height,
134 int *sum, 103 int *sum,
135 unsigned int *sumsquared 104 unsigned int *sumsquared
136 ); 105 );
137 106
138 unsigned int vp8_variance4x4_wmt(
139 const unsigned char *src_ptr,
140 int source_stride,
141 const unsigned char *ref_ptr,
142 int recon_stride,
143 unsigned int *sse)
144 {
145 unsigned int var;
146 int avg;
147
148 vp8_get4x4var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg) ;
149 *sse = var;
150 return (var - (((unsigned int)avg * avg) >> 4));
151
152 }
153
154 unsigned int vp8_variance8x8_wmt
155 (
156 const unsigned char *src_ptr,
157 int source_stride,
158 const unsigned char *ref_ptr,
159 int recon_stride,
160 unsigned int *sse)
161 {
162 unsigned int var;
163 int avg;
164
165 vp8_get8x8var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg ) ;
166 *sse = var;
167 return (var - (((unsigned int)avg * avg) >> 6));
168
169 }
170
171
172 unsigned int vp8_variance16x16_wmt
173 (
174 const unsigned char *src_ptr,
175 int source_stride,
176 const unsigned char *ref_ptr,
177 int recon_stride,
178 unsigned int *sse)
179 {
180 unsigned int sse0;
181 int sum0;
182
183
184 vp8_get16x16var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, & sum0) ;
185 *sse = sse0;
186 return (sse0 - (((unsigned int)sum0 * sum0) >> 8));
187 }
188 unsigned int vp8_mse16x16_wmt(
189 const unsigned char *src_ptr,
190 int source_stride,
191 const unsigned char *ref_ptr,
192 int recon_stride,
193 unsigned int *sse)
194 {
195
196 unsigned int sse0;
197 int sum0;
198 vp8_get16x16var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, & sum0) ;
199 *sse = sse0;
200 return sse0;
201
202 }
203
204
205 unsigned int vp8_variance16x8_wmt
206 (
207 const unsigned char *src_ptr,
208 int source_stride,
209 const unsigned char *ref_ptr,
210 int recon_stride,
211 unsigned int *sse)
212 {
213 unsigned int sse0, sse1, var;
214 int sum0, sum1, avg;
215
216 vp8_get8x8var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &su m0) ;
217 vp8_get8x8var_sse2(src_ptr + 8, source_stride, ref_ptr + 8, recon_stride, &s se1, &sum1);
218
219 var = sse0 + sse1;
220 avg = sum0 + sum1;
221 *sse = var;
222 return (var - (((unsigned int)avg * avg) >> 7));
223
224 }
225
226 unsigned int vp8_variance8x16_wmt
227 (
228 const unsigned char *src_ptr,
229 int source_stride,
230 const unsigned char *ref_ptr,
231 int recon_stride,
232 unsigned int *sse)
233 {
234 unsigned int sse0, sse1, var;
235 int sum0, sum1, avg;
236
237 vp8_get8x8var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &su m0) ;
238 vp8_get8x8var_sse2(src_ptr + 8 * source_stride, source_stride, ref_ptr + 8 * recon_stride, recon_stride, &sse1, &sum1) ;
239
240 var = sse0 + sse1;
241 avg = sum0 + sum1;
242 *sse = var;
243 return (var - (((unsigned int)avg * avg) >> 7));
244
245 }
246
247 unsigned int vp8_sub_pixel_variance4x4_wmt 107 unsigned int vp8_sub_pixel_variance4x4_wmt
248 ( 108 (
249 const unsigned char *src_ptr, 109 const unsigned char *src_ptr,
250 int src_pixels_per_line, 110 int src_pixels_per_line,
251 int xoffset, 111 int xoffset,
252 int yoffset, 112 int yoffset,
253 const unsigned char *dst_ptr, 113 const unsigned char *dst_ptr,
254 int dst_pixels_per_line, 114 int dst_pixels_per_line,
255 unsigned int *sse 115 unsigned int *sse
256 ) 116 )
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 unsigned int xxsum0; 408 unsigned int xxsum0;
549 409
550 vp8_half_horiz_vert_variance16x_h_sse2( 410 vp8_half_horiz_vert_variance16x_h_sse2(
551 src_ptr, src_pixels_per_line, 411 src_ptr, src_pixels_per_line,
552 dst_ptr, dst_pixels_per_line, 16, 412 dst_ptr, dst_pixels_per_line, 16,
553 &xsum0, &xxsum0); 413 &xsum0, &xxsum0);
554 414
555 *sse = xxsum0; 415 *sse = xxsum0;
556 return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 8)); 416 return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 8));
557 } 417 }
OLDNEW
« no previous file with comments | « source/libvpx/vp8/common/x86/variance_mmx.c ('k') | source/libvpx/vp8/common/x86/variance_ssse3.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698