FFmpeg
float_dsp_init.c
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * FFmpeg is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * FFmpeg is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with FFmpeg; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #include "libavutil/attributes.h"
20 #include "libavutil/cpu.h"
21 #include "libavutil/float_dsp.h"
22 #include "cpu.h"
23 
24 void ff_vector_fmul_sse(float *dst, const float *src0, const float *src1,
25  int len);
26 void ff_vector_fmul_avx(float *dst, const float *src0, const float *src1,
27  int len);
28 
29 void ff_vector_dmul_sse2(double *dst, const double *src0, const double *src1,
30  int len);
31 void ff_vector_dmul_avx(double *dst, const double *src0, const double *src1,
32  int len);
33 
34 void ff_vector_fmac_scalar_sse(float *dst, const float *src, float mul,
35  int len);
36 void ff_vector_fmac_scalar_avx(float *dst, const float *src, float mul,
37  int len);
38 void ff_vector_fmac_scalar_fma3(float *dst, const float *src, float mul,
39  int len);
40 
41 void ff_vector_fmul_scalar_sse(float *dst, const float *src, float mul,
42  int len);
43 
44 void ff_vector_dmac_scalar_sse2(double *dst, const double *src, double mul,
45  int len);
46 void ff_vector_dmac_scalar_avx(double *dst, const double *src, double mul,
47  int len);
48 void ff_vector_dmac_scalar_fma3(double *dst, const double *src, double mul,
49  int len);
50 
51 void ff_vector_dmul_scalar_sse2(double *dst, const double *src,
52  double mul, int len);
53 void ff_vector_dmul_scalar_avx(double *dst, const double *src,
54  double mul, int len);
55 
56 void ff_vector_fmul_window_sse(float *dst, const float *src0,
57  const float *src1, const float *win, int len);
58 
59 void ff_vector_fmul_add_sse(float *dst, const float *src0, const float *src1,
60  const float *src2, int len);
61 void ff_vector_fmul_add_avx(float *dst, const float *src0, const float *src1,
62  const float *src2, int len);
63 void ff_vector_fmul_add_fma3(float *dst, const float *src0, const float *src1,
64  const float *src2, int len);
65 
66 void ff_vector_fmul_reverse_sse(float *dst, const float *src0,
67  const float *src1, int len);
68 void ff_vector_fmul_reverse_avx(float *dst, const float *src0,
69  const float *src1, int len);
70 void ff_vector_fmul_reverse_avx2(float *dst, const float *src0,
71  const float *src1, int len);
72 
73 float ff_scalarproduct_float_sse(const float *v1, const float *v2, int order);
74 float ff_scalarproduct_float_fma3(const float *v1, const float *v2, int order);
75 
76 void ff_butterflies_float_sse(float *restrict src0, float *restrict src1, int len);
77 
79 {
81 
82  if (EXTERNAL_SSE(cpu_flags)) {
91  }
92  if (EXTERNAL_SSE2(cpu_flags)) {
96  }
105  }
108  }
114  }
115 }
ff_vector_dmul_avx
void ff_vector_dmul_avx(double *dst, const double *src0, const double *src1, int len)
ff_vector_fmul_window_sse
void ff_vector_fmul_window_sse(float *dst, const float *src0, const float *src1, const float *win, int len)
AVFloatDSPContext::butterflies_float
void(* butterflies_float)(float *restrict v1, float *restrict v2, int len)
Calculate the sum and difference of two vectors of floats.
Definition: float_dsp.h:162
src1
const pixel * src1
Definition: h264pred_template.c:421
AVFloatDSPContext::vector_fmul_reverse
void(* vector_fmul_reverse)(float *dst, const float *src0, const float *src1, int len)
Calculate the entry wise product of two vectors of floats, and store the result in a vector of floats...
Definition: float_dsp.h:152
ff_float_dsp_init_x86
av_cold void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp)
Definition: float_dsp_init.c:78
EXTERNAL_AVX2_FAST
#define EXTERNAL_AVX2_FAST(flags)
Definition: cpu.h:79
ff_vector_fmac_scalar_avx
void ff_vector_fmac_scalar_avx(float *dst, const float *src, float mul, int len)
AVFloatDSPContext::vector_dmul
void(* vector_dmul)(double *dst, const double *src0, const double *src1, int len)
Calculate the entry wise product of two vectors of doubles and store the result in a vector of double...
Definition: float_dsp.h:188
av_get_cpu_flags
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition: cpu.c:103
ff_vector_fmul_add_fma3
void ff_vector_fmul_add_fma3(float *dst, const float *src0, const float *src1, const float *src2, int len)
cpu_flags
static atomic_int cpu_flags
Definition: cpu.c:52
ff_vector_dmac_scalar_sse2
void ff_vector_dmac_scalar_sse2(double *dst, const double *src, double mul, int len)
win
static float win(SuperEqualizerContext *s, float n, int N)
Definition: af_superequalizer.c:119
ff_vector_fmul_reverse_avx2
void ff_vector_fmul_reverse_avx2(float *dst, const float *src0, const float *src1, int len)
ff_vector_fmul_add_avx
void ff_vector_fmul_add_avx(float *dst, const float *src0, const float *src1, const float *src2, int len)
ff_vector_fmul_sse
void ff_vector_fmul_sse(float *dst, const float *src0, const float *src1, int len)
av_cold
#define av_cold
Definition: attributes.h:90
AVFloatDSPContext::scalarproduct_float
float(* scalarproduct_float)(const float *v1, const float *v2, int len)
Calculate the scalar product of two vectors of floats.
Definition: float_dsp.h:173
ff_butterflies_float_sse
void ff_butterflies_float_sse(float *restrict src0, float *restrict src1, int len)
EXTERNAL_SSE
#define EXTERNAL_SSE(flags)
Definition: cpu.h:58
ff_vector_fmul_reverse_sse
void ff_vector_fmul_reverse_sse(float *dst, const float *src0, const float *src1, int len)
EXTERNAL_AVX_FAST
#define EXTERNAL_AVX_FAST(flags)
Definition: cpu.h:71
ff_vector_fmul_add_sse
void ff_vector_fmul_add_sse(float *dst, const float *src0, const float *src1, const float *src2, int len)
ff_scalarproduct_float_sse
float ff_scalarproduct_float_sse(const float *v1, const float *v2, int order)
AVFloatDSPContext::vector_fmul_scalar
void(* vector_fmul_scalar)(float *dst, const float *src, float mul, int len)
Multiply a vector of floats by a scalar float.
Definition: float_dsp.h:83
ff_vector_fmac_scalar_fma3
void ff_vector_fmac_scalar_fma3(float *dst, const float *src, float mul, int len)
float_dsp.h
ff_vector_fmul_avx
void ff_vector_fmul_avx(float *dst, const float *src0, const float *src1, int len)
AVFloatDSPContext::vector_fmul
void(* vector_fmul)(float *dst, const float *src0, const float *src1, int len)
Calculate the entry wise product of two vectors of floats and store the result in a vector of floats.
Definition: float_dsp.h:36
cpu.h
ff_vector_fmac_scalar_sse
void ff_vector_fmac_scalar_sse(float *dst, const float *src, float mul, int len)
AVFloatDSPContext
Definition: float_dsp.h:22
attributes.h
EXTERNAL_SSE2
#define EXTERNAL_SSE2(flags)
Definition: cpu.h:59
EXTERNAL_FMA3_FAST
#define EXTERNAL_FMA3_FAST(flags)
Definition: cpu.h:75
AVFloatDSPContext::vector_fmac_scalar
void(* vector_fmac_scalar)(float *dst, const float *src, float mul, int len)
Multiply a vector of floats by a scalar float and add to destination vector.
Definition: float_dsp.h:52
src2
const pixel * src2
Definition: h264pred_template.c:422
AVFloatDSPContext::vector_fmul_add
void(* vector_fmul_add)(float *dst, const float *src0, const float *src1, const float *src2, int len)
Calculate the entry wise product of two vectors of floats, add a third vector of floats and store the...
Definition: float_dsp.h:135
len
int len
Definition: vorbis_enc_data.h:426
ff_vector_dmul_scalar_avx
void ff_vector_dmul_scalar_avx(double *dst, const double *src, double mul, int len)
ff_vector_fmul_scalar_sse
void ff_vector_fmul_scalar_sse(float *dst, const float *src, float mul, int len)
AVFloatDSPContext::vector_dmul_scalar
void(* vector_dmul_scalar)(double *dst, const double *src, double mul, int len)
Multiply a vector of double by a scalar double.
Definition: float_dsp.h:98
ff_vector_dmul_scalar_sse2
void ff_vector_dmul_scalar_sse2(double *dst, const double *src, double mul, int len)
ff_vector_fmul_reverse_avx
void ff_vector_fmul_reverse_avx(float *dst, const float *src0, const float *src1, int len)
src0
const pixel *const src0
Definition: h264pred_template.c:420
AVFloatDSPContext::vector_fmul_window
void(* vector_fmul_window)(float *dst, const float *src0, const float *src1, const float *win, int len)
Overlap/add with window function.
Definition: float_dsp.h:117
src
INIT_CLIP pixel * src
Definition: h264pred_template.c:418
ff_vector_dmul_sse2
void ff_vector_dmul_sse2(double *dst, const double *src0, const double *src1, int len)
ff_vector_dmac_scalar_avx
void ff_vector_dmac_scalar_avx(double *dst, const double *src, double mul, int len)
AVFloatDSPContext::vector_dmac_scalar
void(* vector_dmac_scalar)(double *dst, const double *src, double mul, int len)
Multiply a vector of doubles by a scalar double and add to destination vector.
Definition: float_dsp.h:68
ff_scalarproduct_float_fma3
float ff_scalarproduct_float_fma3(const float *v1, const float *v2, int order)
ff_vector_dmac_scalar_fma3
void ff_vector_dmac_scalar_fma3(double *dst, const double *src, double mul, int len)