Line data Source code
1 : /*
2 : * Copyright (c) 2016, Alliance for Open Media. All rights reserved
3 : *
4 : * This source code is subject to the terms of the BSD 2 Clause License and
5 : * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6 : * was not distributed with this source code in the LICENSE file, you can
7 : * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8 : * Media Patent License 1.0 was not distributed with this source code in the
9 : * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10 : */
11 :
12 : #include <assert.h>
13 :
14 : #include "./aom_config.h"
15 : #include "./aom_dsp_rtcd.h"
16 : #include "aom/aom_integer.h"
17 :
18 : void aom_half_horiz_vert_variance16x_h_sse2(const unsigned char *ref,
19 : int ref_stride,
20 : const unsigned char *src,
21 : int src_stride, unsigned int height,
22 : int *sum, unsigned int *sumsquared);
23 : void aom_half_horiz_variance16x_h_sse2(const unsigned char *ref, int ref_stride,
24 : const unsigned char *src, int src_stride,
25 : unsigned int height, int *sum,
26 : unsigned int *sumsquared);
27 : void aom_half_vert_variance16x_h_sse2(const unsigned char *ref, int ref_stride,
28 : const unsigned char *src, int src_stride,
29 : unsigned int height, int *sum,
30 : unsigned int *sumsquared);
31 :
32 0 : uint32_t aom_variance_halfpixvar16x16_h_sse2(const unsigned char *src,
33 : int src_stride,
34 : const unsigned char *dst,
35 : int dst_stride, uint32_t *sse) {
36 : int xsum0;
37 : unsigned int xxsum0;
38 :
39 0 : aom_half_horiz_variance16x_h_sse2(src, src_stride, dst, dst_stride, 16,
40 : &xsum0, &xxsum0);
41 :
42 0 : *sse = xxsum0;
43 0 : assert(xsum0 <= 255 * 16 * 16);
44 0 : assert(xsum0 >= -255 * 16 * 16);
45 0 : return (xxsum0 - ((uint32_t)((int64_t)xsum0 * xsum0) >> 8));
46 : }
47 :
48 0 : uint32_t aom_variance_halfpixvar16x16_v_sse2(const unsigned char *src,
49 : int src_stride,
50 : const unsigned char *dst,
51 : int dst_stride, uint32_t *sse) {
52 : int xsum0;
53 : unsigned int xxsum0;
54 0 : aom_half_vert_variance16x_h_sse2(src, src_stride, dst, dst_stride, 16, &xsum0,
55 : &xxsum0);
56 :
57 0 : *sse = xxsum0;
58 0 : assert(xsum0 <= 255 * 16 * 16);
59 0 : assert(xsum0 >= -255 * 16 * 16);
60 0 : return (xxsum0 - ((uint32_t)((int64_t)xsum0 * xsum0) >> 8));
61 : }
62 :
63 0 : uint32_t aom_variance_halfpixvar16x16_hv_sse2(const unsigned char *src,
64 : int src_stride,
65 : const unsigned char *dst,
66 : int dst_stride, uint32_t *sse) {
67 : int xsum0;
68 : unsigned int xxsum0;
69 :
70 0 : aom_half_horiz_vert_variance16x_h_sse2(src, src_stride, dst, dst_stride, 16,
71 : &xsum0, &xxsum0);
72 :
73 0 : *sse = xxsum0;
74 0 : assert(xsum0 <= 255 * 16 * 16);
75 0 : assert(xsum0 >= -255 * 16 * 16);
76 0 : return (xxsum0 - ((uint32_t)((int64_t)xsum0 * xsum0) >> 8));
77 : }
|