Go to the documentation of this file.
29 #define SCALE_NOOP(x) (x)
30 #define SCALE_INT20(x) (av_clip64(lrintf((x) * 2147483648.0), INT32_MIN, INT32_MAX) >> 12)
32 #define randomize_complex(BUF, LEN, TYPE, SCALE) \
34 TYPE *buf = (TYPE *)BUF; \
35 for (int i = 0; i < LEN; i++) { \
36 double fre = (double)rnd() / UINT_MAX; \
37 double fim = (double)rnd() / UINT_MAX; \
38 buf[i] = (TYPE){ SCALE(fre), SCALE(fim) }; \
43 2, 4, 8, 16, 32, 64, 1024, 16384,
56 #define CHECK_TEMPLATE(PREFIX, TYPE, DATA_TYPE, SCALE, LENGTHS, CHECK_EXPRESSION) \
63 const void *scale = &SCALE; \
65 for (int i = 0; i < FF_ARRAY_ELEMS(LENGTHS); i++) { \
66 int len = LENGTHS[i]; \
68 if ((err = av_tx_init(&tx, &fn, TYPE, 0, len, &scale, 0x0)) < 0) { \
69 fprintf(stderr, "av_tx: %s\n", av_err2str(err)); \
73 if (check_func(fn, PREFIX "_%i", len)) { \
74 AVTXContext *tx_ref = tx_refs[TYPE][i]; \
79 call_ref(tx_ref, out_ref, in, sizeof(DATA_TYPE)); \
80 call_new(tx, out_new, in, sizeof(DATA_TYPE)); \
81 if (CHECK_EXPRESSION) { \
86 bench_new(tx, out_new, in, sizeof(DATA_TYPE)); \
87 av_tx_uninit(&tx_refs[TYPE][i]); \
88 tx_refs[TYPE][i] = tx; \
94 if (num_checks == 1) \
95 report(PREFIX "_%i", last_check); \
96 else if (num_checks) \
102 const float scale_float = 1.0f;
static int scale_double(void *log, double d, double m, int *r)
int float_near_abs_eps_array(const float *a, const float *b, float eps, unsigned len)
#define CHECK_TEMPLATE(PREFIX, TYPE, DATA_TYPE, SCALE, LENGTHS, CHECK_EXPRESSION)
@ AV_TX_DOUBLE_FFT
Same as AV_TX_FLOAT_FFT with a data type of AVComplexDouble.
static void free_tx_refs(void)
#define FF_ARRAY_ELEMS(a)
@ AV_TX_FLOAT_FFT
Standard complex to complex FFT with sample data type AVComplexFloat.
int double_near_abs_eps_array(const double *a, const double *b, double eps, unsigned len)
static const int check_lens[]
av_cold void av_tx_uninit(AVTXContext **ctx)
Frees a context and sets ctx to NULL, does nothing when ctx == NULL.
#define i(width, name, range_min, range_max)
static AVTXContext * tx_refs[6][FF_ARRAY_ELEMS(check_lens)]
void checkasm_check_av_tx(void)
#define randomize_complex(BUF, LEN, TYPE, SCALE)
#define declare_func(ret,...)