36 double bmg[2], stddev = 10.0, mean = 0.0;
38 for (i = 0; i <
len; i += 2) {
40 a[i] = bmg[0] * stddev + mean;
41 a[i + 1] = bmg[1] * stddev + mean;
48 for (i = 0; i <
len; i++) {
49 if (fabsf(a[i] - b[i]) > max_diff) {
51 i, a[i], b[i], a[i] - b[i]);
61 double bmg[2], stddev = 10.0, mean = 0.0;
63 for (i = 0; i <
len; i += 2) {
65 a[i] = bmg[0] * stddev + mean;
66 a[i + 1] = bmg[1] * stddev + mean;
75 for (i = 0; i <
len; i++) {
76 if (fabs(a[i] - b[i]) > max_diff) {
78 i, a[i], b[i], a[i] - b[i]);
86 const float *v1,
const float *v2)
101 #define ARBITRARY_FMAC_SCALAR_CONST 0.005 103 const float *v1,
const float *
src0,
float scale)
109 memcpy(cdst, v1,
LEN *
sizeof(*v1));
110 memcpy(odst, v1,
LEN *
sizeof(*v1));
122 const float *v1,
float scale)
138 const double *v1,
double scale)
153 #define ARBITRARY_FMUL_WINDOW_CONST 0.008 155 const float *v1,
const float *v2,
const float *v3)
170 #define ARBITRARY_FMUL_ADD_CONST 0.005 172 const float *v1,
const float *v2,
const float *v3)
188 const float *v1,
const float *v2)
204 const float *v1,
const float *v2)
212 memcpy(cv1, v1,
LEN *
sizeof(*v1));
213 memcpy(cv2, v2,
LEN *
sizeof(*v2));
214 memcpy(ov1, v1,
LEN *
sizeof(*v1));
215 memcpy(ov2, v2,
LEN *
sizeof(*v2));
227 #define ARBITRARY_SCALARPRODUCT_CONST 0.2 229 const float *v1,
const float *v2)
243 int main(
int argc,
char **argv)
256 if (argc > 2 && !strcmp(argv[1],
"-s"))
257 seed = strtoul(argv[2],
NULL, 10);
float(* scalarproduct_float)(const float *v1, const float *v2, int len)
Calculate the scalar product of two vectors of floats.
#define ARBITRARY_FMUL_WINDOW_CONST
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
void av_set_cpu_flags_mask(int mask)
Set a mask on flags returned by av_get_cpu_flags().
static int test_scalarproduct_float(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp, const float *v1, const float *v2)
int main(int argc, char **argv)
static int test_vector_fmul(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp, const float *v1, const float *v2)
static int test_vector_fmac_scalar(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp, const float *v1, const float *src0, float scale)
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.
void(* vector_fmul)(float *dst, const float *src0, const float *src1, int len)
Calculate the product of two vectors of floats and store the result in a vector of floats...
static int test_vector_fmul_scalar(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp, const float *v1, float scale)
#define ARBITRARY_SCALARPRODUCT_CONST
void av_bmg_get(AVLFG *lfg, double out[2])
Get the next two numbers generated by a Box-Muller Gaussian generator using the random numbers issued...
void(* vector_fmul_window)(float *dst, const float *src0, const float *src1, const float *win, int len)
Overlap/add with window function.
void(* vector_dmul_scalar)(double *dst, const double *src, double mul, int len)
Multiply a vector of double by a scalar double.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
common internal API header
static int test_vector_dmul_scalar(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp, const double *v1, double scale)
static int test_vector_fmul_reverse(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp, const float *v1, const float *v2)
static int compare_floats(const float *a, const float *b, int len, float max_diff)
static int compare_doubles(const double *a, const double *b, int len, double max_diff)
#define AV_LOG_INFO
Standard information.
static void fill_double_array(AVLFG *lfg, double *a, int len)
void(* vector_fmul_scalar)(float *dst, const float *src, float mul, int len)
Multiply a vector of floats by a scalar float.
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
static int test_vector_fmul_window(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp, const float *v1, const float *v2, const float *v3)
static int test_vector_fmul_add(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp, const float *v1, const float *v2, const float *v3)
av_cold void avpriv_float_dsp_init(AVFloatDSPContext *fdsp, int bit_exact)
Initialize a float DSP context.
#define ARBITRARY_FMUL_ADD_CONST
#define LOCAL_ALIGNED(a, t, v,...)
void(* vector_fmul_add)(float *dst, const float *src0, const float *src1, const float *src2, int len)
Calculate the product of two vectors of floats, add a third vector of floats and store the result in ...
#define ARBITRARY_FMAC_SCALAR_CONST
void(* butterflies_float)(float *restrict v1, float *restrict v2, int len)
Calculate the sum and difference of two vectors of floats.
uint32_t av_get_random_seed(void)
Get random data.
static void fill_float_array(AVLFG *lfg, float *a, int len)
static int test_butterflies_float(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp, const float *v1, const float *v2)
void(* vector_fmul_reverse)(float *dst, const float *src0, const float *src1, int len)
Calculate the product of two vectors of floats, and store the result in a vector of floats...