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, 120, 960, 1024, 1920, 16384,
57 #define CHECK_TEMPLATE(PREFIX, TYPE, DIR, DATA_TYPE, SCALE_TYPE, LENGTHS, CHECK_EXPRESSION) \
65 for (int i = 0; i < FF_ARRAY_ELEMS(LENGTHS); i++) { \
66 int len = LENGTHS[i]; \
67 const SCALE_TYPE scale = 1.0 / len; \
69 if ((err = av_tx_init(&tx, &fn, TYPE, DIR, len, &scale, 0x0)) < 0) { \
70 fprintf(stderr, "av_tx: %s\n", av_err2str(err)); \
74 if (check_func(fn, PREFIX "_%i", len)) { \
75 AVTXContext *tx_ref = tx_refs[TYPE][DIR][i]; \
80 call_ref(tx_ref, out_ref, in, sizeof(DATA_TYPE)); \
81 call_new(tx, out_new, in, sizeof(DATA_TYPE)); \
82 if (CHECK_EXPRESSION) { \
87 bench_new(tx, out_new, in, sizeof(DATA_TYPE)); \
88 av_tx_uninit(&tx_refs[TYPE][DIR][i]); \
89 tx_refs[TYPE][DIR][i] = tx; \
95 if (num_checks == 1) \
96 report(PREFIX "_%i", last_check); \
97 else if (num_checks) \
static AVTXContext * tx_refs[AV_TX_NB][2][FF_ARRAY_ELEMS(check_lens)]
int float_near_abs_eps_array(const float *a, const float *b, float eps, unsigned len)
static void free_tx_refs(void)
#define FF_ARRAY_ELEMS(a)
@ AV_TX_FLOAT_MDCT
Standard MDCT with a sample data type of float, double or int32_t, respecively.
@ AV_TX_FLOAT_FFT
Standard complex to complex FFT with sample data type of AVComplexFloat, AVComplexDouble or AVComplex...
int double_near_abs_eps_array(const double *a, const double *b, double eps, unsigned len)
#define CHECK_TEMPLATE(PREFIX, TYPE, DIR, DATA_TYPE, SCALE_TYPE, LENGTHS, CHECK_EXPRESSION)
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)
void checkasm_check_av_tx(void)
#define randomize_complex(BUF, LEN, TYPE, SCALE)
#define declare_func(ret,...)