|
FFmpeg
|
#include <assert.h>#include <inttypes.h>#include <limits.h>#include <math.h>#include <stdarg.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>#include "checkasm_config.h"#include "checkasm/test.h"#include "checkasm/utils.h"#include "internal.h"Go to the source code of this file.
Data Structures | |
| union | intfloat |
Macros | |
| #define | RANDOMIZE_DIST(buf, ftype, width, mean, stddev) |
| #define | DEF_CHECKASM_INIT_MASK(BITS, PIXEL) |
| #define | PRINT_LINE(buf1, buf2, xstart, xend, xpad, fmt, fmtw) |
| #define | PRINT_RECT(type, buf1, buf2, ystart, yend, xstart, xend, fmt, fmtw) |
| #define | CHECK_RECT(buf1, buf2, ystart, yend, xstart, xend, msg, compare, type, fmt, fmtw) |
| #define | DEF_CHECKASM_CHECK_BODY(compare, type, fmt, fmtw) |
| #define | cmp_int(a, b, len) (!memcmp(a, b, (len) * sizeof(*(a)))) |
| #define | DEF_CHECKASM_CHECK_FUNC(type, fmt, fmtw) |
| #define | cmp_float(a, b, len) float_near_ulp_array(a, b, max_ulp, len) |
Enumerations | |
| enum | { PAT_ZERO, PAT_ONE, PAT_RAND, PAT_LOW, PAT_HIGH, PAT_ALTLO, PAT_ALTHI, PAT_MIX } |
Functions | |
| NOINLINE void | checkasm_noop (void *ptr) |
| static ALWAYS_INLINE uint64_t | gettime_nsec (int is_seed) |
| uint64_t | checkasm_gettime_nsec (void) |
| uint64_t | checkasm_gettime_nsec_diff (uint64_t t) |
| unsigned | checkasm_seed (void) |
| void | checkasm_srand (unsigned seed) |
| uint32_t | checkasm_rand_uint32 (void) |
| Generate a random 32-bit unsigned integer. More... | |
| int32_t | checkasm_rand_int32 (void) |
| Generate a random 32-bit signed integer. More... | |
| int | checkasm_rand (void) |
| Generate a random non-negative integer. More... | |
| double | checkasm_randf (void) |
| Generate a random double-precision floating-point number. More... | |
| static double | marsaglia (double *z2) |
| double | checkasm_rand_norm (void) |
| Generate a random number from the standard normal distribution. More... | |
| double | checkasm_rand_dist (CheckasmDist dist) |
| Generate a normally distributed random number. More... | |
| void | checkasm_randomize (void *bufp, size_t bytes) |
| Fill a buffer with uniformly chosen random bytes. More... | |
| void | checkasm_randomize_mask8 (uint8_t *buf, int width, uint8_t mask) |
| Fill a uint8_t buffer with random values chosen uniformly within a mask. More... | |
| void | checkasm_randomize_mask16 (uint16_t *buf, int width, uint16_t mask) |
| Fill a uint16_t buffer with random values chosen uniformly within a mask. More... | |
| void | checkasm_randomize_range (double *buf, int width, double range) |
| Fill a double buffer with random values chosen uniformly below a limit. More... | |
| void | checkasm_randomize_rangef (float *buf, int width, float range) |
| Fill a float buffer with random values chosen uniformly below a limit. More... | |
| void | checkasm_randomize_dist (double *buf, int width, CheckasmDist dist) |
| Fill a double buffer with normally distributed random values. More... | |
| void | checkasm_randomize_distf (float *buf, int width, CheckasmDist dist) |
| Fill a float buffer with normally distributed random values. More... | |
| void | checkasm_randomize_norm (double *buf, int width) |
| Fill a double buffer with values from a standard normal distribution. More... | |
| void | checkasm_randomize_normf (float *buf, int width) |
| Fill a float buffer with values from a standard normal distribution. More... | |
| void | checkasm_clear (void *buf, size_t bytes) |
| Clear a buffer to a pre-determined pattern (currently 0xAA) More... | |
| void | checkasm_clear8 (uint8_t *buf, int width, uint8_t val) |
| Fill a uint8_t buffer with a constant value. More... | |
| void | checkasm_clear16 (uint16_t *buf, int width, uint16_t val) |
| Fill a uint16_t buffer with a constant value. More... | |
| static int | clz (const unsigned int mask) |
| static int | shift_rand (int x) |
| void | checkasm_init (void *buf, size_t bytes) |
| Initialize a buffer with pathological test patterns. More... | |
| void | checkasm_fprintf (FILE *const f, const int color, const char *const fmt,...) |
| static COLD int | should_use_color (FILE *const f) |
| COLD void | checkasm_setup_fprintf (void) |
| static int | get_terminal_width (void) |
| void | checkasm_json (CheckasmJson *json, const char *key, const char *const fmt,...) |
| void | checkasm_json_str (CheckasmJson *json, const char *key, const char *str) |
| void | checkasm_json_push (CheckasmJson *json, const char *const key, const char type) |
| void | checkasm_json_pop (CheckasmJson *json, char type) |
| static int | is_negative (const intfloat u) |
| int | checkasm_float_near_ulp (const float a, const float b, const unsigned max_ulp) |
| Compare floats using ULP (Units in Last Place) tolerance. More... | |
| int | checkasm_float_near_ulp_array (const float *const a, const float *const b, const unsigned max_ulp, const int len) |
| Compare float arrays using ULP tolerance. More... | |
| int | checkasm_float_near_abs_eps (const float a, const float b, const float eps) |
| Compare floats using absolute epsilon tolerance. More... | |
| int | checkasm_float_near_abs_eps_array (const float *const a, const float *const b, const float eps, const int len) |
| Compare float arrays using absolute epsilon tolerance. More... | |
| int | checkasm_float_near_abs_eps_ulp (const float a, const float b, const float eps, const unsigned max_ulp) |
| Compare floats using both epsilon and ULP tolerances. More... | |
| int | checkasm_float_near_abs_eps_array_ulp (const float *const a, const float *const b, const float eps, const unsigned max_ulp, const int len) |
| Compare float arrays using both epsilon and ULP tolerances. More... | |
| int | checkasm_double_near_abs_eps (const double a, const double b, const double eps) |
| Compare doubles using absolute epsilon tolerance. More... | |
| int | checkasm_double_near_abs_eps_array (const double *const a, const double *const b, const double eps, const unsigned len) |
| Compare double arrays using absolute epsilon tolerance. More... | |
| static int | check_err (const char *const file, const int line, const char *const name, const int w, const int h, int *const err) |
| int | checkasm_check_impl_float_ulp (const char *file, int line, const float *buf1, ptrdiff_t stride1, const float *buf2, ptrdiff_t stride2, int w, int h, const char *name, unsigned max_ulp, int align_w, int align_h, int padding) |
| Compare float buffers with ULP tolerance. More... | |
| char * | checkasm_vasprintf (const char *fmt, va_list arg) |
Variables | |
| static uint32_t | xs_state [4] |
| static int | use_printf_color [2] |
| #define PRINT_LINE | ( | buf1, | |
| buf2, | |||
| xstart, | |||
| xend, | |||
| xpad, | |||
| fmt, | |||
| fmtw | |||
| ) |
| #define PRINT_RECT | ( | type, | |
| buf1, | |||
| buf2, | |||
| ystart, | |||
| yend, | |||
| xstart, | |||
| xend, | |||
| fmt, | |||
| fmtw | |||
| ) |
| #define DEF_CHECKASM_CHECK_FUNC | ( | type, | |
| fmt, | |||
| fmtw | |||
| ) |
| anonymous enum |
| NOINLINE void checkasm_noop | ( | void * | ptr | ) |
Definition at line 63 of file utils.c.
Referenced by checkasm_measure_nop_cycles(), checkasm_measure_perf_scale(), and checkasm_perf_validate_start_stop().
|
static |
Definition at line 68 of file utils.c.
Referenced by checkasm_gettime_nsec(), checkasm_gettime_nsec_diff(), and checkasm_seed().
| uint64_t checkasm_gettime_nsec | ( | void | ) |
Definition at line 107 of file utils.c.
Referenced by checkasm_measure_perf_scale(), checkasm_perf_init(), checkasm_perf_validate_start(), and checkasm_perf_validate_start_stop().
| uint64_t checkasm_gettime_nsec_diff | ( | uint64_t | t | ) |
Definition at line 112 of file utils.c.
Referenced by checkasm_measure_perf_scale(), checkasm_perf_init(), checkasm_perf_validate_start(), and checkasm_perf_validate_start_stop().
| unsigned checkasm_seed | ( | void | ) |
Definition at line 117 of file utils.c.
Referenced by checkasm_run().
| void checkasm_srand | ( | unsigned | seed | ) |
Definition at line 127 of file utils.c.
Referenced by check_cpu_flag(), and checkasm_check_key().
Definition at line 171 of file utils.c.
Referenced by checkasm_rand_norm().
| double checkasm_rand_norm | ( | void | ) |
Generate a random number from the standard normal distribution.
Definition at line 185 of file utils.c.
Referenced by checkasm_rand_dist().
| double checkasm_rand_dist | ( | CheckasmDist | dist | ) |
|
inlinestatic |
Definition at line 302 of file utils.c.
Referenced by shift_rand().
| void checkasm_fprintf | ( | FILE *const | f, |
| const int | color, | ||
| const char *const | fmt, | ||
| ... | |||
| ) |
|
static |
Definition at line 382 of file utils.c.
Referenced by checkasm_setup_fprintf().
| COLD void checkasm_setup_fprintf | ( | void | ) |
Definition at line 404 of file utils.c.
Referenced by checkasm_list_cpu_flags(), and checkasm_run().
| void checkasm_json | ( | CheckasmJson * | json, |
| const char * | key, | ||
| const char *const | fmt, | ||
| ... | |||
| ) |
| void checkasm_json_str | ( | CheckasmJson * | json, |
| const char * | key, | ||
| const char * | str | ||
| ) |
Definition at line 444 of file utils.c.
Referenced by cpu_info_json(), json_var(), print_bench_header(), and print_bench_iter().
| void checkasm_json_push | ( | CheckasmJson * | json, |
| const char *const | key, | ||
| const char | type | ||
| ) |
Definition at line 469 of file utils.c.
Referenced by json_measurement(), json_var(), print_bench_header(), and print_bench_iter().
| void checkasm_json_pop | ( | CheckasmJson * | json, |
| char | type | ||
| ) |
Definition at line 485 of file utils.c.
Referenced by json_measurement(), json_var(), print_bench_footer(), print_bench_header(), and print_bench_iter().
|
static |
Definition at line 504 of file utils.c.
Referenced by checkasm_float_near_ulp().
|
static |
| char* checkasm_vasprintf | ( | const char * | fmt, |
| va_list | arg | ||
| ) |
Definition at line 711 of file utils.c.
Referenced by checkasm_set_func_variant().
|
static |
Definition at line 125 of file utils.c.
Referenced by checkasm_rand_uint32(), and checkasm_srand().
|
static |
Definition at line 363 of file utils.c.
Referenced by checkasm_fprintf(), and checkasm_setup_fprintf().
1.8.17