64 #if ARCH_X86_64 && HAVE_AVX2_EXTERNAL
68 extern const int8_t ff_filters_ssse3[3][15][4][32];
69 extern const int16_t ff_filters_sse2[3][15][8][8];
75 #if ARCH_X86_64 && HAVE_AVX2_EXTERNAL
86 #if ARCH_X86_64 && HAVE_AVX2_EXTERNAL
93 #define itxfm_func(typea, typeb, size, opt) \
94 void ff_vp9_##typea##_##typeb##_##size##x##size##_add_##opt(uint8_t *dst, ptrdiff_t stride, \
95 int16_t *block, int eob)
96 #define itxfm_funcs(size, opt) \
97 itxfm_func(idct, idct, size, opt); \
98 itxfm_func(iadst, idct, size, opt); \
99 itxfm_func(idct, iadst, size, opt); \
100 itxfm_func(iadst, iadst, size, opt)
103 itxfm_func(
idct, iadst, 4, sse2);
104 itxfm_func(iadst,
idct, 4, sse2);
105 itxfm_func(iadst, iadst, 4, sse2);
106 itxfm_funcs(4, ssse3);
107 itxfm_funcs(8, sse2);
108 itxfm_funcs(8, ssse3);
110 itxfm_funcs(16, sse2);
111 itxfm_funcs(16, ssse3);
112 itxfm_funcs(16, avx);
116 itxfm_func(iwht, iwht, 4, mmx);
121 #define lpf_funcs(size1, size2, opt) \
122 void ff_vp9_loop_filter_v_##size1##_##size2##_##opt(uint8_t *dst, ptrdiff_t stride, \
123 int E, int I, int H); \
124 void ff_vp9_loop_filter_h_##size1##_##size2##_##opt(uint8_t *dst, ptrdiff_t stride, \
127 lpf_funcs(16, 16, sse2);
128 lpf_funcs(16, 16, ssse3);
129 lpf_funcs(16, 16, avx);
130 lpf_funcs(44, 16, sse2);
131 lpf_funcs(44, 16, ssse3);
132 lpf_funcs(44, 16, avx);
133 lpf_funcs(84, 16, sse2);
134 lpf_funcs(84, 16, ssse3);
135 lpf_funcs(84, 16, avx);
136 lpf_funcs(48, 16, sse2);
137 lpf_funcs(48, 16, ssse3);
138 lpf_funcs(48, 16, avx);
139 lpf_funcs(88, 16, sse2);
140 lpf_funcs(88, 16, ssse3);
141 lpf_funcs(88, 16, avx);
145 #define ipred_func(size, type, opt) \
146 void ff_vp9_ipred_##type##_##size##x##size##_##opt(uint8_t *dst, ptrdiff_t stride, \
147 const uint8_t *l, const uint8_t *a)
149 ipred_func(8, v, mmx);
151 #define ipred_dc_funcs(size, opt) \
152 ipred_func(size, dc, opt); \
153 ipred_func(size, dc_left, opt); \
154 ipred_func(size, dc_top, opt)
156 ipred_dc_funcs(4, mmxext);
157 ipred_dc_funcs(8, mmxext);
159 #define ipred_dir_tm_funcs(size, opt) \
160 ipred_func(size, tm, opt); \
161 ipred_func(size, dl, opt); \
162 ipred_func(size, dr, opt); \
163 ipred_func(size, hd, opt); \
164 ipred_func(size, hu, opt); \
165 ipred_func(size, vl, opt); \
166 ipred_func(size, vr, opt)
168 ipred_dir_tm_funcs(4, mmxext);
170 ipred_func(16, v,
sse);
171 ipred_func(32, v,
sse);
173 ipred_dc_funcs(16, sse2);
174 ipred_dc_funcs(32, sse2);
176 #define ipred_dir_tm_h_funcs(size, opt) \
177 ipred_dir_tm_funcs(size, opt); \
178 ipred_func(size, h, opt)
180 ipred_dir_tm_h_funcs(8, sse2);
181 ipred_dir_tm_h_funcs(16, sse2);
182 ipred_dir_tm_h_funcs(32, sse2);
184 ipred_func(4,
h, sse2);
186 #define ipred_all_funcs(size, opt) \
187 ipred_dc_funcs(size, opt); \
188 ipred_dir_tm_h_funcs(size, opt)
191 ipred_all_funcs(4, ssse3);
192 ipred_all_funcs(8, ssse3);
193 ipred_all_funcs(16, ssse3);
194 ipred_all_funcs(32, ssse3);
196 ipred_dir_tm_h_funcs(8, avx);
197 ipred_dir_tm_h_funcs(16, avx);
198 ipred_dir_tm_h_funcs(32, avx);
200 ipred_func(32, v, avx);
202 ipred_dc_funcs(32, avx2);
203 ipred_func(32,
h, avx2);
204 ipred_func(32, tm, avx2);
207 #undef ipred_dir_tm_h_funcs
208 #undef ipred_dir_tm_funcs
209 #undef ipred_dc_funcs
221 }
else if (bpp == 12) {
228 #define init_lpf(opt) do { \
229 dsp->loop_filter_16[0] = ff_vp9_loop_filter_h_16_16_##opt; \
230 dsp->loop_filter_16[1] = ff_vp9_loop_filter_v_16_16_##opt; \
231 dsp->loop_filter_mix2[0][0][0] = ff_vp9_loop_filter_h_44_16_##opt; \
232 dsp->loop_filter_mix2[0][0][1] = ff_vp9_loop_filter_v_44_16_##opt; \
233 dsp->loop_filter_mix2[0][1][0] = ff_vp9_loop_filter_h_48_16_##opt; \
234 dsp->loop_filter_mix2[0][1][1] = ff_vp9_loop_filter_v_48_16_##opt; \
235 dsp->loop_filter_mix2[1][0][0] = ff_vp9_loop_filter_h_84_16_##opt; \
236 dsp->loop_filter_mix2[1][0][1] = ff_vp9_loop_filter_v_84_16_##opt; \
237 dsp->loop_filter_mix2[1][1][0] = ff_vp9_loop_filter_h_88_16_##opt; \
238 dsp->loop_filter_mix2[1][1][1] = ff_vp9_loop_filter_v_88_16_##opt; \
241 #define init_ipred(sz, opt, t, e) \
242 dsp->intra_pred[TX_##sz##X##sz][e##_PRED] = ff_vp9_ipred_##t##_##sz##x##sz##_##opt
244 #define ff_vp9_ipred_hd_4x4_ssse3 ff_vp9_ipred_hd_4x4_mmxext
245 #define ff_vp9_ipred_vl_4x4_ssse3 ff_vp9_ipred_vl_4x4_mmxext
246 #define init_dir_tm_ipred(sz, opt) do { \
247 init_ipred(sz, opt, dl, DIAG_DOWN_LEFT); \
248 init_ipred(sz, opt, dr, DIAG_DOWN_RIGHT); \
249 init_ipred(sz, opt, hd, HOR_DOWN); \
250 init_ipred(sz, opt, vl, VERT_LEFT); \
251 init_ipred(sz, opt, hu, HOR_UP); \
252 init_ipred(sz, opt, tm, TM_VP8); \
253 init_ipred(sz, opt, vr, VERT_RIGHT); \
255 #define init_dir_tm_h_ipred(sz, opt) do { \
256 init_dir_tm_ipred(sz, opt); \
257 init_ipred(sz, opt, h, HOR); \
259 #define init_dc_ipred(sz, opt) do { \
260 init_ipred(sz, opt, dc, DC); \
261 init_ipred(sz, opt, dc_left, LEFT_DC); \
262 init_ipred(sz, opt, dc_top, TOP_DC); \
264 #define init_all_ipred(sz, opt) do { \
265 init_dc_ipred(sz, opt); \
266 init_dir_tm_h_ipred(sz, opt); \
278 init_ipred(8, mmx, v, VERT);
287 init_dc_ipred(4, mmxext);
288 init_dc_ipred(8, mmxext);
289 init_dir_tm_ipred(4, mmxext);
296 init_ipred(16,
sse, v, VERT);
297 init_ipred(32,
sse, v, VERT);
322 init_dc_ipred(16, sse2);
323 init_dc_ipred(32, sse2);
324 init_dir_tm_h_ipred(8, sse2);
325 init_dir_tm_h_ipred(16, sse2);
326 init_dir_tm_h_ipred(32, sse2);
327 init_ipred(4, sse2,
h, HOR);
350 init_all_ipred(4, ssse3);
351 init_all_ipred(8, ssse3);
352 init_all_ipred(16, ssse3);
353 init_all_ipred(32, ssse3);
370 init_dir_tm_h_ipred(8, avx);
371 init_dir_tm_h_ipred(16, avx);
372 init_dir_tm_h_ipred(32, avx);
377 init_ipred(32, avx, v, VERT);
384 #if ARCH_X86_64 && HAVE_AVX2_EXTERNAL
389 init_dc_ipred(32, avx2);
390 init_ipred(32, avx2,
h, HOR);
391 init_ipred(32, avx2, tm, TM_VP8);
#define EXTERNAL_MMX(flags)
void ff_vp9dsp_init_10bpp_x86(VP9DSPContext *dsp, int bitexact)
static void idct(int16_t block[64])
#define init_subpel3(idx, type)
memory handling functions
static int sse(MpegEncContext *s, uint8_t *src1, uint8_t *src2, int w, int h, int stride)
#define filters_8tap_1d_fn2(op, sz, bpp, opt, f_opt)
#define EXTERNAL_SSE(flags)
Macro definitions for various function/variable attributes.
#define filters_8tap_2d_fn2(op, align, bpp, bytes, opt4, opt8, f_opt)
#define decl_mc_funcs(sz, opt, type, fsz, bpp)
#define EXTERNAL_AVX_FAST(flags)
#define init_subpel2(idx, idxh, idxv, dir, type)
#define EXTERNAL_SSE2(flags)
#define filters_8tap_2d_fn(op, sz, align, bpp, bytes, opt, f_opt)
#define EXTERNAL_AVX2_FAST(flags)
#define init_subpel3_8to64(idx, type, bpp, opt)
void ff_vp9dsp_init_12bpp_x86(VP9DSPContext *dsp, int bitexact)
#define mc_rep_funcs(name, bitd, step, W, opt)
#define filters_8tap_1d_fn3(op, bpp, opt4, opt8, f_opt)
#define decl_fpel_func(avg, sz, bpp, opt)
#define EXTERNAL_SSSE3(flags)
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
#define init_subpel3_32_64(idx, type, bpp, opt)
#define EXTERNAL_MMXEXT(flags)
av_cold void ff_vp9dsp_init_x86(VP9DSPContext *dsp, int bpp, int bitexact)
void(* itxfm_add[N_TXFM_SIZES+1][N_TXFM_TYPES])(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob)
#define init_fpel_func(idx1, idx2, sz, type, bpp, opt)
#define EXTERNAL_AVX(flags)