24 #define D(type, simd) \
25 mix_1_1_func_type ff_mix_1_1_a_## type ## _ ## simd;\
26 mix_2_1_func_type ff_mix_2_1_a_## type ## _ ## simd;
38 int num = nb_in * nb_out;
41 s->mix_1_1_simd =
NULL;
42 s->mix_2_1_simd =
NULL;
46 s->mix_1_1_simd = ff_mix_1_1_a_int16_mmx;
47 s->mix_2_1_simd = ff_mix_2_1_a_int16_mmx;
50 s->mix_1_1_simd = ff_mix_1_1_a_int16_sse2;
51 s->mix_2_1_simd = ff_mix_2_1_a_int16_sse2;
54 s->native_simd_one =
av_mallocz(2 *
sizeof(int16_t));
55 if (!s->native_simd_matrix || !s->native_simd_one)
58 for(i=0; i<nb_out; i++){
60 for(j=0; j<nb_in; j++)
61 sh =
FFMAX(sh,
FFABS(((
int*)s->native_matrix)[i * nb_in + j]));
63 for(j=0; j<nb_in; j++) {
64 ((int16_t*)s->native_simd_matrix)[2*(i * nb_in + j)+1] = 15 - sh;
65 ((int16_t*)s->native_simd_matrix)[2*(i * nb_in + j)] =
66 ((((
int*)s->native_matrix)[i * nb_in + j]) + (1<<sh>>1)) >> sh;
69 ((int16_t*)s->native_simd_one)[1] = 14;
70 ((int16_t*)s->native_simd_one)[0] = 16384;
73 s->mix_1_1_simd = ff_mix_1_1_a_float_sse;
74 s->mix_2_1_simd = ff_mix_2_1_a_float_sse;
77 s->mix_1_1_simd = ff_mix_1_1_a_float_avx;
78 s->mix_2_1_simd = ff_mix_2_1_a_float_avx;
81 s->native_simd_one =
av_mallocz(
sizeof(
float));
82 if (!s->native_simd_matrix || !s->native_simd_one)
84 memcpy(s->native_simd_matrix, s->native_matrix, num *
sizeof(
float));
85 memcpy(s->native_simd_one, s->native_one,
sizeof(
float));