Coverage Report

Created: 2024-09-06 07:53

/src/libvpx/vpx_dsp/x86/convolve.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 *  Copyright (c) 2015 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
#ifndef VPX_VPX_DSP_X86_CONVOLVE_H_
11
#define VPX_VPX_DSP_X86_CONVOLVE_H_
12
13
#include <assert.h>
14
15
#include "./vpx_config.h"
16
#include "vpx/vpx_integer.h"
17
#include "vpx_ports/compiler_attributes.h"
18
19
// TODO(chiyotsai@google.com): Refactor the code here. Currently this is pretty
20
// hacky and awful to read. Note that there is a filter_x[3] == 128 check in
21
// HIGHBD_FUN_CONV_2D to avoid seg fault due to the fact that the c function
22
// assumes the filter is always 8 tap.
23
typedef void filter8_1dfunction(const uint8_t *src_ptr, ptrdiff_t src_pitch,
24
                                uint8_t *output_ptr, ptrdiff_t out_pitch,
25
                                uint32_t output_height, const int16_t *filter);
26
27
// TODO(chiyotsai@google.com): Remove the is_avg argument to the MACROS once we
28
// have 4-tap vert avg filter.
29
#define FUN_CONV_1D(name, offset, step_q4, dir, src_start, avg, opt, is_avg) \
30
  void vpx_convolve8_##name##_##opt(                                         \
31
      const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst,                \
32
      ptrdiff_t dst_stride, const InterpKernel *filter, int x0_q4,           \
33
261M
      int x_step_q4, int y0_q4, int y_step_q4, int w, int h) {               \
34
261M
    const int16_t *filter_row = filter[offset];                              \
35
261M
    (void)x0_q4;                                                             \
36
261M
    (void)x_step_q4;                                                         \
37
261M
    (void)y0_q4;                                                             \
38
261M
    (void)y_step_q4;                                                         \
39
261M
    assert(filter_row[3] != 128);                                            \
40
261M
    assert(step_q4 == 16);                                                   \
41
261M
    if (filter_row[0] | filter_row[1] | filter_row[6] | filter_row[7]) {     \
42
103M
      const int num_taps = 8;                                                \
43
114M
      while (w >= 16) {                                                      \
44
10.9M
        vpx_filter_block1d16_##dir##8_##avg##opt(src_start, src_stride, dst, \
45
10.9M
                                                 dst_stride, h, filter_row); \
46
10.9M
        src += 16;                                                           \
47
10.9M
        dst += 16;                                                           \
48
10.9M
        w -= 16;                                                             \
49
10.9M
      }                                                                      \
50
103M
      if (w == 8) {                                                          \
51
26.9M
        vpx_filter_block1d8_##dir##8_##avg##opt(src_start, src_stride, dst,  \
52
26.9M
                                                dst_stride, h, filter_row);  \
53
76.8M
      } else if (w == 4) {                                                   \
54
67.9M
        vpx_filter_block1d4_##dir##8_##avg##opt(src_start, src_stride, dst,  \
55
67.9M
                                                dst_stride, h, filter_row);  \
56
67.9M
      }                                                                      \
57
103M
      (void)num_taps;                                                        \
58
157M
    } else if (filter_row[2] | filter_row[5]) {                              \
59
157M
      const int num_taps = is_avg ? 8 : 4;                                   \
60
171M
      while (w >= 16) {                                                      \
61
13.6M
        vpx_filter_block1d16_##dir##4_##avg##opt(src_start, src_stride, dst, \
62
13.6M
                                                 dst_stride, h, filter_row); \
63
13.6M
        src += 16;                                                           \
64
13.6M
        dst += 16;                                                           \
65
13.6M
        w -= 16;                                                             \
66
13.6M
      }                                                                      \
67
157M
      if (w == 8) {                                                          \
68
32.1M
        vpx_filter_block1d8_##dir##4_##avg##opt(src_start, src_stride, dst,  \
69
32.1M
                                                dst_stride, h, filter_row);  \
70
125M
      } else if (w == 4) {                                                   \
71
115M
        vpx_filter_block1d4_##dir##4_##avg##opt(src_start, src_stride, dst,  \
72
115M
                                                dst_stride, h, filter_row);  \
73
115M
      }                                                                      \
74
157M
      (void)num_taps;                                                        \
75
157M
    } else {                                                                 \
76
0
      const int num_taps = 2;                                                \
77
0
      while (w >= 16) {                                                      \
78
0
        vpx_filter_block1d16_##dir##2_##avg##opt(src_start, src_stride, dst, \
79
0
                                                 dst_stride, h, filter_row); \
80
0
        src += 16;                                                           \
81
0
        dst += 16;                                                           \
82
0
        w -= 16;                                                             \
83
0
      }                                                                      \
84
0
      if (w == 8) {                                                          \
85
0
        vpx_filter_block1d8_##dir##2_##avg##opt(src_start, src_stride, dst,  \
86
0
                                                dst_stride, h, filter_row);  \
87
0
      } else if (w == 4) {                                                   \
88
0
        vpx_filter_block1d4_##dir##2_##avg##opt(src_start, src_stride, dst,  \
89
0
                                                dst_stride, h, filter_row);  \
90
0
      }                                                                      \
91
0
      (void)num_taps;                                                        \
92
0
    }                                                                        \
93
261M
  }
Unexecuted instantiation: vpx_convolve8_horiz_sse2
Unexecuted instantiation: vpx_convolve8_vert_sse2
Unexecuted instantiation: vpx_convolve8_avg_horiz_sse2
Unexecuted instantiation: vpx_convolve8_avg_vert_sse2
vpx_convolve8_horiz_avx2
Line
Count
Source
33
131M
      int x_step_q4, int y0_q4, int y_step_q4, int w, int h) {               \
34
131M
    const int16_t *filter_row = filter[offset];                              \
35
131M
    (void)x0_q4;                                                             \
36
131M
    (void)x_step_q4;                                                         \
37
131M
    (void)y0_q4;                                                             \
38
131M
    (void)y_step_q4;                                                         \
39
131M
    assert(filter_row[3] != 128);                                            \
40
131M
    assert(step_q4 == 16);                                                   \
41
131M
    if (filter_row[0] | filter_row[1] | filter_row[6] | filter_row[7]) {     \
42
52.1M
      const int num_taps = 8;                                                \
43
57.7M
      while (w >= 16) {                                                      \
44
5.56M
        vpx_filter_block1d16_##dir##8_##avg##opt(src_start, src_stride, dst, \
45
5.56M
                                                 dst_stride, h, filter_row); \
46
5.56M
        src += 16;                                                           \
47
5.56M
        dst += 16;                                                           \
48
5.56M
        w -= 16;                                                             \
49
5.56M
      }                                                                      \
50
52.1M
      if (w == 8) {                                                          \
51
13.6M
        vpx_filter_block1d8_##dir##8_##avg##opt(src_start, src_stride, dst,  \
52
13.6M
                                                dst_stride, h, filter_row);  \
53
38.4M
      } else if (w == 4) {                                                   \
54
33.9M
        vpx_filter_block1d4_##dir##8_##avg##opt(src_start, src_stride, dst,  \
55
33.9M
                                                dst_stride, h, filter_row);  \
56
33.9M
      }                                                                      \
57
52.1M
      (void)num_taps;                                                        \
58
79.3M
    } else if (filter_row[2] | filter_row[5]) {                              \
59
79.3M
      const int num_taps = is_avg ? 8 : 4;                                   \
60
86.1M
      while (w >= 16) {                                                      \
61
6.82M
        vpx_filter_block1d16_##dir##4_##avg##opt(src_start, src_stride, dst, \
62
6.82M
                                                 dst_stride, h, filter_row); \
63
6.82M
        src += 16;                                                           \
64
6.82M
        dst += 16;                                                           \
65
6.82M
        w -= 16;                                                             \
66
6.82M
      }                                                                      \
67
79.3M
      if (w == 8) {                                                          \
68
16.1M
        vpx_filter_block1d8_##dir##4_##avg##opt(src_start, src_stride, dst,  \
69
16.1M
                                                dst_stride, h, filter_row);  \
70
63.1M
      } else if (w == 4) {                                                   \
71
57.8M
        vpx_filter_block1d4_##dir##4_##avg##opt(src_start, src_stride, dst,  \
72
57.8M
                                                dst_stride, h, filter_row);  \
73
57.8M
      }                                                                      \
74
79.3M
      (void)num_taps;                                                        \
75
79.3M
    } else {                                                                 \
76
0
      const int num_taps = 2;                                                \
77
0
      while (w >= 16) {                                                      \
78
0
        vpx_filter_block1d16_##dir##2_##avg##opt(src_start, src_stride, dst, \
79
0
                                                 dst_stride, h, filter_row); \
80
0
        src += 16;                                                           \
81
0
        dst += 16;                                                           \
82
0
        w -= 16;                                                             \
83
0
      }                                                                      \
84
0
      if (w == 8) {                                                          \
85
0
        vpx_filter_block1d8_##dir##2_##avg##opt(src_start, src_stride, dst,  \
86
0
                                                dst_stride, h, filter_row);  \
87
0
      } else if (w == 4) {                                                   \
88
0
        vpx_filter_block1d4_##dir##2_##avg##opt(src_start, src_stride, dst,  \
89
0
                                                dst_stride, h, filter_row);  \
90
0
      }                                                                      \
91
0
      (void)num_taps;                                                        \
92
0
    }                                                                        \
93
131M
  }
vpx_convolve8_vert_avx2
Line
Count
Source
33
130M
      int x_step_q4, int y0_q4, int y_step_q4, int w, int h) {               \
34
130M
    const int16_t *filter_row = filter[offset];                              \
35
130M
    (void)x0_q4;                                                             \
36
130M
    (void)x_step_q4;                                                         \
37
130M
    (void)y0_q4;                                                             \
38
130M
    (void)y_step_q4;                                                         \
39
130M
    assert(filter_row[3] != 128);                                            \
40
130M
    assert(step_q4 == 16);                                                   \
41
130M
    if (filter_row[0] | filter_row[1] | filter_row[6] | filter_row[7]) {     \
42
51.6M
      const int num_taps = 8;                                                \
43
56.9M
      while (w >= 16) {                                                      \
44
5.34M
        vpx_filter_block1d16_##dir##8_##avg##opt(src_start, src_stride, dst, \
45
5.34M
                                                 dst_stride, h, filter_row); \
46
5.34M
        src += 16;                                                           \
47
5.34M
        dst += 16;                                                           \
48
5.34M
        w -= 16;                                                             \
49
5.34M
      }                                                                      \
50
51.6M
      if (w == 8) {                                                          \
51
13.2M
        vpx_filter_block1d8_##dir##8_##avg##opt(src_start, src_stride, dst,  \
52
13.2M
                                                dst_stride, h, filter_row);  \
53
38.3M
      } else if (w == 4) {                                                   \
54
33.9M
        vpx_filter_block1d4_##dir##8_##avg##opt(src_start, src_stride, dst,  \
55
33.9M
                                                dst_stride, h, filter_row);  \
56
33.9M
      }                                                                      \
57
51.6M
      (void)num_taps;                                                        \
58
78.5M
    } else if (filter_row[2] | filter_row[5]) {                              \
59
78.5M
      const int num_taps = is_avg ? 8 : 4;                                   \
60
85.3M
      while (w >= 16) {                                                      \
61
6.81M
        vpx_filter_block1d16_##dir##4_##avg##opt(src_start, src_stride, dst, \
62
6.81M
                                                 dst_stride, h, filter_row); \
63
6.81M
        src += 16;                                                           \
64
6.81M
        dst += 16;                                                           \
65
6.81M
        w -= 16;                                                             \
66
6.81M
      }                                                                      \
67
78.5M
      if (w == 8) {                                                          \
68
15.9M
        vpx_filter_block1d8_##dir##4_##avg##opt(src_start, src_stride, dst,  \
69
15.9M
                                                dst_stride, h, filter_row);  \
70
62.5M
      } else if (w == 4) {                                                   \
71
57.2M
        vpx_filter_block1d4_##dir##4_##avg##opt(src_start, src_stride, dst,  \
72
57.2M
                                                dst_stride, h, filter_row);  \
73
57.2M
      }                                                                      \
74
78.5M
      (void)num_taps;                                                        \
75
78.5M
    } else {                                                                 \
76
0
      const int num_taps = 2;                                                \
77
0
      while (w >= 16) {                                                      \
78
0
        vpx_filter_block1d16_##dir##2_##avg##opt(src_start, src_stride, dst, \
79
0
                                                 dst_stride, h, filter_row); \
80
0
        src += 16;                                                           \
81
0
        dst += 16;                                                           \
82
0
        w -= 16;                                                             \
83
0
      }                                                                      \
84
0
      if (w == 8) {                                                          \
85
0
        vpx_filter_block1d8_##dir##2_##avg##opt(src_start, src_stride, dst,  \
86
0
                                                dst_stride, h, filter_row);  \
87
0
      } else if (w == 4) {                                                   \
88
0
        vpx_filter_block1d4_##dir##2_##avg##opt(src_start, src_stride, dst,  \
89
0
                                                dst_stride, h, filter_row);  \
90
0
      }                                                                      \
91
0
      (void)num_taps;                                                        \
92
0
    }                                                                        \
93
130M
  }
Unexecuted instantiation: vpx_convolve8_avg_horiz_avx2
Unexecuted instantiation: vpx_convolve8_avg_vert_avx2
Unexecuted instantiation: vpx_convolve8_horiz_ssse3
Unexecuted instantiation: vpx_convolve8_vert_ssse3
Unexecuted instantiation: vpx_convolve8_avg_horiz_ssse3
Unexecuted instantiation: vpx_convolve8_avg_vert_ssse3
94
95
#define FUN_CONV_2D(avg, opt, is_avg)                                          \
96
  void vpx_convolve8_##avg##opt(                                               \
97
      const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst,                  \
98
      ptrdiff_t dst_stride, const InterpKernel *filter, int x0_q4,             \
99
77.0M
      int x_step_q4, int y0_q4, int y_step_q4, int w, int h) {                 \
100
77.0M
    const int16_t *filter_x = filter[x0_q4];                                   \
101
77.0M
    const int16_t *filter_y = filter[y0_q4];                                   \
102
77.0M
    (void)filter_y;                                                            \
103
77.0M
    assert(filter_x[3] != 128);                                                \
104
77.0M
    assert(filter_y[3] != 128);                                                \
105
77.0M
    assert(w <= 64);                                                           \
106
77.0M
    assert(h <= 64);                                                           \
107
77.0M
    assert(x_step_q4 == 16);                                                   \
108
77.0M
    assert(y_step_q4 == 16);                                                   \
109
77.0M
    if (filter_x[0] | filter_x[1] | filter_x[6] | filter_x[7]) {               \
110
31.4M
      DECLARE_ALIGNED(16, uint8_t, fdata2[64 * 71] VPX_UNINITIALIZED);         \
111
31.4M
      vpx_convolve8_horiz_##opt(src - 3 * src_stride, src_stride, fdata2, 64,  \
112
31.4M
                                filter, x0_q4, x_step_q4, y0_q4, y_step_q4, w, \
113
31.4M
                                h + 7);                                        \
114
31.4M
      vpx_convolve8_##avg##vert_##opt(fdata2 + 3 * 64, 64, dst, dst_stride,    \
115
31.4M
                                      filter, x0_q4, x_step_q4, y0_q4,         \
116
31.4M
                                      y_step_q4, w, h);                        \
117
45.6M
    } else if (filter_x[2] | filter_x[5]) {                                    \
118
45.6M
      const int num_taps = is_avg ? 8 : 4;                                     \
119
45.6M
      DECLARE_ALIGNED(16, uint8_t, fdata2[64 * 71] VPX_UNINITIALIZED);         \
120
45.6M
      vpx_convolve8_horiz_##opt(                                               \
121
45.6M
          src - (num_taps / 2 - 1) * src_stride, src_stride, fdata2, 64,       \
122
45.6M
          filter, x0_q4, x_step_q4, y0_q4, y_step_q4, w, h + num_taps - 1);    \
123
45.6M
      vpx_convolve8_##avg##vert_##opt(fdata2 + 64 * (num_taps / 2 - 1), 64,    \
124
45.6M
                                      dst, dst_stride, filter, x0_q4,          \
125
45.6M
                                      x_step_q4, y0_q4, y_step_q4, w, h);      \
126
45.6M
    } else {                                                                   \
127
0
      DECLARE_ALIGNED(16, uint8_t, fdata2[64 * 65] VPX_UNINITIALIZED);         \
128
0
      vpx_convolve8_horiz_##opt(src, src_stride, fdata2, 64, filter, x0_q4,    \
129
0
                                x_step_q4, y0_q4, y_step_q4, w, h + 1);        \
130
0
      vpx_convolve8_##avg##vert_##opt(fdata2, 64, dst, dst_stride, filter,     \
131
0
                                      x0_q4, x_step_q4, y0_q4, y_step_q4, w,   \
132
0
                                      h);                                      \
133
0
    }                                                                          \
134
77.0M
  }
Unexecuted instantiation: vpx_convolve8_sse2
Unexecuted instantiation: vpx_convolve8_avg_sse2
vpx_convolve8_avx2
Line
Count
Source
99
77.0M
      int x_step_q4, int y0_q4, int y_step_q4, int w, int h) {                 \
100
77.0M
    const int16_t *filter_x = filter[x0_q4];                                   \
101
77.0M
    const int16_t *filter_y = filter[y0_q4];                                   \
102
77.0M
    (void)filter_y;                                                            \
103
77.0M
    assert(filter_x[3] != 128);                                                \
104
77.0M
    assert(filter_y[3] != 128);                                                \
105
77.0M
    assert(w <= 64);                                                           \
106
77.0M
    assert(h <= 64);                                                           \
107
77.0M
    assert(x_step_q4 == 16);                                                   \
108
77.0M
    assert(y_step_q4 == 16);                                                   \
109
77.0M
    if (filter_x[0] | filter_x[1] | filter_x[6] | filter_x[7]) {               \
110
31.4M
      DECLARE_ALIGNED(16, uint8_t, fdata2[64 * 71] VPX_UNINITIALIZED);         \
111
31.4M
      vpx_convolve8_horiz_##opt(src - 3 * src_stride, src_stride, fdata2, 64,  \
112
31.4M
                                filter, x0_q4, x_step_q4, y0_q4, y_step_q4, w, \
113
31.4M
                                h + 7);                                        \
114
31.4M
      vpx_convolve8_##avg##vert_##opt(fdata2 + 3 * 64, 64, dst, dst_stride,    \
115
31.4M
                                      filter, x0_q4, x_step_q4, y0_q4,         \
116
31.4M
                                      y_step_q4, w, h);                        \
117
45.6M
    } else if (filter_x[2] | filter_x[5]) {                                    \
118
45.6M
      const int num_taps = is_avg ? 8 : 4;                                     \
119
45.6M
      DECLARE_ALIGNED(16, uint8_t, fdata2[64 * 71] VPX_UNINITIALIZED);         \
120
45.6M
      vpx_convolve8_horiz_##opt(                                               \
121
45.6M
          src - (num_taps / 2 - 1) * src_stride, src_stride, fdata2, 64,       \
122
45.6M
          filter, x0_q4, x_step_q4, y0_q4, y_step_q4, w, h + num_taps - 1);    \
123
45.6M
      vpx_convolve8_##avg##vert_##opt(fdata2 + 64 * (num_taps / 2 - 1), 64,    \
124
45.6M
                                      dst, dst_stride, filter, x0_q4,          \
125
45.6M
                                      x_step_q4, y0_q4, y_step_q4, w, h);      \
126
45.6M
    } else {                                                                   \
127
0
      DECLARE_ALIGNED(16, uint8_t, fdata2[64 * 65] VPX_UNINITIALIZED);         \
128
0
      vpx_convolve8_horiz_##opt(src, src_stride, fdata2, 64, filter, x0_q4,    \
129
0
                                x_step_q4, y0_q4, y_step_q4, w, h + 1);        \
130
0
      vpx_convolve8_##avg##vert_##opt(fdata2, 64, dst, dst_stride, filter,     \
131
0
                                      x0_q4, x_step_q4, y0_q4, y_step_q4, w,   \
132
0
                                      h);                                      \
133
0
    }                                                                          \
134
77.0M
  }
Unexecuted instantiation: vpx_convolve8_avg_avx2
Unexecuted instantiation: vpx_convolve8_ssse3
Unexecuted instantiation: vpx_convolve8_avg_ssse3
135
136
#if CONFIG_VP9_HIGHBITDEPTH
137
138
typedef void highbd_filter8_1dfunction(const uint16_t *src_ptr,
139
                                       const ptrdiff_t src_pitch,
140
                                       uint16_t *output_ptr,
141
                                       ptrdiff_t out_pitch,
142
                                       unsigned int output_height,
143
                                       const int16_t *filter, int bd);
144
145
#define HIGH_FUN_CONV_1D(name, offset, step_q4, dir, src_start, avg, opt,     \
146
                         is_avg)                                              \
147
  void vpx_highbd_convolve8_##name##_##opt(                                   \
148
      const uint16_t *src, ptrdiff_t src_stride, uint16_t *dst,               \
149
      ptrdiff_t dst_stride, const InterpKernel *filter_kernel, int x0_q4,     \
150
0
      int x_step_q4, int y0_q4, int y_step_q4, int w, int h, int bd) {        \
151
0
    const int16_t *filter_row = filter_kernel[offset];                        \
152
0
    if (step_q4 == 16 && filter_row[3] != 128) {                              \
153
0
      if (filter_row[0] | filter_row[1] | filter_row[6] | filter_row[7]) {    \
154
0
        const int num_taps = 8;                                               \
155
0
        while (w >= 16) {                                                     \
156
0
          vpx_highbd_filter_block1d16_##dir##8_##avg##opt(                    \
157
0
              src_start, src_stride, dst, dst_stride, h, filter_row, bd);     \
158
0
          src += 16;                                                          \
159
0
          dst += 16;                                                          \
160
0
          w -= 16;                                                            \
161
0
        }                                                                     \
162
0
        while (w >= 8) {                                                      \
163
0
          vpx_highbd_filter_block1d8_##dir##8_##avg##opt(                     \
164
0
              src_start, src_stride, dst, dst_stride, h, filter_row, bd);     \
165
0
          src += 8;                                                           \
166
0
          dst += 8;                                                           \
167
0
          w -= 8;                                                             \
168
0
        }                                                                     \
169
0
        while (w >= 4) {                                                      \
170
0
          vpx_highbd_filter_block1d4_##dir##8_##avg##opt(                     \
171
0
              src_start, src_stride, dst, dst_stride, h, filter_row, bd);     \
172
0
          src += 4;                                                           \
173
0
          dst += 4;                                                           \
174
0
          w -= 4;                                                             \
175
0
        }                                                                     \
176
0
        (void)num_taps;                                                       \
177
0
      } else if (filter_row[2] | filter_row[5]) {                             \
178
0
        const int num_taps = is_avg ? 8 : 4;                                  \
179
0
        while (w >= 16) {                                                     \
180
0
          vpx_highbd_filter_block1d16_##dir##4_##avg##opt(                    \
181
0
              src_start, src_stride, dst, dst_stride, h, filter_row, bd);     \
182
0
          src += 16;                                                          \
183
0
          dst += 16;                                                          \
184
0
          w -= 16;                                                            \
185
0
        }                                                                     \
186
0
        while (w >= 8) {                                                      \
187
0
          vpx_highbd_filter_block1d8_##dir##4_##avg##opt(                     \
188
0
              src_start, src_stride, dst, dst_stride, h, filter_row, bd);     \
189
0
          src += 8;                                                           \
190
0
          dst += 8;                                                           \
191
0
          w -= 8;                                                             \
192
0
        }                                                                     \
193
0
        while (w >= 4) {                                                      \
194
0
          vpx_highbd_filter_block1d4_##dir##4_##avg##opt(                     \
195
0
              src_start, src_stride, dst, dst_stride, h, filter_row, bd);     \
196
0
          src += 4;                                                           \
197
0
          dst += 4;                                                           \
198
0
          w -= 4;                                                             \
199
0
        }                                                                     \
200
0
        (void)num_taps;                                                       \
201
0
      } else {                                                                \
202
0
        const int num_taps = 2;                                               \
203
0
        while (w >= 16) {                                                     \
204
0
          vpx_highbd_filter_block1d16_##dir##2_##avg##opt(                    \
205
0
              src_start, src_stride, dst, dst_stride, h, filter_row, bd);     \
206
0
          src += 16;                                                          \
207
0
          dst += 16;                                                          \
208
0
          w -= 16;                                                            \
209
0
        }                                                                     \
210
0
        while (w >= 8) {                                                      \
211
0
          vpx_highbd_filter_block1d8_##dir##2_##avg##opt(                     \
212
0
              src_start, src_stride, dst, dst_stride, h, filter_row, bd);     \
213
0
          src += 8;                                                           \
214
0
          dst += 8;                                                           \
215
0
          w -= 8;                                                             \
216
0
        }                                                                     \
217
0
        while (w >= 4) {                                                      \
218
0
          vpx_highbd_filter_block1d4_##dir##2_##avg##opt(                     \
219
0
              src_start, src_stride, dst, dst_stride, h, filter_row, bd);     \
220
0
          src += 4;                                                           \
221
0
          dst += 4;                                                           \
222
0
          w -= 4;                                                             \
223
0
        }                                                                     \
224
0
        (void)num_taps;                                                       \
225
0
      }                                                                       \
226
0
    }                                                                         \
227
0
    if (w) {                                                                  \
228
0
      vpx_highbd_convolve8_##name##_c(src, src_stride, dst, dst_stride,       \
229
0
                                      filter_kernel, x0_q4, x_step_q4, y0_q4, \
230
0
                                      y_step_q4, w, h, bd);                   \
231
0
    }                                                                         \
232
0
  }
Unexecuted instantiation: vpx_highbd_convolve8_horiz_sse2
Unexecuted instantiation: vpx_highbd_convolve8_vert_sse2
Unexecuted instantiation: vpx_highbd_convolve8_avg_horiz_sse2
Unexecuted instantiation: vpx_highbd_convolve8_avg_vert_sse2
Unexecuted instantiation: vpx_highbd_convolve8_horiz_avx2
Unexecuted instantiation: vpx_highbd_convolve8_vert_avx2
Unexecuted instantiation: vpx_highbd_convolve8_avg_horiz_avx2
Unexecuted instantiation: vpx_highbd_convolve8_avg_vert_avx2
233
234
#define HIGH_FUN_CONV_2D(avg, opt, is_avg)                                     \
235
  void vpx_highbd_convolve8_##avg##opt(                                        \
236
      const uint16_t *src, ptrdiff_t src_stride, uint16_t *dst,                \
237
      ptrdiff_t dst_stride, const InterpKernel *filter, int x0_q4,             \
238
0
      int x_step_q4, int y0_q4, int y_step_q4, int w, int h, int bd) {         \
239
0
    const int16_t *filter_x = filter[x0_q4];                                   \
240
0
    assert(w <= 64);                                                           \
241
0
    assert(h <= 64);                                                           \
242
0
    if (x_step_q4 == 16 && y_step_q4 == 16) {                                  \
243
0
      if ((filter_x[0] | filter_x[1] | filter_x[6] | filter_x[7]) ||           \
244
0
          filter_x[3] == 128) {                                                \
245
0
        DECLARE_ALIGNED(16, uint16_t, fdata2[64 * 71] VPX_UNINITIALIZED);      \
246
0
        vpx_highbd_convolve8_horiz_##opt(src - 3 * src_stride, src_stride,     \
247
0
                                         fdata2, 64, filter, x0_q4, x_step_q4, \
248
0
                                         y0_q4, y_step_q4, w, h + 7, bd);      \
249
0
        vpx_highbd_convolve8_##avg##vert_##opt(                                \
250
0
            fdata2 + 192, 64, dst, dst_stride, filter, x0_q4, x_step_q4,       \
251
0
            y0_q4, y_step_q4, w, h, bd);                                       \
252
0
      } else if (filter_x[2] | filter_x[5]) {                                  \
253
0
        const int num_taps = is_avg ? 8 : 4;                                   \
254
0
        DECLARE_ALIGNED(16, uint16_t, fdata2[64 * 71] VPX_UNINITIALIZED);      \
255
0
        vpx_highbd_convolve8_horiz_##opt(                                      \
256
0
            src - (num_taps / 2 - 1) * src_stride, src_stride, fdata2, 64,     \
257
0
            filter, x0_q4, x_step_q4, y0_q4, y_step_q4, w, h + num_taps - 1,   \
258
0
            bd);                                                               \
259
0
        vpx_highbd_convolve8_##avg##vert_##opt(                                \
260
0
            fdata2 + 64 * (num_taps / 2 - 1), 64, dst, dst_stride, filter,     \
261
0
            x0_q4, x_step_q4, y0_q4, y_step_q4, w, h, bd);                     \
262
0
      } else {                                                                 \
263
0
        DECLARE_ALIGNED(16, uint16_t, fdata2[64 * 65] VPX_UNINITIALIZED);      \
264
0
        vpx_highbd_convolve8_horiz_##opt(src, src_stride, fdata2, 64, filter,  \
265
0
                                         x0_q4, x_step_q4, y0_q4, y_step_q4,   \
266
0
                                         w, h + 1, bd);                        \
267
0
        vpx_highbd_convolve8_##avg##vert_##opt(fdata2, 64, dst, dst_stride,    \
268
0
                                               filter, x0_q4, x_step_q4,       \
269
0
                                               y0_q4, y_step_q4, w, h, bd);    \
270
0
      }                                                                        \
271
0
    } else {                                                                   \
272
0
      vpx_highbd_convolve8_##avg##c(src, src_stride, dst, dst_stride, filter,  \
273
0
                                    x0_q4, x_step_q4, y0_q4, y_step_q4, w, h,  \
274
0
                                    bd);                                       \
275
0
    }                                                                          \
276
0
  }
Unexecuted instantiation: vpx_highbd_convolve8_sse2
Unexecuted instantiation: vpx_highbd_convolve8_avg_sse2
Unexecuted instantiation: vpx_highbd_convolve8_avx2
Unexecuted instantiation: vpx_highbd_convolve8_avg_avx2
277
278
#endif  // CONFIG_VP9_HIGHBITDEPTH
279
#endif  // VPX_VPX_DSP_X86_CONVOLVE_H_