Coverage Report

Created: 2026-10-28 08:13

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libvpx/vpx_dsp/variance.c
Line
Count
Source
1
/*
2
 *  Copyright (c) 2010 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
#include <assert.h>
11
#include <limits.h>
12
#include <stdlib.h>
13
14
#include "./vpx_config.h"
15
#include "./vpx_dsp_rtcd.h"
16
17
#include "vpx_ports/compiler_attributes.h"
18
#include "vpx_ports/mem.h"
19
#include "vpx/vpx_integer.h"
20
21
#include "vpx_dsp/variance.h"
22
23
static const uint8_t bilinear_filters[8][2] = {
24
  { 128, 0 }, { 112, 16 }, { 96, 32 }, { 80, 48 },
25
  { 64, 64 }, { 48, 80 },  { 32, 96 }, { 16, 112 },
26
};
27
28
uint32_t vpx_get4x4sse_cs_c(const uint8_t *src_ptr, int src_stride,
29
27.9M
                            const uint8_t *ref_ptr, int ref_stride) {
30
27.9M
  int distortion = 0;
31
27.9M
  int r, c;
32
33
139M
  for (r = 0; r < 4; ++r) {
34
559M
    for (c = 0; c < 4; ++c) {
35
447M
      int diff = src_ptr[c] - ref_ptr[c];
36
447M
      distortion += diff * diff;
37
447M
    }
38
39
111M
    src_ptr += src_stride;
40
111M
    ref_ptr += ref_stride;
41
111M
  }
42
43
27.9M
  return distortion;
44
27.9M
}
45
46
0
uint32_t vpx_get_mb_ss_c(const int16_t *src_ptr) {
47
0
  unsigned int i, sum = 0;
48
49
0
  for (i = 0; i < 256; ++i) {
50
0
    sum += src_ptr[i] * src_ptr[i];
51
0
  }
52
53
0
  return sum;
54
0
}
55
56
static void variance(const uint8_t *src_ptr, int src_stride,
57
                     const uint8_t *ref_ptr, int ref_stride, int w, int h,
58
0
                     uint32_t *sse, int *sum) {
59
0
  int i, j;
60
61
0
  *sum = 0;
62
0
  *sse = 0;
63
64
0
  for (i = 0; i < h; ++i) {
65
0
    for (j = 0; j < w; ++j) {
66
0
      const int diff = src_ptr[j] - ref_ptr[j];
67
0
      *sum += diff;
68
0
      *sse += diff * diff;
69
0
    }
70
71
0
    src_ptr += src_stride;
72
0
    ref_ptr += ref_stride;
73
0
  }
74
0
}
75
76
// Applies a 1-D 2-tap bilinear filter to the source block in either horizontal
77
// or vertical direction to produce the filtered output block. Used to implement
78
// the first-pass of 2-D separable filter.
79
//
80
// Produces int16_t output to retain precision for the next pass. Two filter
81
// taps should sum to FILTER_WEIGHT. pixel_step defines whether the filter is
82
// applied horizontally (pixel_step = 1) or vertically (pixel_step = stride).
83
// It defines the offset required to move from one input to the next.
84
static void var_filter_block2d_bil_first_pass(
85
    const uint8_t *src_ptr, uint16_t *ref_ptr, unsigned int src_pixels_per_line,
86
    int pixel_step, unsigned int output_height, unsigned int output_width,
87
0
    const uint8_t *filter) {
88
0
  unsigned int i, j;
89
90
0
  for (i = 0; i < output_height; ++i) {
91
0
    for (j = 0; j < output_width; ++j) {
92
0
      ref_ptr[j] = ROUND_POWER_OF_TWO(
93
0
          (int)src_ptr[0] * filter[0] + (int)src_ptr[pixel_step] * filter[1],
94
0
          FILTER_BITS);
95
96
0
      ++src_ptr;
97
0
    }
98
99
0
    src_ptr += src_pixels_per_line - output_width;
100
0
    ref_ptr += output_width;
101
0
  }
102
0
}
103
104
// Applies a 1-D 2-tap bilinear filter to the source block in either horizontal
105
// or vertical direction to produce the filtered output block. Used to implement
106
// the second-pass of 2-D separable filter.
107
//
108
// Requires 16-bit input as produced by filter_block2d_bil_first_pass. Two
109
// filter taps should sum to FILTER_WEIGHT. pixel_step defines whether the
110
// filter is applied horizontally (pixel_step = 1) or vertically
111
// (pixel_step = stride). It defines the offset required to move from one input
112
// to the next. Output is 8-bit.
113
static void var_filter_block2d_bil_second_pass(
114
    const uint16_t *src_ptr, uint8_t *ref_ptr, unsigned int src_pixels_per_line,
115
    unsigned int pixel_step, unsigned int output_height,
116
0
    unsigned int output_width, const uint8_t *filter) {
117
0
  unsigned int i, j;
118
119
0
  for (i = 0; i < output_height; ++i) {
120
0
    for (j = 0; j < output_width; ++j) {
121
0
      ref_ptr[j] = ROUND_POWER_OF_TWO(
122
0
          (int)src_ptr[0] * filter[0] + (int)src_ptr[pixel_step] * filter[1],
123
0
          FILTER_BITS);
124
0
      ++src_ptr;
125
0
    }
126
127
0
    src_ptr += src_pixels_per_line - output_width;
128
0
    ref_ptr += output_width;
129
0
  }
130
0
}
131
132
#define VAR(W, H)                                                            \
133
  uint32_t vpx_variance##W##x##H##_c(const uint8_t *src_ptr, int src_stride, \
134
                                     const uint8_t *ref_ptr, int ref_stride, \
135
0
                                     uint32_t *sse) {                        \
136
0
    int sum;                                                                 \
137
0
    variance(src_ptr, src_stride, ref_ptr, ref_stride, W, H, sse, &sum);     \
138
0
    return *sse - (uint32_t)(((int64_t)sum * sum) / (W * H));                \
139
0
  }
Unexecuted instantiation: vpx_variance64x64_c
Unexecuted instantiation: vpx_variance64x32_c
Unexecuted instantiation: vpx_variance32x64_c
Unexecuted instantiation: vpx_variance32x32_c
Unexecuted instantiation: vpx_variance32x16_c
Unexecuted instantiation: vpx_variance16x32_c
Unexecuted instantiation: vpx_variance16x16_c
Unexecuted instantiation: vpx_variance16x8_c
Unexecuted instantiation: vpx_variance8x16_c
Unexecuted instantiation: vpx_variance8x8_c
Unexecuted instantiation: vpx_variance8x4_c
Unexecuted instantiation: vpx_variance4x8_c
Unexecuted instantiation: vpx_variance4x4_c
140
141
#define SUBPIX_VAR(W, H)                                                     \
142
  uint32_t vpx_sub_pixel_variance##W##x##H##_c(                              \
143
      const uint8_t *src_ptr, int src_stride, int x_offset, int y_offset,    \
144
0
      const uint8_t *ref_ptr, int ref_stride, uint32_t *sse) {               \
145
0
    uint16_t fdata3[(H + 1) * W];                                            \
146
0
    uint8_t temp2[H * W];                                                    \
147
0
                                                                             \
148
0
    var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_stride, 1, H + 1, \
149
0
                                      W, bilinear_filters[x_offset]);        \
150
0
    var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W,            \
151
0
                                       bilinear_filters[y_offset]);          \
152
0
                                                                             \
153
0
    return vpx_variance##W##x##H##_c(temp2, W, ref_ptr, ref_stride, sse);    \
154
0
  }
Unexecuted instantiation: vpx_sub_pixel_variance64x64_c
Unexecuted instantiation: vpx_sub_pixel_variance64x32_c
Unexecuted instantiation: vpx_sub_pixel_variance32x64_c
Unexecuted instantiation: vpx_sub_pixel_variance32x32_c
Unexecuted instantiation: vpx_sub_pixel_variance32x16_c
Unexecuted instantiation: vpx_sub_pixel_variance16x32_c
Unexecuted instantiation: vpx_sub_pixel_variance16x16_c
Unexecuted instantiation: vpx_sub_pixel_variance16x8_c
Unexecuted instantiation: vpx_sub_pixel_variance8x16_c
Unexecuted instantiation: vpx_sub_pixel_variance8x8_c
Unexecuted instantiation: vpx_sub_pixel_variance8x4_c
Unexecuted instantiation: vpx_sub_pixel_variance4x8_c
Unexecuted instantiation: vpx_sub_pixel_variance4x4_c
155
156
#define SUBPIX_AVG_VAR(W, H)                                                 \
157
  uint32_t vpx_sub_pixel_avg_variance##W##x##H##_c(                          \
158
      const uint8_t *src_ptr, int src_stride, int x_offset, int y_offset,    \
159
      const uint8_t *ref_ptr, int ref_stride, uint32_t *sse,                 \
160
0
      const uint8_t *second_pred) {                                          \
161
0
    uint16_t fdata3[(H + 1) * W];                                            \
162
0
    uint8_t temp2[H * W];                                                    \
163
0
    DECLARE_ALIGNED(32, uint8_t, temp3[H * W]);                              \
164
0
                                                                             \
165
0
    var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_stride, 1, H + 1, \
166
0
                                      W, bilinear_filters[x_offset]);        \
167
0
    var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W,            \
168
0
                                       bilinear_filters[y_offset]);          \
169
0
                                                                             \
170
0
    vpx_comp_avg_pred_c(temp3, second_pred, W, H, temp2, W);                 \
171
0
                                                                             \
172
0
    return vpx_variance##W##x##H##_c(temp3, W, ref_ptr, ref_stride, sse);    \
173
0
  }
Unexecuted instantiation: vpx_sub_pixel_avg_variance64x64_c
Unexecuted instantiation: vpx_sub_pixel_avg_variance64x32_c
Unexecuted instantiation: vpx_sub_pixel_avg_variance32x64_c
Unexecuted instantiation: vpx_sub_pixel_avg_variance32x32_c
Unexecuted instantiation: vpx_sub_pixel_avg_variance32x16_c
Unexecuted instantiation: vpx_sub_pixel_avg_variance16x32_c
Unexecuted instantiation: vpx_sub_pixel_avg_variance16x16_c
Unexecuted instantiation: vpx_sub_pixel_avg_variance16x8_c
Unexecuted instantiation: vpx_sub_pixel_avg_variance8x16_c
Unexecuted instantiation: vpx_sub_pixel_avg_variance8x8_c
Unexecuted instantiation: vpx_sub_pixel_avg_variance8x4_c
Unexecuted instantiation: vpx_sub_pixel_avg_variance4x8_c
Unexecuted instantiation: vpx_sub_pixel_avg_variance4x4_c
174
175
/* Identical to the variance call except it takes an additional parameter, sum,
176
 * and returns that value using pass-by-reference instead of returning
177
 * sse - sum^2 / w*h
178
 */
179
#define GET_VAR(W, H)                                                   \
180
  void vpx_get##W##x##H##var_c(const uint8_t *src_ptr, int src_stride,  \
181
                               const uint8_t *ref_ptr, int ref_stride,  \
182
0
                               uint32_t *sse, int *sum) {               \
183
0
    variance(src_ptr, src_stride, ref_ptr, ref_stride, W, H, sse, sum); \
184
0
  }
Unexecuted instantiation: vpx_get16x16var_c
Unexecuted instantiation: vpx_get8x8var_c
185
186
/* Identical to the variance call except it does not calculate the
187
 * sse - sum^2 / w*h and returns sse in addition to modifying the passed in
188
 * variable.
189
 */
190
#define MSE(W, H)                                                        \
191
  uint32_t vpx_mse##W##x##H##_c(const uint8_t *src_ptr, int src_stride,  \
192
                                const uint8_t *ref_ptr, int ref_stride,  \
193
0
                                uint32_t *sse) {                         \
194
0
    int sum;                                                             \
195
0
    variance(src_ptr, src_stride, ref_ptr, ref_stride, W, H, sse, &sum); \
196
0
    return *sse;                                                         \
197
0
  }
Unexecuted instantiation: vpx_mse16x16_c
Unexecuted instantiation: vpx_mse16x8_c
Unexecuted instantiation: vpx_mse8x16_c
Unexecuted instantiation: vpx_mse8x8_c
198
199
/* All three forms of the variance are available in the same sizes. */
200
#define VARIANCES(W, H) \
201
  VAR(W, H)             \
202
  SUBPIX_VAR(W, H)      \
203
  SUBPIX_AVG_VAR(W, H)
204
205
VARIANCES(64, 64)
206
VARIANCES(64, 32)
207
VARIANCES(32, 64)
208
VARIANCES(32, 32)
209
VARIANCES(32, 16)
210
VARIANCES(16, 32)
211
VARIANCES(16, 16)
212
VARIANCES(16, 8)
213
VARIANCES(8, 16)
214
VARIANCES(8, 8)
215
VARIANCES(8, 4)
216
VARIANCES(4, 8)
217
VARIANCES(4, 4)
218
219
GET_VAR(16, 16)
220
GET_VAR(8, 8)
221
222
MSE(16, 16)
223
MSE(16, 8)
224
MSE(8, 16)
225
MSE(8, 8)
226
227
void vpx_comp_avg_pred_c(uint8_t *comp_pred, const uint8_t *pred, int width,
228
0
                         int height, const uint8_t *ref, int ref_stride) {
229
0
  int i, j;
230
231
0
  for (i = 0; i < height; ++i) {
232
0
    for (j = 0; j < width; ++j) {
233
0
      const int tmp = pred[j] + ref[j];
234
0
      comp_pred[j] = ROUND_POWER_OF_TWO(tmp, 1);
235
0
    }
236
0
    comp_pred += width;
237
0
    pred += width;
238
0
    ref += ref_stride;
239
0
  }
240
0
}
241
242
#if CONFIG_VP9_HIGHBITDEPTH
243
// Note this function uses unsigned integer math in calculating the sum squared
244
// error to avoid reports of signed integer overflow should a (fuzzing) test
245
// use input values that are outside of the valid range for 12-bit content. The
246
// additional annotation is necessary as an overflow will still be reported
247
// with the integer/unsigned-integer-overflow (not undefined) sanitizer.
248
// This function assumes `abs(value) <= UINT16_MAX`, as the only overflow
249
// that's expected is from casting negative signed integer values to unsigned
250
// and squaring the result.
251
52.0M
static VPX_NO_UNSIGNED_OVERFLOW_CHECK uint32_t square_value(int value) {
252
52.0M
  assert(abs(value) <= UINT16_MAX);
253
52.0M
  const uint32_t unsigned_value = (uint32_t)value;
254
52.0M
  return unsigned_value * unsigned_value;
255
52.0M
}
256
257
static void highbd_variance64(const uint8_t *src8_ptr, int src_stride,
258
                              const uint8_t *ref8_ptr, int ref_stride, int w,
259
3.09M
                              int h, uint64_t *sse, int64_t *sum) {
260
3.09M
  int i, j;
261
262
3.09M
  uint16_t *src_ptr = CONVERT_TO_SHORTPTR(src8_ptr);
263
3.09M
  uint16_t *ref_ptr = CONVERT_TO_SHORTPTR(ref8_ptr);
264
3.09M
  *sum = 0;
265
3.09M
  *sse = 0;
266
267
16.0M
  for (i = 0; i < h; ++i) {
268
65.0M
    for (j = 0; j < w; ++j) {
269
52.0M
      const int diff = src_ptr[j] - ref_ptr[j];
270
52.0M
      *sum += diff;
271
52.0M
      *sse += square_value(diff);
272
52.0M
    }
273
12.9M
    src_ptr += src_stride;
274
12.9M
    ref_ptr += ref_stride;
275
12.9M
  }
276
3.09M
}
277
278
static void highbd_8_variance(const uint8_t *src8_ptr, int src_stride,
279
                              const uint8_t *ref8_ptr, int ref_stride, int w,
280
0
                              int h, uint32_t *sse, int *sum) {
281
0
  uint64_t sse_long = 0;
282
0
  int64_t sum_long = 0;
283
0
  highbd_variance64(src8_ptr, src_stride, ref8_ptr, ref_stride, w, h, &sse_long,
284
0
                    &sum_long);
285
0
  *sse = (uint32_t)sse_long;
286
0
  *sum = (int)sum_long;
287
0
}
288
289
static void highbd_10_variance(const uint8_t *src8_ptr, int src_stride,
290
                               const uint8_t *ref8_ptr, int ref_stride, int w,
291
694k
                               int h, uint32_t *sse, int *sum) {
292
694k
  uint64_t sse_long = 0;
293
694k
  int64_t sum_long = 0;
294
694k
  highbd_variance64(src8_ptr, src_stride, ref8_ptr, ref_stride, w, h, &sse_long,
295
694k
                    &sum_long);
296
694k
  *sse = (uint32_t)ROUND_POWER_OF_TWO(sse_long, 4);
297
694k
  *sum = (int)ROUND_POWER_OF_TWO(sum_long, 2);
298
694k
}
299
300
static void highbd_12_variance(const uint8_t *src8_ptr, int src_stride,
301
                               const uint8_t *ref8_ptr, int ref_stride, int w,
302
2.40M
                               int h, uint32_t *sse, int *sum) {
303
2.40M
  uint64_t sse_long = 0;
304
2.40M
  int64_t sum_long = 0;
305
2.40M
  highbd_variance64(src8_ptr, src_stride, ref8_ptr, ref_stride, w, h, &sse_long,
306
2.40M
                    &sum_long);
307
2.40M
  *sse = (uint32_t)ROUND_POWER_OF_TWO(sse_long, 8);
308
2.40M
  *sum = (int)ROUND_POWER_OF_TWO(sum_long, 4);
309
2.40M
}
310
311
#define HIGHBD_VAR(W, H)                                                    \
312
  uint32_t vpx_highbd_8_variance##W##x##H##_c(                              \
313
      const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr,       \
314
0
      int ref_stride, uint32_t *sse) {                                      \
315
0
    int sum;                                                                \
316
0
    highbd_8_variance(src_ptr, src_stride, ref_ptr, ref_stride, W, H, sse,  \
317
0
                      &sum);                                                \
318
0
    return *sse - (uint32_t)(((int64_t)sum * sum) / (W * H));               \
319
0
  }                                                                         \
Unexecuted instantiation: vpx_highbd_8_variance64x64_c
Unexecuted instantiation: vpx_highbd_8_variance64x32_c
Unexecuted instantiation: vpx_highbd_8_variance32x64_c
Unexecuted instantiation: vpx_highbd_8_variance32x32_c
Unexecuted instantiation: vpx_highbd_8_variance32x16_c
Unexecuted instantiation: vpx_highbd_8_variance16x32_c
Unexecuted instantiation: vpx_highbd_8_variance16x16_c
Unexecuted instantiation: vpx_highbd_8_variance16x8_c
Unexecuted instantiation: vpx_highbd_8_variance8x16_c
Unexecuted instantiation: vpx_highbd_8_variance8x8_c
Unexecuted instantiation: vpx_highbd_8_variance8x4_c
Unexecuted instantiation: vpx_highbd_8_variance4x8_c
Unexecuted instantiation: vpx_highbd_8_variance4x4_c
320
                                                                            \
321
  uint32_t vpx_highbd_10_variance##W##x##H##_c(                             \
322
      const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr,       \
323
694k
      int ref_stride, uint32_t *sse) {                                      \
324
694k
    int sum;                                                                \
325
694k
    int64_t var;                                                            \
326
694k
    highbd_10_variance(src_ptr, src_stride, ref_ptr, ref_stride, W, H, sse, \
327
694k
                       &sum);                                               \
328
694k
    var = (int64_t)(*sse) - (((int64_t)sum * sum) / (W * H));               \
329
694k
    return (var >= 0) ? (uint32_t)var : 0;                                  \
330
694k
  }                                                                         \
Unexecuted instantiation: vpx_highbd_10_variance64x64_c
Unexecuted instantiation: vpx_highbd_10_variance64x32_c
Unexecuted instantiation: vpx_highbd_10_variance32x64_c
Unexecuted instantiation: vpx_highbd_10_variance32x32_c
Unexecuted instantiation: vpx_highbd_10_variance32x16_c
Unexecuted instantiation: vpx_highbd_10_variance16x32_c
Unexecuted instantiation: vpx_highbd_10_variance16x16_c
Unexecuted instantiation: vpx_highbd_10_variance16x8_c
Unexecuted instantiation: vpx_highbd_10_variance8x16_c
Unexecuted instantiation: vpx_highbd_10_variance8x8_c
vpx_highbd_10_variance8x4_c
Line
Count
Source
323
7.79k
      int ref_stride, uint32_t *sse) {                                      \
324
7.79k
    int sum;                                                                \
325
7.79k
    int64_t var;                                                            \
326
7.79k
    highbd_10_variance(src_ptr, src_stride, ref_ptr, ref_stride, W, H, sse, \
327
7.79k
                       &sum);                                               \
328
7.79k
    var = (int64_t)(*sse) - (((int64_t)sum * sum) / (W * H));               \
329
7.79k
    return (var >= 0) ? (uint32_t)var : 0;                                  \
330
7.79k
  }                                                                         \
vpx_highbd_10_variance4x8_c
Line
Count
Source
323
48.1k
      int ref_stride, uint32_t *sse) {                                      \
324
48.1k
    int sum;                                                                \
325
48.1k
    int64_t var;                                                            \
326
48.1k
    highbd_10_variance(src_ptr, src_stride, ref_ptr, ref_stride, W, H, sse, \
327
48.1k
                       &sum);                                               \
328
48.1k
    var = (int64_t)(*sse) - (((int64_t)sum * sum) / (W * H));               \
329
48.1k
    return (var >= 0) ? (uint32_t)var : 0;                                  \
330
48.1k
  }                                                                         \
vpx_highbd_10_variance4x4_c
Line
Count
Source
323
638k
      int ref_stride, uint32_t *sse) {                                      \
324
638k
    int sum;                                                                \
325
638k
    int64_t var;                                                            \
326
638k
    highbd_10_variance(src_ptr, src_stride, ref_ptr, ref_stride, W, H, sse, \
327
638k
                       &sum);                                               \
328
638k
    var = (int64_t)(*sse) - (((int64_t)sum * sum) / (W * H));               \
329
638k
    return (var >= 0) ? (uint32_t)var : 0;                                  \
330
638k
  }                                                                         \
331
                                                                            \
332
  uint32_t vpx_highbd_12_variance##W##x##H##_c(                             \
333
      const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr,       \
334
2.40M
      int ref_stride, uint32_t *sse) {                                      \
335
2.40M
    int sum;                                                                \
336
2.40M
    int64_t var;                                                            \
337
2.40M
    highbd_12_variance(src_ptr, src_stride, ref_ptr, ref_stride, W, H, sse, \
338
2.40M
                       &sum);                                               \
339
2.40M
    var = (int64_t)(*sse) - (((int64_t)sum * sum) / (W * H));               \
340
2.40M
    return (var >= 0) ? (uint32_t)var : 0;                                  \
341
2.40M
  }
Unexecuted instantiation: vpx_highbd_12_variance64x64_c
Unexecuted instantiation: vpx_highbd_12_variance64x32_c
Unexecuted instantiation: vpx_highbd_12_variance32x64_c
Unexecuted instantiation: vpx_highbd_12_variance32x32_c
Unexecuted instantiation: vpx_highbd_12_variance32x16_c
Unexecuted instantiation: vpx_highbd_12_variance16x32_c
Unexecuted instantiation: vpx_highbd_12_variance16x16_c
Unexecuted instantiation: vpx_highbd_12_variance16x8_c
Unexecuted instantiation: vpx_highbd_12_variance8x16_c
Unexecuted instantiation: vpx_highbd_12_variance8x8_c
vpx_highbd_12_variance8x4_c
Line
Count
Source
334
13.4k
      int ref_stride, uint32_t *sse) {                                      \
335
13.4k
    int sum;                                                                \
336
13.4k
    int64_t var;                                                            \
337
13.4k
    highbd_12_variance(src_ptr, src_stride, ref_ptr, ref_stride, W, H, sse, \
338
13.4k
                       &sum);                                               \
339
13.4k
    var = (int64_t)(*sse) - (((int64_t)sum * sum) / (W * H));               \
340
13.4k
    return (var >= 0) ? (uint32_t)var : 0;                                  \
341
13.4k
  }
vpx_highbd_12_variance4x8_c
Line
Count
Source
334
89.9k
      int ref_stride, uint32_t *sse) {                                      \
335
89.9k
    int sum;                                                                \
336
89.9k
    int64_t var;                                                            \
337
89.9k
    highbd_12_variance(src_ptr, src_stride, ref_ptr, ref_stride, W, H, sse, \
338
89.9k
                       &sum);                                               \
339
89.9k
    var = (int64_t)(*sse) - (((int64_t)sum * sum) / (W * H));               \
340
89.9k
    return (var >= 0) ? (uint32_t)var : 0;                                  \
341
89.9k
  }
vpx_highbd_12_variance4x4_c
Line
Count
Source
334
2.29M
      int ref_stride, uint32_t *sse) {                                      \
335
2.29M
    int sum;                                                                \
336
2.29M
    int64_t var;                                                            \
337
2.29M
    highbd_12_variance(src_ptr, src_stride, ref_ptr, ref_stride, W, H, sse, \
338
2.29M
                       &sum);                                               \
339
2.29M
    var = (int64_t)(*sse) - (((int64_t)sum * sum) / (W * H));               \
340
2.29M
    return (var >= 0) ? (uint32_t)var : 0;                                  \
341
2.29M
  }
342
343
#define HIGHBD_GET_VAR(S)                                                   \
344
  void vpx_highbd_8_get##S##x##S##var_c(                                    \
345
      const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr,       \
346
0
      int ref_stride, uint32_t *sse, int *sum) {                            \
347
0
    highbd_8_variance(src_ptr, src_stride, ref_ptr, ref_stride, S, S, sse,  \
348
0
                      sum);                                                 \
349
0
  }                                                                         \
Unexecuted instantiation: vpx_highbd_8_get8x8var_c
Unexecuted instantiation: vpx_highbd_8_get16x16var_c
350
                                                                            \
351
  void vpx_highbd_10_get##S##x##S##var_c(                                   \
352
      const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr,       \
353
0
      int ref_stride, uint32_t *sse, int *sum) {                            \
354
0
    highbd_10_variance(src_ptr, src_stride, ref_ptr, ref_stride, S, S, sse, \
355
0
                       sum);                                                \
356
0
  }                                                                         \
Unexecuted instantiation: vpx_highbd_10_get8x8var_c
Unexecuted instantiation: vpx_highbd_10_get16x16var_c
357
                                                                            \
358
  void vpx_highbd_12_get##S##x##S##var_c(                                   \
359
      const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr,       \
360
0
      int ref_stride, uint32_t *sse, int *sum) {                            \
361
0
    highbd_12_variance(src_ptr, src_stride, ref_ptr, ref_stride, S, S, sse, \
362
0
                       sum);                                                \
363
0
  }
Unexecuted instantiation: vpx_highbd_12_get8x8var_c
Unexecuted instantiation: vpx_highbd_12_get16x16var_c
364
365
#define HIGHBD_MSE(W, H)                                                    \
366
  uint32_t vpx_highbd_8_mse##W##x##H##_c(                                   \
367
      const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr,       \
368
0
      int ref_stride, uint32_t *sse) {                                      \
369
0
    int sum;                                                                \
370
0
    highbd_8_variance(src_ptr, src_stride, ref_ptr, ref_stride, W, H, sse,  \
371
0
                      &sum);                                                \
372
0
    return *sse;                                                            \
373
0
  }                                                                         \
Unexecuted instantiation: vpx_highbd_8_mse16x16_c
Unexecuted instantiation: vpx_highbd_8_mse16x8_c
Unexecuted instantiation: vpx_highbd_8_mse8x16_c
Unexecuted instantiation: vpx_highbd_8_mse8x8_c
374
                                                                            \
375
  uint32_t vpx_highbd_10_mse##W##x##H##_c(                                  \
376
      const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr,       \
377
0
      int ref_stride, uint32_t *sse) {                                      \
378
0
    int sum;                                                                \
379
0
    highbd_10_variance(src_ptr, src_stride, ref_ptr, ref_stride, W, H, sse, \
380
0
                       &sum);                                               \
381
0
    return *sse;                                                            \
382
0
  }                                                                         \
Unexecuted instantiation: vpx_highbd_10_mse16x16_c
Unexecuted instantiation: vpx_highbd_10_mse16x8_c
Unexecuted instantiation: vpx_highbd_10_mse8x16_c
Unexecuted instantiation: vpx_highbd_10_mse8x8_c
383
                                                                            \
384
  uint32_t vpx_highbd_12_mse##W##x##H##_c(                                  \
385
      const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr,       \
386
0
      int ref_stride, uint32_t *sse) {                                      \
387
0
    int sum;                                                                \
388
0
    highbd_12_variance(src_ptr, src_stride, ref_ptr, ref_stride, W, H, sse, \
389
0
                       &sum);                                               \
390
0
    return *sse;                                                            \
391
0
  }
Unexecuted instantiation: vpx_highbd_12_mse16x16_c
Unexecuted instantiation: vpx_highbd_12_mse16x8_c
Unexecuted instantiation: vpx_highbd_12_mse8x16_c
Unexecuted instantiation: vpx_highbd_12_mse8x8_c
392
393
static void highbd_var_filter_block2d_bil_first_pass(
394
    const uint8_t *src_ptr8, uint16_t *output_ptr,
395
    unsigned int src_pixels_per_line, int pixel_step,
396
    unsigned int output_height, unsigned int output_width,
397
618k
    const uint8_t *filter) {
398
618k
  unsigned int i, j;
399
618k
  uint16_t *src_ptr = CONVERT_TO_SHORTPTR(src_ptr8);
400
4.16M
  for (i = 0; i < output_height; ++i) {
401
17.7M
    for (j = 0; j < output_width; ++j) {
402
14.1M
      output_ptr[j] = ROUND_POWER_OF_TWO(
403
14.1M
          (int)src_ptr[0] * filter[0] + (int)src_ptr[pixel_step] * filter[1],
404
14.1M
          FILTER_BITS);
405
406
14.1M
      ++src_ptr;
407
14.1M
    }
408
409
    // Next row...
410
3.54M
    src_ptr += src_pixels_per_line - output_width;
411
3.54M
    output_ptr += output_width;
412
3.54M
  }
413
618k
}
414
415
static void highbd_var_filter_block2d_bil_second_pass(
416
    const uint16_t *src_ptr, uint16_t *output_ptr,
417
    unsigned int src_pixels_per_line, unsigned int pixel_step,
418
    unsigned int output_height, unsigned int output_width,
419
618k
    const uint8_t *filter) {
420
618k
  unsigned int i, j;
421
422
3.54M
  for (i = 0; i < output_height; ++i) {
423
14.6M
    for (j = 0; j < output_width; ++j) {
424
11.6M
      output_ptr[j] = ROUND_POWER_OF_TWO(
425
11.6M
          (int)src_ptr[0] * filter[0] + (int)src_ptr[pixel_step] * filter[1],
426
11.6M
          FILTER_BITS);
427
11.6M
      ++src_ptr;
428
11.6M
    }
429
430
2.92M
    src_ptr += src_pixels_per_line - output_width;
431
2.92M
    output_ptr += output_width;
432
2.92M
  }
433
618k
}
434
435
#define HIGHBD_SUBPIX_VAR(W, H)                                                \
436
  uint32_t vpx_highbd_8_sub_pixel_variance##W##x##H##_c(                       \
437
      const uint8_t *src_ptr, int src_stride, int x_offset, int y_offset,      \
438
0
      const uint8_t *ref_ptr, int ref_stride, uint32_t *sse) {                 \
439
0
    uint16_t fdata3[(H + 1) * W];                                              \
440
0
    uint16_t temp2[H * W];                                                     \
441
0
                                                                               \
442
0
    highbd_var_filter_block2d_bil_first_pass(                                  \
443
0
        src_ptr, fdata3, src_stride, 1, H + 1, W, bilinear_filters[x_offset]); \
444
0
    highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W,       \
445
0
                                              bilinear_filters[y_offset]);     \
446
0
                                                                               \
447
0
    return vpx_highbd_8_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp2), W,    \
448
0
                                              ref_ptr, ref_stride, sse);       \
449
0
  }                                                                            \
Unexecuted instantiation: vpx_highbd_8_sub_pixel_variance64x64_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_variance64x32_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_variance32x64_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_variance32x32_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_variance32x16_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_variance16x32_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_variance16x16_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_variance16x8_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_variance8x16_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_variance8x8_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_variance8x4_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_variance4x8_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_variance4x4_c
450
                                                                               \
451
  uint32_t vpx_highbd_10_sub_pixel_variance##W##x##H##_c(                      \
452
      const uint8_t *src_ptr, int src_stride, int x_offset, int y_offset,      \
453
168k
      const uint8_t *ref_ptr, int ref_stride, uint32_t *sse) {                 \
454
168k
    uint16_t fdata3[(H + 1) * W];                                              \
455
168k
    uint16_t temp2[H * W];                                                     \
456
168k
                                                                               \
457
168k
    highbd_var_filter_block2d_bil_first_pass(                                  \
458
168k
        src_ptr, fdata3, src_stride, 1, H + 1, W, bilinear_filters[x_offset]); \
459
168k
    highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W,       \
460
168k
                                              bilinear_filters[y_offset]);     \
461
168k
                                                                               \
462
168k
    return vpx_highbd_10_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp2), W,   \
463
168k
                                               ref_ptr, ref_stride, sse);      \
464
168k
  }                                                                            \
Unexecuted instantiation: vpx_highbd_10_sub_pixel_variance64x64_c
Unexecuted instantiation: vpx_highbd_10_sub_pixel_variance64x32_c
Unexecuted instantiation: vpx_highbd_10_sub_pixel_variance32x64_c
Unexecuted instantiation: vpx_highbd_10_sub_pixel_variance32x32_c
Unexecuted instantiation: vpx_highbd_10_sub_pixel_variance32x16_c
Unexecuted instantiation: vpx_highbd_10_sub_pixel_variance16x32_c
Unexecuted instantiation: vpx_highbd_10_sub_pixel_variance16x16_c
Unexecuted instantiation: vpx_highbd_10_sub_pixel_variance16x8_c
Unexecuted instantiation: vpx_highbd_10_sub_pixel_variance8x16_c
Unexecuted instantiation: vpx_highbd_10_sub_pixel_variance8x8_c
Unexecuted instantiation: vpx_highbd_10_sub_pixel_variance8x4_c
vpx_highbd_10_sub_pixel_variance4x8_c
Line
Count
Source
453
38.9k
      const uint8_t *ref_ptr, int ref_stride, uint32_t *sse) {                 \
454
38.9k
    uint16_t fdata3[(H + 1) * W];                                              \
455
38.9k
    uint16_t temp2[H * W];                                                     \
456
38.9k
                                                                               \
457
38.9k
    highbd_var_filter_block2d_bil_first_pass(                                  \
458
38.9k
        src_ptr, fdata3, src_stride, 1, H + 1, W, bilinear_filters[x_offset]); \
459
38.9k
    highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W,       \
460
38.9k
                                              bilinear_filters[y_offset]);     \
461
38.9k
                                                                               \
462
38.9k
    return vpx_highbd_10_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp2), W,   \
463
38.9k
                                               ref_ptr, ref_stride, sse);      \
464
38.9k
  }                                                                            \
vpx_highbd_10_sub_pixel_variance4x4_c
Line
Count
Source
453
129k
      const uint8_t *ref_ptr, int ref_stride, uint32_t *sse) {                 \
454
129k
    uint16_t fdata3[(H + 1) * W];                                              \
455
129k
    uint16_t temp2[H * W];                                                     \
456
129k
                                                                               \
457
129k
    highbd_var_filter_block2d_bil_first_pass(                                  \
458
129k
        src_ptr, fdata3, src_stride, 1, H + 1, W, bilinear_filters[x_offset]); \
459
129k
    highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W,       \
460
129k
                                              bilinear_filters[y_offset]);     \
461
129k
                                                                               \
462
129k
    return vpx_highbd_10_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp2), W,   \
463
129k
                                               ref_ptr, ref_stride, sse);      \
464
129k
  }                                                                            \
465
                                                                               \
466
  uint32_t vpx_highbd_12_sub_pixel_variance##W##x##H##_c(                      \
467
      const uint8_t *src_ptr, int src_stride, int x_offset, int y_offset,      \
468
450k
      const uint8_t *ref_ptr, int ref_stride, uint32_t *sse) {                 \
469
450k
    uint16_t fdata3[(H + 1) * W];                                              \
470
450k
    uint16_t temp2[H * W];                                                     \
471
450k
                                                                               \
472
450k
    highbd_var_filter_block2d_bil_first_pass(                                  \
473
450k
        src_ptr, fdata3, src_stride, 1, H + 1, W, bilinear_filters[x_offset]); \
474
450k
    highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W,       \
475
450k
                                              bilinear_filters[y_offset]);     \
476
450k
                                                                               \
477
450k
    return vpx_highbd_12_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp2), W,   \
478
450k
                                               ref_ptr, ref_stride, sse);      \
479
450k
  }
Unexecuted instantiation: vpx_highbd_12_sub_pixel_variance64x64_c
Unexecuted instantiation: vpx_highbd_12_sub_pixel_variance64x32_c
Unexecuted instantiation: vpx_highbd_12_sub_pixel_variance32x64_c
Unexecuted instantiation: vpx_highbd_12_sub_pixel_variance32x32_c
Unexecuted instantiation: vpx_highbd_12_sub_pixel_variance32x16_c
Unexecuted instantiation: vpx_highbd_12_sub_pixel_variance16x32_c
Unexecuted instantiation: vpx_highbd_12_sub_pixel_variance16x16_c
Unexecuted instantiation: vpx_highbd_12_sub_pixel_variance16x8_c
Unexecuted instantiation: vpx_highbd_12_sub_pixel_variance8x16_c
Unexecuted instantiation: vpx_highbd_12_sub_pixel_variance8x8_c
Unexecuted instantiation: vpx_highbd_12_sub_pixel_variance8x4_c
vpx_highbd_12_sub_pixel_variance4x8_c
Line
Count
Source
468
73.3k
      const uint8_t *ref_ptr, int ref_stride, uint32_t *sse) {                 \
469
73.3k
    uint16_t fdata3[(H + 1) * W];                                              \
470
73.3k
    uint16_t temp2[H * W];                                                     \
471
73.3k
                                                                               \
472
73.3k
    highbd_var_filter_block2d_bil_first_pass(                                  \
473
73.3k
        src_ptr, fdata3, src_stride, 1, H + 1, W, bilinear_filters[x_offset]); \
474
73.3k
    highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W,       \
475
73.3k
                                              bilinear_filters[y_offset]);     \
476
73.3k
                                                                               \
477
73.3k
    return vpx_highbd_12_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp2), W,   \
478
73.3k
                                               ref_ptr, ref_stride, sse);      \
479
73.3k
  }
vpx_highbd_12_sub_pixel_variance4x4_c
Line
Count
Source
468
376k
      const uint8_t *ref_ptr, int ref_stride, uint32_t *sse) {                 \
469
376k
    uint16_t fdata3[(H + 1) * W];                                              \
470
376k
    uint16_t temp2[H * W];                                                     \
471
376k
                                                                               \
472
376k
    highbd_var_filter_block2d_bil_first_pass(                                  \
473
376k
        src_ptr, fdata3, src_stride, 1, H + 1, W, bilinear_filters[x_offset]); \
474
376k
    highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W,       \
475
376k
                                              bilinear_filters[y_offset]);     \
476
376k
                                                                               \
477
376k
    return vpx_highbd_12_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp2), W,   \
478
376k
                                               ref_ptr, ref_stride, sse);      \
479
376k
  }
480
481
#define HIGHBD_SUBPIX_AVG_VAR(W, H)                                            \
482
  uint32_t vpx_highbd_8_sub_pixel_avg_variance##W##x##H##_c(                   \
483
      const uint8_t *src_ptr, int src_stride, int x_offset, int y_offset,      \
484
      const uint8_t *ref_ptr, int ref_stride, uint32_t *sse,                   \
485
0
      const uint8_t *second_pred) {                                            \
486
0
    uint16_t fdata3[(H + 1) * W];                                              \
487
0
    uint16_t temp2[H * W];                                                     \
488
0
    DECLARE_ALIGNED(16, uint16_t, temp3[H * W]);                               \
489
0
                                                                               \
490
0
    highbd_var_filter_block2d_bil_first_pass(                                  \
491
0
        src_ptr, fdata3, src_stride, 1, H + 1, W, bilinear_filters[x_offset]); \
492
0
    highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W,       \
493
0
                                              bilinear_filters[y_offset]);     \
494
0
                                                                               \
495
0
    vpx_highbd_comp_avg_pred_c(temp3, CONVERT_TO_SHORTPTR(second_pred), W, H,  \
496
0
                               temp2, W);                                      \
497
0
                                                                               \
498
0
    return vpx_highbd_8_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp3), W,    \
499
0
                                              ref_ptr, ref_stride, sse);       \
500
0
  }                                                                            \
Unexecuted instantiation: vpx_highbd_8_sub_pixel_avg_variance64x64_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_avg_variance64x32_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_avg_variance32x64_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_avg_variance32x32_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_avg_variance32x16_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_avg_variance16x32_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_avg_variance16x16_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_avg_variance16x8_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_avg_variance8x16_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_avg_variance8x8_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_avg_variance8x4_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_avg_variance4x8_c
Unexecuted instantiation: vpx_highbd_8_sub_pixel_avg_variance4x4_c
501
                                                                               \
502
  uint32_t vpx_highbd_10_sub_pixel_avg_variance##W##x##H##_c(                  \
503
      const uint8_t *src_ptr, int src_stride, int x_offset, int y_offset,      \
504
      const uint8_t *ref_ptr, int ref_stride, uint32_t *sse,                   \
505
0
      const uint8_t *second_pred) {                                            \
506
0
    uint16_t fdata3[(H + 1) * W];                                              \
507
0
    uint16_t temp2[H * W];                                                     \
508
0
    DECLARE_ALIGNED(16, uint16_t, temp3[H * W]);                               \
509
0
                                                                               \
510
0
    highbd_var_filter_block2d_bil_first_pass(                                  \
511
0
        src_ptr, fdata3, src_stride, 1, H + 1, W, bilinear_filters[x_offset]); \
512
0
    highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W,       \
513
0
                                              bilinear_filters[y_offset]);     \
514
0
                                                                               \
515
0
    vpx_highbd_comp_avg_pred_c(temp3, CONVERT_TO_SHORTPTR(second_pred), W, H,  \
516
0
                               temp2, W);                                      \
517
0
                                                                               \
518
0
    return vpx_highbd_10_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp3), W,   \
519
0
                                               ref_ptr, ref_stride, sse);      \
520
0
  }                                                                            \
Unexecuted instantiation: vpx_highbd_10_sub_pixel_avg_variance64x64_c
Unexecuted instantiation: vpx_highbd_10_sub_pixel_avg_variance64x32_c
Unexecuted instantiation: vpx_highbd_10_sub_pixel_avg_variance32x64_c
Unexecuted instantiation: vpx_highbd_10_sub_pixel_avg_variance32x32_c
Unexecuted instantiation: vpx_highbd_10_sub_pixel_avg_variance32x16_c
Unexecuted instantiation: vpx_highbd_10_sub_pixel_avg_variance16x32_c
Unexecuted instantiation: vpx_highbd_10_sub_pixel_avg_variance16x16_c
Unexecuted instantiation: vpx_highbd_10_sub_pixel_avg_variance16x8_c
Unexecuted instantiation: vpx_highbd_10_sub_pixel_avg_variance8x16_c
Unexecuted instantiation: vpx_highbd_10_sub_pixel_avg_variance8x8_c
Unexecuted instantiation: vpx_highbd_10_sub_pixel_avg_variance8x4_c
Unexecuted instantiation: vpx_highbd_10_sub_pixel_avg_variance4x8_c
Unexecuted instantiation: vpx_highbd_10_sub_pixel_avg_variance4x4_c
521
                                                                               \
522
  uint32_t vpx_highbd_12_sub_pixel_avg_variance##W##x##H##_c(                  \
523
      const uint8_t *src_ptr, int src_stride, int x_offset, int y_offset,      \
524
      const uint8_t *ref_ptr, int ref_stride, uint32_t *sse,                   \
525
0
      const uint8_t *second_pred) {                                            \
526
0
    uint16_t fdata3[(H + 1) * W];                                              \
527
0
    uint16_t temp2[H * W];                                                     \
528
0
    DECLARE_ALIGNED(16, uint16_t, temp3[H * W]);                               \
529
0
                                                                               \
530
0
    highbd_var_filter_block2d_bil_first_pass(                                  \
531
0
        src_ptr, fdata3, src_stride, 1, H + 1, W, bilinear_filters[x_offset]); \
532
0
    highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W,       \
533
0
                                              bilinear_filters[y_offset]);     \
534
0
                                                                               \
535
0
    vpx_highbd_comp_avg_pred_c(temp3, CONVERT_TO_SHORTPTR(second_pred), W, H,  \
536
0
                               temp2, W);                                      \
537
0
                                                                               \
538
0
    return vpx_highbd_12_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp3), W,   \
539
0
                                               ref_ptr, ref_stride, sse);      \
540
0
  }
Unexecuted instantiation: vpx_highbd_12_sub_pixel_avg_variance64x64_c
Unexecuted instantiation: vpx_highbd_12_sub_pixel_avg_variance64x32_c
Unexecuted instantiation: vpx_highbd_12_sub_pixel_avg_variance32x64_c
Unexecuted instantiation: vpx_highbd_12_sub_pixel_avg_variance32x32_c
Unexecuted instantiation: vpx_highbd_12_sub_pixel_avg_variance32x16_c
Unexecuted instantiation: vpx_highbd_12_sub_pixel_avg_variance16x32_c
Unexecuted instantiation: vpx_highbd_12_sub_pixel_avg_variance16x16_c
Unexecuted instantiation: vpx_highbd_12_sub_pixel_avg_variance16x8_c
Unexecuted instantiation: vpx_highbd_12_sub_pixel_avg_variance8x16_c
Unexecuted instantiation: vpx_highbd_12_sub_pixel_avg_variance8x8_c
Unexecuted instantiation: vpx_highbd_12_sub_pixel_avg_variance8x4_c
Unexecuted instantiation: vpx_highbd_12_sub_pixel_avg_variance4x8_c
Unexecuted instantiation: vpx_highbd_12_sub_pixel_avg_variance4x4_c
541
542
/* All three forms of the variance are available in the same sizes. */
543
#define HIGHBD_VARIANCES(W, H) \
544
  HIGHBD_VAR(W, H)             \
545
  HIGHBD_SUBPIX_VAR(W, H)      \
546
  HIGHBD_SUBPIX_AVG_VAR(W, H)
547
548
HIGHBD_VARIANCES(64, 64)
549
HIGHBD_VARIANCES(64, 32)
550
HIGHBD_VARIANCES(32, 64)
551
HIGHBD_VARIANCES(32, 32)
552
HIGHBD_VARIANCES(32, 16)
553
HIGHBD_VARIANCES(16, 32)
554
HIGHBD_VARIANCES(16, 16)
555
HIGHBD_VARIANCES(16, 8)
556
HIGHBD_VARIANCES(8, 16)
557
HIGHBD_VARIANCES(8, 8)
558
HIGHBD_VARIANCES(8, 4)
559
HIGHBD_VARIANCES(4, 8)
560
HIGHBD_VARIANCES(4, 4)
561
562
HIGHBD_GET_VAR(8)
563
HIGHBD_GET_VAR(16)
564
565
HIGHBD_MSE(16, 16)
566
HIGHBD_MSE(16, 8)
567
HIGHBD_MSE(8, 16)
568
HIGHBD_MSE(8, 8)
569
570
void vpx_highbd_comp_avg_pred_c(uint16_t *comp_pred, const uint16_t *pred,
571
                                int width, int height, const uint16_t *ref,
572
0
                                int ref_stride) {
573
0
  int i, j;
574
0
  for (i = 0; i < height; ++i) {
575
0
    for (j = 0; j < width; ++j) {
576
0
      const int tmp = pred[j] + ref[j];
577
0
      comp_pred[j] = ROUND_POWER_OF_TWO(tmp, 1);
578
0
    }
579
0
    comp_pred += width;
580
0
    pred += width;
581
0
    ref += ref_stride;
582
0
  }
583
0
}
584
#endif  // CONFIG_VP9_HIGHBITDEPTH