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;
36 int nb_in = s->used_ch_count;
37 int nb_out = s->out.ch_count;
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));
#define EXTERNAL_MMX(flags)
static int sse(MpegEncContext *s, uint8_t *src1, uint8_t *src2, int w, int h, int stride)
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
#define EXTERNAL_SSE(flags)
#define EXTERNAL_AVX_FAST(flags)
#define EXTERNAL_SSE2(flags)
The libswresample context.
int swri_rematrix_init_x86(struct SwrContext *s)
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
void * av_mallocz_array(size_t nmemb, size_t size)