25 #define D(type, simd) \
26 mix_1_1_func_type ff_mix_1_1_a_## type ## _ ## simd;\
27 mix_2_1_func_type ff_mix_2_1_a_## type ## _ ## simd;
37 int nb_in =
s->used_ch_count;
38 int nb_out =
s->out.ch_count;
39 int num = nb_in * nb_out;
42 s->mix_1_1_simd =
NULL;
43 s->mix_2_1_simd =
NULL;
47 s->mix_1_1_simd = ff_mix_1_1_a_int16_mmx;
48 s->mix_2_1_simd = ff_mix_2_1_a_int16_mmx;
51 s->mix_1_1_simd = ff_mix_1_1_a_int16_sse2;
52 s->mix_2_1_simd = ff_mix_2_1_a_int16_sse2;
54 s->native_simd_matrix =
av_calloc(num, 2 *
sizeof(int16_t));
55 s->native_simd_one =
av_mallocz(2 *
sizeof(int16_t));
56 if (!
s->native_simd_matrix || !
s->native_simd_one)
59 for(
i=0;
i<nb_out;
i++){
61 for(j=0; j<nb_in; j++)
62 sh =
FFMAX(sh,
FFABS(((
int*)
s->native_matrix)[
i * nb_in + j]));
64 for(j=0; j<nb_in; j++) {
65 ((int16_t*)
s->native_simd_matrix)[2*(
i * nb_in + j)+1] = 15 - sh;
66 ((int16_t*)
s->native_simd_matrix)[2*(
i * nb_in + j)] =
67 ((((
int*)
s->native_matrix)[
i * nb_in + j]) + (1<<sh>>1)) >> sh;
70 ((int16_t*)
s->native_simd_one)[1] = 14;
71 ((int16_t*)
s->native_simd_one)[0] = 16384;
74 s->mix_1_1_simd = ff_mix_1_1_a_float_sse;
75 s->mix_2_1_simd = ff_mix_2_1_a_float_sse;
78 s->mix_1_1_simd = ff_mix_1_1_a_float_avx;
79 s->mix_2_1_simd = ff_mix_2_1_a_float_avx;
81 s->native_simd_matrix =
av_calloc(num,
sizeof(
float));
83 if (!
s->native_simd_matrix || !
s->native_simd_one)
85 memcpy(
s->native_simd_matrix,
s->native_matrix, num *
sizeof(
float));
86 memcpy(
s->native_simd_one,
s->native_one,
sizeof(
float));