Go to the documentation of this file.
30 #define SCALE_NOOP(x) (x)
31 #define SCALE_INT20(x) (av_clip64(lrintf((x) * 2147483648.0), INT32_MIN, INT32_MAX) >> 12)
33 #define randomize_complex(BUF, LEN, TYPE, SCALE) \
35 TYPE *buf = (TYPE *)BUF; \
36 for (int i = 0; i < LEN; i++) { \
37 double fre = (double)rnd() / UINT_MAX; \
38 double fim = (double)rnd() / UINT_MAX; \
39 buf[i] = (TYPE){ SCALE(fre), SCALE(fim) }; \
44 2, 4, 8, 16, 32, 64, 120, 960, 1024, 1920, 16384,
58 #define CHECK_TEMPLATE(PREFIX, TYPE, DIR, DATA_TYPE, SCALE_TYPE, LENGTHS, CHECK_EXPRESSION) \
66 for (int i = 0; i < FF_ARRAY_ELEMS(LENGTHS); i++) { \
67 int len = LENGTHS[i]; \
68 const SCALE_TYPE scale = 1.0 / len; \
70 if ((err = av_tx_init(&tx, &fn, TYPE, DIR, len, &scale, 0x0)) < 0) { \
71 fprintf(stderr, "av_tx: %s\n", av_err2str(err)); \
75 if (check_func(fn, PREFIX "_%i", len)) { \
76 AVTXContext *tx_ref = tx_refs[TYPE][DIR][i]; \
81 call_ref(tx_ref, out_ref, in, sizeof(DATA_TYPE)); \
82 call_new(tx, out_new, in, sizeof(DATA_TYPE)); \
83 if (CHECK_EXPRESSION) { \
88 bench_new(tx, out_new, in, sizeof(DATA_TYPE)); \
89 av_tx_uninit(&tx_refs[TYPE][DIR][i]); \
90 tx_refs[TYPE][DIR][i] = tx; \
96 if (num_checks == 1) \
97 report(PREFIX "_%i", last_check); \
98 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,...)