FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 "config.h"
20 
21 #include "libavutil/attributes.h"
22 #include "libavutil/cpu.h"
23 #include "libavutil/float_dsp.h"
24 #include "cpu.h"
25 #include "asm.h"
26 
27 void ff_vector_fmul_sse(float *dst, const float *src0, const float *src1,
28  int len);
29 void ff_vector_fmul_avx(float *dst, const float *src0, const float *src1,
30  int len);
31 
32 void ff_vector_dmul_sse2(double *dst, const double *src0, const double *src1,
33  int len);
34 void ff_vector_dmul_avx(double *dst, const double *src0, const double *src1,
35  int len);
36 
37 void ff_vector_fmac_scalar_sse(float *dst, const float *src, float mul,
38  int len);
39 void ff_vector_fmac_scalar_avx(float *dst, const float *src, float mul,
40  int len);
41 void ff_vector_fmac_scalar_fma3(float *dst, const float *src, float mul,
42  int len);
43 
44 void ff_vector_fmul_scalar_sse(float *dst, const float *src, float mul,
45  int len);
46 
47 void ff_vector_dmac_scalar_sse2(double *dst, const double *src, double mul,
48  int len);
49 void ff_vector_dmac_scalar_avx(double *dst, const double *src, double mul,
50  int len);
51 void ff_vector_dmac_scalar_fma3(double *dst, const double *src, double mul,
52  int len);
53 
54 void ff_vector_dmul_scalar_sse2(double *dst, const double *src,
55  double mul, int len);
56 void ff_vector_dmul_scalar_avx(double *dst, const double *src,
57  double mul, int len);
58 
59 void ff_vector_fmul_window_3dnowext(float *dst, const float *src0,
60  const float *src1, const float *win, int len);
61 void ff_vector_fmul_window_sse(float *dst, const float *src0,
62  const float *src1, const float *win, int len);
63 
64 void ff_vector_fmul_add_sse(float *dst, const float *src0, const float *src1,
65  const float *src2, int len);
66 void ff_vector_fmul_add_avx(float *dst, const float *src0, const float *src1,
67  const float *src2, int len);
68 void ff_vector_fmul_add_fma3(float *dst, const float *src0, const float *src1,
69  const float *src2, int len);
70 
71 void ff_vector_fmul_reverse_sse(float *dst, const float *src0,
72  const float *src1, int len);
73 void ff_vector_fmul_reverse_avx(float *dst, const float *src0,
74  const float *src1, int len);
75 void ff_vector_fmul_reverse_avx2(float *dst, const float *src0,
76  const float *src1, int len);
77 
78 float ff_scalarproduct_float_sse(const float *v1, const float *v2, int order);
79 
80 void ff_butterflies_float_sse(float *av_restrict src0, float *av_restrict src1, int len);
81 
83 {
85 
86  if (EXTERNAL_AMD3DNOWEXT(cpu_flags)) {
88  }
89  if (EXTERNAL_SSE(cpu_flags)) {
98  }
99  if (EXTERNAL_SSE2(cpu_flags)) {
103  }
104  if (EXTERNAL_AVX_FAST(cpu_flags)) {
112  }
113  if (EXTERNAL_AVX2_FAST(cpu_flags)) {
115  }
116  if (EXTERNAL_FMA3_FAST(cpu_flags)) {
120  }
121 }
void ff_vector_fmul_reverse_avx2(float *dst, const float *src0, const float *src1, int len)
static float win(SuperEqualizerContext *s, float n, int N)
float(* scalarproduct_float)(const float *v1, const float *v2, int len)
Calculate the scalar product of two vectors of floats.
Definition: float_dsp.h:175
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:154
static atomic_int cpu_flags
Definition: cpu.c:50
#define EXTERNAL_SSE(flags)
Definition: cpu.h:58
#define src
Definition: vp8dsp.c:254
Macro definitions for various function/variable attributes.
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:54
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:119
void ff_vector_fmul_window_sse(float *dst, const float *src0, const float *src1, const float *win, int len)
#define av_cold
Definition: attributes.h:82
void ff_vector_fmul_reverse_avx(float *dst, const float *src0, const float *src1, int len)
av_cold void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp)
void ff_vector_fmul_window_3dnowext(float *dst, const float *src0, const float *src1, const float *win, int len)
float ff_scalarproduct_float_sse(const float *v1, const float *v2, int order)
#define EXTERNAL_AVX_FAST(flags)
Definition: cpu.h:71
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:70
#define EXTERNAL_SSE2(flags)
Definition: cpu.h:59
#define EXTERNAL_AVX2_FAST(flags)
Definition: cpu.h:79
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:38
void(* butterflies_float)(float *av_restrict v1, float *av_restrict v2, int len)
Calculate the sum and difference of two vectors of floats.
Definition: float_dsp.h:164
void ff_vector_fmul_add_avx(float *dst, const float *src0, const float *src1, const float *src2, int len)
void ff_vector_dmul_avx(double *dst, const double *src0, const double *src1, int len)
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:100
#define EXTERNAL_AMD3DNOWEXT(flags)
Definition: cpu.h:55
void ff_vector_dmul_sse2(double *dst, const double *src0, const double *src1, int len)
void ff_vector_dmac_scalar_avx(double *dst, const double *src, double mul, int len)
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:85
void ff_vector_fmac_scalar_avx(float *dst, const float *src, float mul, int len)
void ff_vector_dmac_scalar_fma3(double *dst, const double *src, double mul, int len)
void ff_vector_dmul_scalar_sse2(double *dst, const double *src, double mul, int len)
#define src1
Definition: h264pred.c:139
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:137
void ff_vector_dmul_scalar_avx(double *dst, const double *src, double mul, int len)
#define src0
Definition: h264pred.c:138
#define EXTERNAL_FMA3_FAST(flags)
Definition: cpu.h:75
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition: cpu.c:93
void ff_vector_fmul_sse(float *dst, const float *src0, const float *src1, int len)
void ff_vector_fmac_scalar_sse(float *dst, const float *src, float mul, int len)
void ff_butterflies_float_sse(float *av_restrict src0, float *av_restrict src1, int len)
void ff_vector_fmul_scalar_sse(float *dst, const float *src, float mul, int len)
void ff_vector_fmul_reverse_sse(float *dst, const float *src0, const float *src1, int len)
void ff_vector_fmul_add_sse(float *dst, const float *src0, const float *src1, const float *src2, int len)
int len
void ff_vector_fmac_scalar_fma3(float *dst, const float *src, float mul, int len)
void ff_vector_fmul_avx(float *dst, const float *src0, const float *src1, int len)
void ff_vector_fmul_add_fma3(float *dst, const float *src0, const float *src1, const float *src2, int len)
void ff_vector_dmac_scalar_sse2(double *dst, const double *src, double mul, int len)
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:190