Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | /* |
michael@0 | 2 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
michael@0 | 3 | * |
michael@0 | 4 | * Use of this source code is governed by a BSD-style license |
michael@0 | 5 | * that can be found in the LICENSE file in the root of the source |
michael@0 | 6 | * tree. An additional intellectual property rights grant can be found |
michael@0 | 7 | * in the file PATENTS. All contributing project authors may |
michael@0 | 8 | * be found in the AUTHORS file in the root of the source tree. |
michael@0 | 9 | */ |
michael@0 | 10 | |
michael@0 | 11 | #include "vpx_config.h" |
michael@0 | 12 | #include "vp8/common/variance.h" |
michael@0 | 13 | #include "vp8/common/pragmas.h" |
michael@0 | 14 | #include "vpx_ports/mem.h" |
michael@0 | 15 | #include "vp8/common/x86/filter_x86.h" |
michael@0 | 16 | |
michael@0 | 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); |
michael@0 | 18 | extern void filter_block1d_v6_mmx(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); |
michael@0 | 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, unsigned int output_height, unsigned int output_width, short *filter); |
michael@0 | 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); |
michael@0 | 21 | |
michael@0 | 22 | extern void vp8_filter_block2d_bil4x4_var_mmx |
michael@0 | 23 | ( |
michael@0 | 24 | const unsigned char *ref_ptr, |
michael@0 | 25 | int ref_pixels_per_line, |
michael@0 | 26 | const unsigned char *src_ptr, |
michael@0 | 27 | int src_pixels_per_line, |
michael@0 | 28 | const short *HFilter, |
michael@0 | 29 | const short *VFilter, |
michael@0 | 30 | int *sum, |
michael@0 | 31 | unsigned int *sumsquared |
michael@0 | 32 | ); |
michael@0 | 33 | |
michael@0 | 34 | extern unsigned int vp8_get4x4var_mmx |
michael@0 | 35 | ( |
michael@0 | 36 | const unsigned char *src_ptr, |
michael@0 | 37 | int source_stride, |
michael@0 | 38 | const unsigned char *ref_ptr, |
michael@0 | 39 | int recon_stride, |
michael@0 | 40 | unsigned int *SSE, |
michael@0 | 41 | int *Sum |
michael@0 | 42 | ); |
michael@0 | 43 | |
michael@0 | 44 | unsigned int vp8_get_mb_ss_sse2 |
michael@0 | 45 | ( |
michael@0 | 46 | const short *src_ptr |
michael@0 | 47 | ); |
michael@0 | 48 | unsigned int vp8_get16x16var_sse2 |
michael@0 | 49 | ( |
michael@0 | 50 | const unsigned char *src_ptr, |
michael@0 | 51 | int source_stride, |
michael@0 | 52 | const unsigned char *ref_ptr, |
michael@0 | 53 | int recon_stride, |
michael@0 | 54 | unsigned int *SSE, |
michael@0 | 55 | int *Sum |
michael@0 | 56 | ); |
michael@0 | 57 | unsigned int vp8_get8x8var_sse2 |
michael@0 | 58 | ( |
michael@0 | 59 | const unsigned char *src_ptr, |
michael@0 | 60 | int source_stride, |
michael@0 | 61 | const unsigned char *ref_ptr, |
michael@0 | 62 | int recon_stride, |
michael@0 | 63 | unsigned int *SSE, |
michael@0 | 64 | int *Sum |
michael@0 | 65 | ); |
michael@0 | 66 | void vp8_filter_block2d_bil_var_sse2 |
michael@0 | 67 | ( |
michael@0 | 68 | const unsigned char *ref_ptr, |
michael@0 | 69 | int ref_pixels_per_line, |
michael@0 | 70 | const unsigned char *src_ptr, |
michael@0 | 71 | int src_pixels_per_line, |
michael@0 | 72 | unsigned int Height, |
michael@0 | 73 | int xoffset, |
michael@0 | 74 | int yoffset, |
michael@0 | 75 | int *sum, |
michael@0 | 76 | unsigned int *sumsquared |
michael@0 | 77 | ); |
michael@0 | 78 | void vp8_half_horiz_vert_variance8x_h_sse2 |
michael@0 | 79 | ( |
michael@0 | 80 | const unsigned char *ref_ptr, |
michael@0 | 81 | int ref_pixels_per_line, |
michael@0 | 82 | const unsigned char *src_ptr, |
michael@0 | 83 | int src_pixels_per_line, |
michael@0 | 84 | unsigned int Height, |
michael@0 | 85 | int *sum, |
michael@0 | 86 | unsigned int *sumsquared |
michael@0 | 87 | ); |
michael@0 | 88 | void vp8_half_horiz_vert_variance16x_h_sse2 |
michael@0 | 89 | ( |
michael@0 | 90 | const unsigned char *ref_ptr, |
michael@0 | 91 | int ref_pixels_per_line, |
michael@0 | 92 | const unsigned char *src_ptr, |
michael@0 | 93 | int src_pixels_per_line, |
michael@0 | 94 | unsigned int Height, |
michael@0 | 95 | int *sum, |
michael@0 | 96 | unsigned int *sumsquared |
michael@0 | 97 | ); |
michael@0 | 98 | void vp8_half_horiz_variance8x_h_sse2 |
michael@0 | 99 | ( |
michael@0 | 100 | const unsigned char *ref_ptr, |
michael@0 | 101 | int ref_pixels_per_line, |
michael@0 | 102 | const unsigned char *src_ptr, |
michael@0 | 103 | int src_pixels_per_line, |
michael@0 | 104 | unsigned int Height, |
michael@0 | 105 | int *sum, |
michael@0 | 106 | unsigned int *sumsquared |
michael@0 | 107 | ); |
michael@0 | 108 | void vp8_half_horiz_variance16x_h_sse2 |
michael@0 | 109 | ( |
michael@0 | 110 | const unsigned char *ref_ptr, |
michael@0 | 111 | int ref_pixels_per_line, |
michael@0 | 112 | const unsigned char *src_ptr, |
michael@0 | 113 | int src_pixels_per_line, |
michael@0 | 114 | unsigned int Height, |
michael@0 | 115 | int *sum, |
michael@0 | 116 | unsigned int *sumsquared |
michael@0 | 117 | ); |
michael@0 | 118 | void vp8_half_vert_variance8x_h_sse2 |
michael@0 | 119 | ( |
michael@0 | 120 | const unsigned char *ref_ptr, |
michael@0 | 121 | int ref_pixels_per_line, |
michael@0 | 122 | const unsigned char *src_ptr, |
michael@0 | 123 | int src_pixels_per_line, |
michael@0 | 124 | unsigned int Height, |
michael@0 | 125 | int *sum, |
michael@0 | 126 | unsigned int *sumsquared |
michael@0 | 127 | ); |
michael@0 | 128 | void vp8_half_vert_variance16x_h_sse2 |
michael@0 | 129 | ( |
michael@0 | 130 | const unsigned char *ref_ptr, |
michael@0 | 131 | int ref_pixels_per_line, |
michael@0 | 132 | const unsigned char *src_ptr, |
michael@0 | 133 | int src_pixels_per_line, |
michael@0 | 134 | unsigned int Height, |
michael@0 | 135 | int *sum, |
michael@0 | 136 | unsigned int *sumsquared |
michael@0 | 137 | ); |
michael@0 | 138 | |
michael@0 | 139 | unsigned int vp8_variance4x4_wmt( |
michael@0 | 140 | const unsigned char *src_ptr, |
michael@0 | 141 | int source_stride, |
michael@0 | 142 | const unsigned char *ref_ptr, |
michael@0 | 143 | int recon_stride, |
michael@0 | 144 | unsigned int *sse) |
michael@0 | 145 | { |
michael@0 | 146 | unsigned int var; |
michael@0 | 147 | int avg; |
michael@0 | 148 | |
michael@0 | 149 | vp8_get4x4var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg) ; |
michael@0 | 150 | *sse = var; |
michael@0 | 151 | return (var - (((unsigned int)avg * avg) >> 4)); |
michael@0 | 152 | |
michael@0 | 153 | } |
michael@0 | 154 | |
michael@0 | 155 | unsigned int vp8_variance8x8_wmt |
michael@0 | 156 | ( |
michael@0 | 157 | const unsigned char *src_ptr, |
michael@0 | 158 | int source_stride, |
michael@0 | 159 | const unsigned char *ref_ptr, |
michael@0 | 160 | int recon_stride, |
michael@0 | 161 | unsigned int *sse) |
michael@0 | 162 | { |
michael@0 | 163 | unsigned int var; |
michael@0 | 164 | int avg; |
michael@0 | 165 | |
michael@0 | 166 | vp8_get8x8var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg) ; |
michael@0 | 167 | *sse = var; |
michael@0 | 168 | return (var - (((unsigned int)avg * avg) >> 6)); |
michael@0 | 169 | |
michael@0 | 170 | } |
michael@0 | 171 | |
michael@0 | 172 | |
michael@0 | 173 | unsigned int vp8_variance16x16_wmt |
michael@0 | 174 | ( |
michael@0 | 175 | const unsigned char *src_ptr, |
michael@0 | 176 | int source_stride, |
michael@0 | 177 | const unsigned char *ref_ptr, |
michael@0 | 178 | int recon_stride, |
michael@0 | 179 | unsigned int *sse) |
michael@0 | 180 | { |
michael@0 | 181 | unsigned int sse0; |
michael@0 | 182 | int sum0; |
michael@0 | 183 | |
michael@0 | 184 | |
michael@0 | 185 | vp8_get16x16var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum0) ; |
michael@0 | 186 | *sse = sse0; |
michael@0 | 187 | return (sse0 - (((unsigned int)sum0 * sum0) >> 8)); |
michael@0 | 188 | } |
michael@0 | 189 | unsigned int vp8_mse16x16_wmt( |
michael@0 | 190 | const unsigned char *src_ptr, |
michael@0 | 191 | int source_stride, |
michael@0 | 192 | const unsigned char *ref_ptr, |
michael@0 | 193 | int recon_stride, |
michael@0 | 194 | unsigned int *sse) |
michael@0 | 195 | { |
michael@0 | 196 | |
michael@0 | 197 | unsigned int sse0; |
michael@0 | 198 | int sum0; |
michael@0 | 199 | vp8_get16x16var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum0) ; |
michael@0 | 200 | *sse = sse0; |
michael@0 | 201 | return sse0; |
michael@0 | 202 | |
michael@0 | 203 | } |
michael@0 | 204 | |
michael@0 | 205 | |
michael@0 | 206 | unsigned int vp8_variance16x8_wmt |
michael@0 | 207 | ( |
michael@0 | 208 | const unsigned char *src_ptr, |
michael@0 | 209 | int source_stride, |
michael@0 | 210 | const unsigned char *ref_ptr, |
michael@0 | 211 | int recon_stride, |
michael@0 | 212 | unsigned int *sse) |
michael@0 | 213 | { |
michael@0 | 214 | unsigned int sse0, sse1, var; |
michael@0 | 215 | int sum0, sum1, avg; |
michael@0 | 216 | |
michael@0 | 217 | vp8_get8x8var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum0) ; |
michael@0 | 218 | vp8_get8x8var_sse2(src_ptr + 8, source_stride, ref_ptr + 8, recon_stride, &sse1, &sum1); |
michael@0 | 219 | |
michael@0 | 220 | var = sse0 + sse1; |
michael@0 | 221 | avg = sum0 + sum1; |
michael@0 | 222 | *sse = var; |
michael@0 | 223 | return (var - (((unsigned int)avg * avg) >> 7)); |
michael@0 | 224 | |
michael@0 | 225 | } |
michael@0 | 226 | |
michael@0 | 227 | unsigned int vp8_variance8x16_wmt |
michael@0 | 228 | ( |
michael@0 | 229 | const unsigned char *src_ptr, |
michael@0 | 230 | int source_stride, |
michael@0 | 231 | const unsigned char *ref_ptr, |
michael@0 | 232 | int recon_stride, |
michael@0 | 233 | unsigned int *sse) |
michael@0 | 234 | { |
michael@0 | 235 | unsigned int sse0, sse1, var; |
michael@0 | 236 | int sum0, sum1, avg; |
michael@0 | 237 | |
michael@0 | 238 | vp8_get8x8var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum0) ; |
michael@0 | 239 | vp8_get8x8var_sse2(src_ptr + 8 * source_stride, source_stride, ref_ptr + 8 * recon_stride, recon_stride, &sse1, &sum1) ; |
michael@0 | 240 | |
michael@0 | 241 | var = sse0 + sse1; |
michael@0 | 242 | avg = sum0 + sum1; |
michael@0 | 243 | *sse = var; |
michael@0 | 244 | return (var - (((unsigned int)avg * avg) >> 7)); |
michael@0 | 245 | |
michael@0 | 246 | } |
michael@0 | 247 | |
michael@0 | 248 | unsigned int vp8_sub_pixel_variance4x4_wmt |
michael@0 | 249 | ( |
michael@0 | 250 | const unsigned char *src_ptr, |
michael@0 | 251 | int src_pixels_per_line, |
michael@0 | 252 | int xoffset, |
michael@0 | 253 | int yoffset, |
michael@0 | 254 | const unsigned char *dst_ptr, |
michael@0 | 255 | int dst_pixels_per_line, |
michael@0 | 256 | unsigned int *sse |
michael@0 | 257 | ) |
michael@0 | 258 | { |
michael@0 | 259 | int xsum; |
michael@0 | 260 | unsigned int xxsum; |
michael@0 | 261 | vp8_filter_block2d_bil4x4_var_mmx( |
michael@0 | 262 | src_ptr, src_pixels_per_line, |
michael@0 | 263 | dst_ptr, dst_pixels_per_line, |
michael@0 | 264 | vp8_bilinear_filters_x86_4[xoffset], vp8_bilinear_filters_x86_4[yoffset], |
michael@0 | 265 | &xsum, &xxsum |
michael@0 | 266 | ); |
michael@0 | 267 | *sse = xxsum; |
michael@0 | 268 | return (xxsum - (((unsigned int)xsum * xsum) >> 4)); |
michael@0 | 269 | } |
michael@0 | 270 | |
michael@0 | 271 | |
michael@0 | 272 | unsigned int vp8_sub_pixel_variance8x8_wmt |
michael@0 | 273 | ( |
michael@0 | 274 | const unsigned char *src_ptr, |
michael@0 | 275 | int src_pixels_per_line, |
michael@0 | 276 | int xoffset, |
michael@0 | 277 | int yoffset, |
michael@0 | 278 | const unsigned char *dst_ptr, |
michael@0 | 279 | int dst_pixels_per_line, |
michael@0 | 280 | unsigned int *sse |
michael@0 | 281 | ) |
michael@0 | 282 | { |
michael@0 | 283 | int xsum; |
michael@0 | 284 | unsigned int xxsum; |
michael@0 | 285 | |
michael@0 | 286 | if (xoffset == 4 && yoffset == 0) |
michael@0 | 287 | { |
michael@0 | 288 | vp8_half_horiz_variance8x_h_sse2( |
michael@0 | 289 | src_ptr, src_pixels_per_line, |
michael@0 | 290 | dst_ptr, dst_pixels_per_line, 8, |
michael@0 | 291 | &xsum, &xxsum); |
michael@0 | 292 | } |
michael@0 | 293 | else if (xoffset == 0 && yoffset == 4) |
michael@0 | 294 | { |
michael@0 | 295 | vp8_half_vert_variance8x_h_sse2( |
michael@0 | 296 | src_ptr, src_pixels_per_line, |
michael@0 | 297 | dst_ptr, dst_pixels_per_line, 8, |
michael@0 | 298 | &xsum, &xxsum); |
michael@0 | 299 | } |
michael@0 | 300 | else if (xoffset == 4 && yoffset == 4) |
michael@0 | 301 | { |
michael@0 | 302 | vp8_half_horiz_vert_variance8x_h_sse2( |
michael@0 | 303 | src_ptr, src_pixels_per_line, |
michael@0 | 304 | dst_ptr, dst_pixels_per_line, 8, |
michael@0 | 305 | &xsum, &xxsum); |
michael@0 | 306 | } |
michael@0 | 307 | else |
michael@0 | 308 | { |
michael@0 | 309 | vp8_filter_block2d_bil_var_sse2( |
michael@0 | 310 | src_ptr, src_pixels_per_line, |
michael@0 | 311 | dst_ptr, dst_pixels_per_line, 8, |
michael@0 | 312 | xoffset, yoffset, |
michael@0 | 313 | &xsum, &xxsum); |
michael@0 | 314 | } |
michael@0 | 315 | |
michael@0 | 316 | *sse = xxsum; |
michael@0 | 317 | return (xxsum - (((unsigned int)xsum * xsum) >> 6)); |
michael@0 | 318 | } |
michael@0 | 319 | |
michael@0 | 320 | unsigned int vp8_sub_pixel_variance16x16_wmt |
michael@0 | 321 | ( |
michael@0 | 322 | const unsigned char *src_ptr, |
michael@0 | 323 | int src_pixels_per_line, |
michael@0 | 324 | int xoffset, |
michael@0 | 325 | int yoffset, |
michael@0 | 326 | const unsigned char *dst_ptr, |
michael@0 | 327 | int dst_pixels_per_line, |
michael@0 | 328 | unsigned int *sse |
michael@0 | 329 | ) |
michael@0 | 330 | { |
michael@0 | 331 | int xsum0, xsum1; |
michael@0 | 332 | unsigned int xxsum0, xxsum1; |
michael@0 | 333 | |
michael@0 | 334 | |
michael@0 | 335 | /* note we could avoid these if statements if the calling function |
michael@0 | 336 | * just called the appropriate functions inside. |
michael@0 | 337 | */ |
michael@0 | 338 | if (xoffset == 4 && yoffset == 0) |
michael@0 | 339 | { |
michael@0 | 340 | vp8_half_horiz_variance16x_h_sse2( |
michael@0 | 341 | src_ptr, src_pixels_per_line, |
michael@0 | 342 | dst_ptr, dst_pixels_per_line, 16, |
michael@0 | 343 | &xsum0, &xxsum0); |
michael@0 | 344 | } |
michael@0 | 345 | else if (xoffset == 0 && yoffset == 4) |
michael@0 | 346 | { |
michael@0 | 347 | vp8_half_vert_variance16x_h_sse2( |
michael@0 | 348 | src_ptr, src_pixels_per_line, |
michael@0 | 349 | dst_ptr, dst_pixels_per_line, 16, |
michael@0 | 350 | &xsum0, &xxsum0); |
michael@0 | 351 | } |
michael@0 | 352 | else if (xoffset == 4 && yoffset == 4) |
michael@0 | 353 | { |
michael@0 | 354 | vp8_half_horiz_vert_variance16x_h_sse2( |
michael@0 | 355 | src_ptr, src_pixels_per_line, |
michael@0 | 356 | dst_ptr, dst_pixels_per_line, 16, |
michael@0 | 357 | &xsum0, &xxsum0); |
michael@0 | 358 | } |
michael@0 | 359 | else |
michael@0 | 360 | { |
michael@0 | 361 | vp8_filter_block2d_bil_var_sse2( |
michael@0 | 362 | src_ptr, src_pixels_per_line, |
michael@0 | 363 | dst_ptr, dst_pixels_per_line, 16, |
michael@0 | 364 | xoffset, yoffset, |
michael@0 | 365 | &xsum0, &xxsum0 |
michael@0 | 366 | ); |
michael@0 | 367 | |
michael@0 | 368 | vp8_filter_block2d_bil_var_sse2( |
michael@0 | 369 | src_ptr + 8, src_pixels_per_line, |
michael@0 | 370 | dst_ptr + 8, dst_pixels_per_line, 16, |
michael@0 | 371 | xoffset, yoffset, |
michael@0 | 372 | &xsum1, &xxsum1 |
michael@0 | 373 | ); |
michael@0 | 374 | xsum0 += xsum1; |
michael@0 | 375 | xxsum0 += xxsum1; |
michael@0 | 376 | } |
michael@0 | 377 | |
michael@0 | 378 | *sse = xxsum0; |
michael@0 | 379 | return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 8)); |
michael@0 | 380 | } |
michael@0 | 381 | |
michael@0 | 382 | unsigned int vp8_sub_pixel_mse16x16_wmt( |
michael@0 | 383 | const unsigned char *src_ptr, |
michael@0 | 384 | int src_pixels_per_line, |
michael@0 | 385 | int xoffset, |
michael@0 | 386 | int yoffset, |
michael@0 | 387 | const unsigned char *dst_ptr, |
michael@0 | 388 | int dst_pixels_per_line, |
michael@0 | 389 | unsigned int *sse |
michael@0 | 390 | ) |
michael@0 | 391 | { |
michael@0 | 392 | vp8_sub_pixel_variance16x16_wmt(src_ptr, src_pixels_per_line, xoffset, yoffset, dst_ptr, dst_pixels_per_line, sse); |
michael@0 | 393 | return *sse; |
michael@0 | 394 | } |
michael@0 | 395 | |
michael@0 | 396 | unsigned int vp8_sub_pixel_variance16x8_wmt |
michael@0 | 397 | ( |
michael@0 | 398 | const unsigned char *src_ptr, |
michael@0 | 399 | int src_pixels_per_line, |
michael@0 | 400 | int xoffset, |
michael@0 | 401 | int yoffset, |
michael@0 | 402 | const unsigned char *dst_ptr, |
michael@0 | 403 | int dst_pixels_per_line, |
michael@0 | 404 | unsigned int *sse |
michael@0 | 405 | |
michael@0 | 406 | ) |
michael@0 | 407 | { |
michael@0 | 408 | int xsum0, xsum1; |
michael@0 | 409 | unsigned int xxsum0, xxsum1; |
michael@0 | 410 | |
michael@0 | 411 | if (xoffset == 4 && yoffset == 0) |
michael@0 | 412 | { |
michael@0 | 413 | vp8_half_horiz_variance16x_h_sse2( |
michael@0 | 414 | src_ptr, src_pixels_per_line, |
michael@0 | 415 | dst_ptr, dst_pixels_per_line, 8, |
michael@0 | 416 | &xsum0, &xxsum0); |
michael@0 | 417 | } |
michael@0 | 418 | else if (xoffset == 0 && yoffset == 4) |
michael@0 | 419 | { |
michael@0 | 420 | vp8_half_vert_variance16x_h_sse2( |
michael@0 | 421 | src_ptr, src_pixels_per_line, |
michael@0 | 422 | dst_ptr, dst_pixels_per_line, 8, |
michael@0 | 423 | &xsum0, &xxsum0); |
michael@0 | 424 | } |
michael@0 | 425 | else if (xoffset == 4 && yoffset == 4) |
michael@0 | 426 | { |
michael@0 | 427 | vp8_half_horiz_vert_variance16x_h_sse2( |
michael@0 | 428 | src_ptr, src_pixels_per_line, |
michael@0 | 429 | dst_ptr, dst_pixels_per_line, 8, |
michael@0 | 430 | &xsum0, &xxsum0); |
michael@0 | 431 | } |
michael@0 | 432 | else |
michael@0 | 433 | { |
michael@0 | 434 | vp8_filter_block2d_bil_var_sse2( |
michael@0 | 435 | src_ptr, src_pixels_per_line, |
michael@0 | 436 | dst_ptr, dst_pixels_per_line, 8, |
michael@0 | 437 | xoffset, yoffset, |
michael@0 | 438 | &xsum0, &xxsum0); |
michael@0 | 439 | |
michael@0 | 440 | vp8_filter_block2d_bil_var_sse2( |
michael@0 | 441 | src_ptr + 8, src_pixels_per_line, |
michael@0 | 442 | dst_ptr + 8, dst_pixels_per_line, 8, |
michael@0 | 443 | xoffset, yoffset, |
michael@0 | 444 | &xsum1, &xxsum1); |
michael@0 | 445 | xsum0 += xsum1; |
michael@0 | 446 | xxsum0 += xxsum1; |
michael@0 | 447 | } |
michael@0 | 448 | |
michael@0 | 449 | *sse = xxsum0; |
michael@0 | 450 | return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 7)); |
michael@0 | 451 | } |
michael@0 | 452 | |
michael@0 | 453 | unsigned int vp8_sub_pixel_variance8x16_wmt |
michael@0 | 454 | ( |
michael@0 | 455 | const unsigned char *src_ptr, |
michael@0 | 456 | int src_pixels_per_line, |
michael@0 | 457 | int xoffset, |
michael@0 | 458 | int yoffset, |
michael@0 | 459 | const unsigned char *dst_ptr, |
michael@0 | 460 | int dst_pixels_per_line, |
michael@0 | 461 | unsigned int *sse |
michael@0 | 462 | ) |
michael@0 | 463 | { |
michael@0 | 464 | int xsum; |
michael@0 | 465 | unsigned int xxsum; |
michael@0 | 466 | |
michael@0 | 467 | if (xoffset == 4 && yoffset == 0) |
michael@0 | 468 | { |
michael@0 | 469 | vp8_half_horiz_variance8x_h_sse2( |
michael@0 | 470 | src_ptr, src_pixels_per_line, |
michael@0 | 471 | dst_ptr, dst_pixels_per_line, 16, |
michael@0 | 472 | &xsum, &xxsum); |
michael@0 | 473 | } |
michael@0 | 474 | else if (xoffset == 0 && yoffset == 4) |
michael@0 | 475 | { |
michael@0 | 476 | vp8_half_vert_variance8x_h_sse2( |
michael@0 | 477 | src_ptr, src_pixels_per_line, |
michael@0 | 478 | dst_ptr, dst_pixels_per_line, 16, |
michael@0 | 479 | &xsum, &xxsum); |
michael@0 | 480 | } |
michael@0 | 481 | else if (xoffset == 4 && yoffset == 4) |
michael@0 | 482 | { |
michael@0 | 483 | vp8_half_horiz_vert_variance8x_h_sse2( |
michael@0 | 484 | src_ptr, src_pixels_per_line, |
michael@0 | 485 | dst_ptr, dst_pixels_per_line, 16, |
michael@0 | 486 | &xsum, &xxsum); |
michael@0 | 487 | } |
michael@0 | 488 | else |
michael@0 | 489 | { |
michael@0 | 490 | vp8_filter_block2d_bil_var_sse2( |
michael@0 | 491 | src_ptr, src_pixels_per_line, |
michael@0 | 492 | dst_ptr, dst_pixels_per_line, 16, |
michael@0 | 493 | xoffset, yoffset, |
michael@0 | 494 | &xsum, &xxsum); |
michael@0 | 495 | } |
michael@0 | 496 | |
michael@0 | 497 | *sse = xxsum; |
michael@0 | 498 | return (xxsum - (((unsigned int)xsum * xsum) >> 7)); |
michael@0 | 499 | } |
michael@0 | 500 | |
michael@0 | 501 | |
michael@0 | 502 | unsigned int vp8_variance_halfpixvar16x16_h_wmt( |
michael@0 | 503 | const unsigned char *src_ptr, |
michael@0 | 504 | int src_pixels_per_line, |
michael@0 | 505 | const unsigned char *dst_ptr, |
michael@0 | 506 | int dst_pixels_per_line, |
michael@0 | 507 | unsigned int *sse) |
michael@0 | 508 | { |
michael@0 | 509 | int xsum0; |
michael@0 | 510 | unsigned int xxsum0; |
michael@0 | 511 | |
michael@0 | 512 | vp8_half_horiz_variance16x_h_sse2( |
michael@0 | 513 | src_ptr, src_pixels_per_line, |
michael@0 | 514 | dst_ptr, dst_pixels_per_line, 16, |
michael@0 | 515 | &xsum0, &xxsum0); |
michael@0 | 516 | |
michael@0 | 517 | *sse = xxsum0; |
michael@0 | 518 | return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 8)); |
michael@0 | 519 | } |
michael@0 | 520 | |
michael@0 | 521 | |
michael@0 | 522 | unsigned int vp8_variance_halfpixvar16x16_v_wmt( |
michael@0 | 523 | const unsigned char *src_ptr, |
michael@0 | 524 | int src_pixels_per_line, |
michael@0 | 525 | const unsigned char *dst_ptr, |
michael@0 | 526 | int dst_pixels_per_line, |
michael@0 | 527 | unsigned int *sse) |
michael@0 | 528 | { |
michael@0 | 529 | int xsum0; |
michael@0 | 530 | unsigned int xxsum0; |
michael@0 | 531 | vp8_half_vert_variance16x_h_sse2( |
michael@0 | 532 | src_ptr, src_pixels_per_line, |
michael@0 | 533 | dst_ptr, dst_pixels_per_line, 16, |
michael@0 | 534 | &xsum0, &xxsum0); |
michael@0 | 535 | |
michael@0 | 536 | *sse = xxsum0; |
michael@0 | 537 | return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 8)); |
michael@0 | 538 | } |
michael@0 | 539 | |
michael@0 | 540 | |
michael@0 | 541 | unsigned int vp8_variance_halfpixvar16x16_hv_wmt( |
michael@0 | 542 | const unsigned char *src_ptr, |
michael@0 | 543 | int src_pixels_per_line, |
michael@0 | 544 | const unsigned char *dst_ptr, |
michael@0 | 545 | int dst_pixels_per_line, |
michael@0 | 546 | unsigned int *sse) |
michael@0 | 547 | { |
michael@0 | 548 | int xsum0; |
michael@0 | 549 | unsigned int xxsum0; |
michael@0 | 550 | |
michael@0 | 551 | vp8_half_horiz_vert_variance16x_h_sse2( |
michael@0 | 552 | src_ptr, src_pixels_per_line, |
michael@0 | 553 | dst_ptr, dst_pixels_per_line, 16, |
michael@0 | 554 | &xsum0, &xxsum0); |
michael@0 | 555 | |
michael@0 | 556 | *sse = xxsum0; |
michael@0 | 557 | return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 8)); |
michael@0 | 558 | } |