30 #define fpel_func(avg, sz, opt) \
31 void ff_##avg##sz##_##opt(uint8_t *dst, ptrdiff_t dst_stride, \
32 const uint8_t *src, ptrdiff_t src_stride, \
33 int h, int mx, int my)
34 fpel_func(put, 4, mmx);
35 fpel_func(put, 8, mmx);
36 fpel_func(put, 16,
sse);
37 fpel_func(put, 32,
sse);
38 fpel_func(put, 64,
sse);
39 fpel_func(avg, 4,
sse);
40 fpel_func(avg, 8,
sse);
41 fpel_func(avg, 16, sse2);
42 fpel_func(avg, 32, sse2);
43 fpel_func(avg, 64, sse2);
46 #define mc_func(avg, sz, dir, opt) \
47 void ff_##avg##_8tap_1d_##dir##_##sz##_##opt(uint8_t *dst, ptrdiff_t dst_stride, \
48 const uint8_t *src, ptrdiff_t src_stride, \
49 int h, const int8_t (*filter)[16])
50 #define mc_funcs(sz) \
51 mc_func(put, sz, h, ssse3); \
52 mc_func(avg, sz, h, ssse3); \
53 mc_func(put, sz, v, ssse3); \
54 mc_func(avg, sz, v, ssse3)
62 #define mc_rep_func(avg, sz, hsz, dir, opt) \
63 static av_always_inline void \
64 ff_##avg##_8tap_1d_##dir##_##sz##_##opt(uint8_t *dst, ptrdiff_t dst_stride, \
65 const uint8_t *src, ptrdiff_t src_stride, \
66 int h, const int8_t (*filter)[16]) \
68 ff_##avg##_8tap_1d_##dir##_##hsz##_##opt(dst, dst_stride, src, \
69 src_stride, h, filter); \
70 ff_##avg##_8tap_1d_##dir##_##hsz##_##opt(dst + hsz, dst_stride, src + hsz, \
71 src_stride, h, filter); \
74 #define mc_rep_funcs(sz, hsz) \
75 mc_rep_func(put, sz, hsz, h, ssse3); \
76 mc_rep_func(avg, sz, hsz, h, ssse3); \
77 mc_rep_func(put, sz, hsz, v, ssse3); \
78 mc_rep_func(avg, sz, hsz, v, ssse3)
87 extern const int8_t ff_filters_ssse3[3][15][4][16];
89 #define filter_8tap_2d_fn(op, sz, f, fname) \
90 static void op##_8tap_##fname##_##sz##hv_ssse3(uint8_t *dst, ptrdiff_t dst_stride, \
91 const uint8_t *src, ptrdiff_t src_stride, \
92 int h, int mx, int my) \
94 LOCAL_ALIGNED_16(uint8_t, temp, [71 * 64]); \
95 ff_put_8tap_1d_h_##sz##_ssse3(temp, 64, src - 3 * src_stride, src_stride, \
96 h + 7, ff_filters_ssse3[f][mx - 1]); \
97 ff_##op##_8tap_1d_v_##sz##_ssse3(dst, dst_stride, temp + 3 * 64, 64, \
98 h, ff_filters_ssse3[f][my - 1]); \
101 #define filters_8tap_2d_fn(op, sz) \
102 filter_8tap_2d_fn(op, sz, FILTER_8TAP_REGULAR, regular) \
103 filter_8tap_2d_fn(op, sz, FILTER_8TAP_SHARP, sharp) \
104 filter_8tap_2d_fn(op, sz, FILTER_8TAP_SMOOTH, smooth)
106 #define filters_8tap_2d_fn2(op) \
107 filters_8tap_2d_fn(op, 64) \
108 filters_8tap_2d_fn(op, 32) \
109 filters_8tap_2d_fn(op, 16) \
110 filters_8tap_2d_fn(op, 8) \
111 filters_8tap_2d_fn(op, 4)
113 filters_8tap_2d_fn2(put)
114 filters_8tap_2d_fn2(avg)
116 #undef filters_8tap_2d_fn2
117 #undef filters_8tap_2d_fn
118 #undef filter_8tap_2d_fn
120 #define filter_8tap_1d_fn(op, sz, f, fname, dir, dvar) \
121 static void op##_8tap_##fname##_##sz##dir##_ssse3(uint8_t *dst, ptrdiff_t dst_stride, \
122 const uint8_t *src, ptrdiff_t src_stride, \
123 int h, int mx, int my) \
125 ff_##op##_8tap_1d_##dir##_##sz##_ssse3(dst, dst_stride, src, src_stride, \
126 h, ff_filters_ssse3[f][dvar - 1]); \
129 #define filters_8tap_1d_fn(op, sz, dir, dvar) \
130 filter_8tap_1d_fn(op, sz, FILTER_8TAP_REGULAR, regular, dir, dvar) \
131 filter_8tap_1d_fn(op, sz, FILTER_8TAP_SHARP, sharp, dir, dvar) \
132 filter_8tap_1d_fn(op, sz, FILTER_8TAP_SMOOTH, smooth, dir, dvar)
134 #define filters_8tap_1d_fn2(op, sz) \
135 filters_8tap_1d_fn(op, sz, h, mx) \
136 filters_8tap_1d_fn(op, sz, v, my)
138 #define filters_8tap_1d_fn3(op) \
139 filters_8tap_1d_fn2(op, 64) \
140 filters_8tap_1d_fn2(op, 32) \
141 filters_8tap_1d_fn2(op, 16) \
142 filters_8tap_1d_fn2(op, 8) \
143 filters_8tap_1d_fn2(op, 4)
145 filters_8tap_1d_fn3(put)
146 filters_8tap_1d_fn3(avg)
148 #undef filters_8tap_1d_fn
149 #undef filters_8tap_1d_fn2
150 #undef filters_8tap_1d_fn3
151 #undef filter_8tap_1d_fn
160 #define init_fpel(idx1, idx2, sz, type, opt) \
161 dsp->mc[idx1][FILTER_8TAP_SMOOTH ][idx2][0][0] = \
162 dsp->mc[idx1][FILTER_8TAP_REGULAR][idx2][0][0] = \
163 dsp->mc[idx1][FILTER_8TAP_SHARP ][idx2][0][0] = \
164 dsp->mc[idx1][FILTER_BILINEAR ][idx2][0][0] = ff_##type##sz##_##opt
167 #define init_subpel1(idx1, idx2, idxh, idxv, sz, dir, type, opt) \
168 dsp->mc[idx1][FILTER_8TAP_SMOOTH ][idx2][idxh][idxv] = type##_8tap_smooth_##sz##dir##_##opt; \
169 dsp->mc[idx1][FILTER_8TAP_REGULAR][idx2][idxh][idxv] = type##_8tap_regular_##sz##dir##_##opt; \
170 dsp->mc[idx1][FILTER_8TAP_SHARP ][idx2][idxh][idxv] = type##_8tap_sharp_##sz##dir##_##opt
172 #define init_subpel2(idx, idxh, idxv, dir, type, opt) \
173 init_subpel1(0, idx, idxh, idxv, 64, dir, type, opt); \
174 init_subpel1(1, idx, idxh, idxv, 32, dir, type, opt); \
175 init_subpel1(2, idx, idxh, idxv, 16, dir, type, opt); \
176 init_subpel1(3, idx, idxh, idxv, 8, dir, type, opt); \
177 init_subpel1(4, idx, idxh, idxv, 4, dir, type, opt)
179 #define init_subpel3(idx, type, opt) \
180 init_subpel2(idx, 1, 1, hv, type, opt); \
181 init_subpel2(idx, 0, 1, v, type, opt); \
182 init_subpel2(idx, 1, 0, h, type, opt)