Go to the documentation of this file.
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;
36 int nb_in =
s->used_ch_layout.nb_channels;
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_sse2;
47 s->mix_2_1_simd = ff_mix_2_1_a_int16_sse2;
49 s->native_simd_matrix =
av_calloc(num, 2 *
sizeof(int16_t));
50 s->native_simd_one =
av_mallocz(2 *
sizeof(int16_t));
51 if (!
s->native_simd_matrix || !
s->native_simd_one)
54 for(
i=0;
i<nb_out;
i++){
56 for(j=0; j<nb_in; j++)
57 sh =
FFMAX(sh,
FFABS(((
int*)
s->native_matrix)[
i * nb_in + j]));
59 for(j=0; j<nb_in; j++) {
60 ((int16_t*)
s->native_simd_matrix)[2*(
i * nb_in + j)+1] = 15 - sh;
61 ((int16_t*)
s->native_simd_matrix)[2*(
i * nb_in + j)] =
62 ((((
int*)
s->native_matrix)[
i * nb_in + j]) + (1<<sh>>1)) >> sh;
65 ((int16_t*)
s->native_simd_one)[1] = 14;
66 ((int16_t*)
s->native_simd_one)[0] = 16384;
69 s->mix_1_1_simd = ff_mix_1_1_a_float_sse;
70 s->mix_2_1_simd = ff_mix_2_1_a_float_sse;
73 s->mix_1_1_simd = ff_mix_1_1_a_float_avx;
74 s->mix_2_1_simd = ff_mix_2_1_a_float_avx;
76 s->native_simd_matrix =
av_calloc(num,
sizeof(
float));
78 if (!
s->native_simd_matrix || !
s->native_simd_one)
80 memcpy(
s->native_simd_matrix,
s->native_matrix, num *
sizeof(
float));
81 memcpy(
s->native_simd_one,
s->native_one,
sizeof(
float));
@ AV_SAMPLE_FMT_FLTP
float, planar
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
int swri_rematrix_init_x86(struct SwrContext *s)
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
#define EXTERNAL_SSE(flags)
#define EXTERNAL_AVX_FAST(flags)
The libswresample context.
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
#define EXTERNAL_SSE2(flags)
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
#define i(width, name, range_min, range_max)
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
void * av_calloc(size_t nmemb, size_t size)
static int sse(MpegEncContext *s, const uint8_t *src1, const uint8_t *src2, int w, int h, int stride)