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);
117 itxfm_funcs(16, avx2);
123 #define lpf_funcs(size1, size2, opt) \
124 void ff_vp9_loop_filter_v_##size1##_##size2##_##opt(uint8_t *dst, ptrdiff_t stride, \
125 int E, int I, int H); \
126 void ff_vp9_loop_filter_h_##size1##_##size2##_##opt(uint8_t *dst, ptrdiff_t stride, \
129 lpf_funcs(4, 8, mmxext);
130 lpf_funcs(8, 8, mmxext);
131 lpf_funcs(16, 16, sse2);
132 lpf_funcs(16, 16, ssse3);
133 lpf_funcs(16, 16, avx);
134 lpf_funcs(44, 16, sse2);
135 lpf_funcs(44, 16, ssse3);
136 lpf_funcs(44, 16, avx);
137 lpf_funcs(84, 16, sse2);
138 lpf_funcs(84, 16, ssse3);
139 lpf_funcs(84, 16, avx);
140 lpf_funcs(48, 16, sse2);
141 lpf_funcs(48, 16, ssse3);
142 lpf_funcs(48, 16, avx);
143 lpf_funcs(88, 16, sse2);
144 lpf_funcs(88, 16, ssse3);
145 lpf_funcs(88, 16, avx);
149 #define ipred_func(size, type, opt) \
150 void ff_vp9_ipred_##type##_##size##x##size##_##opt(uint8_t *dst, ptrdiff_t stride, \
151 const uint8_t *l, const uint8_t *a)
153 ipred_func(8, v, mmx);
155 #define ipred_dc_funcs(size, opt) \
156 ipred_func(size, dc, opt); \
157 ipred_func(size, dc_left, opt); \
158 ipred_func(size, dc_top, opt)
160 ipred_dc_funcs(4, mmxext);
161 ipred_dc_funcs(8, mmxext);
163 #define ipred_dir_tm_funcs(size, opt) \
164 ipred_func(size, tm, opt); \
165 ipred_func(size, dl, opt); \
166 ipred_func(size, dr, opt); \
167 ipred_func(size, hd, opt); \
168 ipred_func(size, hu, opt); \
169 ipred_func(size, vl, opt); \
170 ipred_func(size, vr, opt)
172 ipred_dir_tm_funcs(4, mmxext);
174 ipred_func(16, v,
sse);
175 ipred_func(32, v,
sse);
177 ipred_dc_funcs(16, sse2);
178 ipred_dc_funcs(32, sse2);
180 #define ipred_dir_tm_h_funcs(size, opt) \
181 ipred_dir_tm_funcs(size, opt); \
182 ipred_func(size, h, opt)
184 ipred_dir_tm_h_funcs(8, sse2);
185 ipred_dir_tm_h_funcs(16, sse2);
186 ipred_dir_tm_h_funcs(32, sse2);
188 ipred_func(4,
h, sse2);
190 #define ipred_all_funcs(size, opt) \
191 ipred_dc_funcs(size, opt); \
192 ipred_dir_tm_h_funcs(size, opt)
195 ipred_all_funcs(4, ssse3);
196 ipred_all_funcs(8, ssse3);
197 ipred_all_funcs(16, ssse3);
198 ipred_all_funcs(32, ssse3);
200 ipred_dir_tm_h_funcs(8, avx);
201 ipred_dir_tm_h_funcs(16, avx);
202 ipred_dir_tm_h_funcs(32, avx);
204 ipred_func(32, v, avx);
206 ipred_dc_funcs(32, avx2);
207 ipred_func(32,
h, avx2);
208 ipred_func(32, tm, avx2);
211 #undef ipred_dir_tm_h_funcs
212 #undef ipred_dir_tm_funcs
213 #undef ipred_dc_funcs
225 }
else if (bpp == 12) {
232 #define init_lpf(opt) do { \
233 dsp->loop_filter_16[0] = ff_vp9_loop_filter_h_16_16_##opt; \
234 dsp->loop_filter_16[1] = ff_vp9_loop_filter_v_16_16_##opt; \
235 dsp->loop_filter_mix2[0][0][0] = ff_vp9_loop_filter_h_44_16_##opt; \
236 dsp->loop_filter_mix2[0][0][1] = ff_vp9_loop_filter_v_44_16_##opt; \
237 dsp->loop_filter_mix2[0][1][0] = ff_vp9_loop_filter_h_48_16_##opt; \
238 dsp->loop_filter_mix2[0][1][1] = ff_vp9_loop_filter_v_48_16_##opt; \
239 dsp->loop_filter_mix2[1][0][0] = ff_vp9_loop_filter_h_84_16_##opt; \
240 dsp->loop_filter_mix2[1][0][1] = ff_vp9_loop_filter_v_84_16_##opt; \
241 dsp->loop_filter_mix2[1][1][0] = ff_vp9_loop_filter_h_88_16_##opt; \
242 dsp->loop_filter_mix2[1][1][1] = ff_vp9_loop_filter_v_88_16_##opt; \
245 #define init_ipred(sz, opt, t, e) \
246 dsp->intra_pred[TX_##sz##X##sz][e##_PRED] = ff_vp9_ipred_##t##_##sz##x##sz##_##opt
248 #define ff_vp9_ipred_hd_4x4_ssse3 ff_vp9_ipred_hd_4x4_mmxext
249 #define ff_vp9_ipred_vl_4x4_ssse3 ff_vp9_ipred_vl_4x4_mmxext
250 #define init_dir_tm_ipred(sz, opt) do { \
251 init_ipred(sz, opt, dl, DIAG_DOWN_LEFT); \
252 init_ipred(sz, opt, dr, DIAG_DOWN_RIGHT); \
253 init_ipred(sz, opt, hd, HOR_DOWN); \
254 init_ipred(sz, opt, vl, VERT_LEFT); \
255 init_ipred(sz, opt, hu, HOR_UP); \
256 init_ipred(sz, opt, tm, TM_VP8); \
257 init_ipred(sz, opt, vr, VERT_RIGHT); \
259 #define init_dir_tm_h_ipred(sz, opt) do { \
260 init_dir_tm_ipred(sz, opt); \
261 init_ipred(sz, opt, h, HOR); \
263 #define init_dc_ipred(sz, opt) do { \
264 init_ipred(sz, opt, dc, DC); \
265 init_ipred(sz, opt, dc_left, LEFT_DC); \
266 init_ipred(sz, opt, dc_top, TOP_DC); \
268 #define init_all_ipred(sz, opt) do { \
269 init_dc_ipred(sz, opt); \
270 init_dir_tm_h_ipred(sz, opt); \
282 init_ipred(8, mmx, v, VERT);
295 init_dc_ipred(4, mmxext);
296 init_dc_ipred(8, mmxext);
297 init_dir_tm_ipred(4, mmxext);
304 init_ipred(16,
sse, v, VERT);
305 init_ipred(32,
sse, v, VERT);
330 init_dc_ipred(16, sse2);
331 init_dc_ipred(32, sse2);
332 init_dir_tm_h_ipred(8, sse2);
333 init_dir_tm_h_ipred(16, sse2);
334 init_dir_tm_h_ipred(32, sse2);
335 init_ipred(4, sse2,
h, HOR);
358 init_all_ipred(4, ssse3);
359 init_all_ipred(8, ssse3);
360 init_all_ipred(16, ssse3);
361 init_all_ipred(32, ssse3);
378 init_dir_tm_h_ipred(8, avx);
379 init_dir_tm_h_ipred(16, avx);
380 init_dir_tm_h_ipred(32, avx);
385 init_ipred(32, avx, v, VERT);
392 #if ARCH_X86_64 && HAVE_AVX2_EXTERNAL
405 init_dc_ipred(32, avx2);
406 init_ipred(32, avx2,
h, HOR);
407 init_ipred(32, avx2, tm, TM_VP8);
#define EXTERNAL_MMX(flags)
#define decl_fpel_func(avg, sz, bpp, opt)
static void idct(int16_t block[64])
#define init_subpel3(idx, type)
Memory handling functions.
#define filters_8tap_2d_fn2(op, align, bpp, bytes, opt4, opt8, f_opt)
static int sse(MpegEncContext *s, uint8_t *src1, uint8_t *src2, int w, int h, int stride)
static atomic_int cpu_flags
#define EXTERNAL_SSE(flags)
Macro definitions for various function/variable attributes.
#define EXTERNAL_AVX_FAST(flags)
#define init_subpel2(idx, idxh, idxv, dir, type)
#define EXTERNAL_SSE2(flags)
#define EXTERNAL_AVX2_FAST(flags)
#define mc_rep_funcs(name, bitd, step, W, opt)
#define decl_mc_funcs(sz, bpp)
#define init_subpel3_32_64(idx, type, bpp, opt)
#define init_fpel_func(idx1, idx2, sz, type, bpp, opt)
void ff_vp9dsp_init_10bpp_x86(VP9DSPContext *dsp, int bitexact)
void(* loop_filter_8[3][2])(uint8_t *dst, ptrdiff_t stride, int mb_lim, int lim, int hev_thr)
#define filters_8tap_1d_fn2(op, sz, bpp, opt, f_opt)
#define filters_8tap_2d_fn(op, sz, align, bpp, bytes, opt, f_opt)
#define EXTERNAL_SSSE3(flags)
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
void ff_vp9dsp_init_12bpp_x86(VP9DSPContext *dsp, int bitexact)
#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 filters_8tap_1d_fn3(op, bpp, opt4, opt8, f_opt)
#define init_subpel3_8to64(idx, type, bpp, opt)
#define EXTERNAL_AVX(flags)