Libav
Data Structures | Macros | Functions | Variables
checkasm.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "checkasm.h"
#include "libavutil/common.h"
#include "libavutil/cpu.h"
#include "libavutil/intfloat.h"
#include "libavutil/random_seed.h"

Go to the source code of this file.

Data Structures

struct  CheckasmFuncVersion
 
struct  CheckasmFunc
 

Macros

#define COLOR_RED   1
 
#define COLOR_GREEN   2
 
#define COLOR_YELLOW   3
 
#define isatty(fd)   1
 
#define is_red(f)   ((f) && !(f)->color)
 

Functions

static int is_negative (union av_intfloat32 u)
 
int float_near_ulp (float a, float b, unsigned max_ulp)
 
int float_near_ulp_array (const float *a, const float *b, unsigned max_ulp, unsigned len)
 
int float_near_abs_eps (float a, float b, float eps)
 
int float_near_abs_eps_array (const float *a, const float *b, float eps, unsigned len)
 
int float_near_abs_eps_ulp (float a, float b, float eps, unsigned max_ulp)
 
int float_near_abs_eps_array_ulp (const float *a, const float *b, float eps, unsigned max_ulp, unsigned len)
 
static void color_printf (int color, const char *fmt,...)
 
static void destroy_func_tree (CheckasmFunc *f)
 
static voidcheckasm_malloc (size_t size)
 
static const char * cpu_suffix (int cpu)
 
static int cmp_func_names (const char *a, const char *b)
 
static CheckasmFuncrotate_tree (CheckasmFunc *f, int dir)
 
static void balance_tree (CheckasmFunc **root)
 
static CheckasmFuncget_func (CheckasmFunc **root, const char *name)
 
static void check_cpu_flag (const char *name, int flag)
 
static void print_cpu_name (void)
 
int main (int argc, char *argv[])
 
voidcheckasm_check_func (void *func, const char *name,...)
 
int checkasm_bench_func (void)
 
void checkasm_fail_func (const char *msg,...)
 
void checkasm_update_bench (int iterations, uint64_t cycles)
 
void checkasm_report (const char *name,...)
 

Variables

struct {
   const char *   name
 
   void(*   func )(void)
 
tests []
 
struct {
   const char *   name
 
   const char *   suffix
 
   int   flag
 
cpus []
 
struct {
   CheckasmFunc *   funcs
 
   CheckasmFunc *   current_func
 
   CheckasmFuncVersion *   current_func_ver
 
   const char *   current_test_name
 
   const char *   bench_pattern
 
   int   bench_pattern_len
 
   int   num_checked
 
   int   num_failed
 
   int   nop_time
 
   int   cpu_flag
 
   const char *   cpu_flag_name
 
state
 
AVLFG checkasm_lfg
 

Macro Definition Documentation

◆ COLOR_RED

#define COLOR_RED   1

Definition at line 43 of file checkasm.c.

Referenced by checkasm_report().

◆ COLOR_GREEN

#define COLOR_GREEN   2

Definition at line 44 of file checkasm.c.

Referenced by checkasm_report().

◆ COLOR_YELLOW

#define COLOR_YELLOW   3

Definition at line 45 of file checkasm.c.

Referenced by print_cpu_name().

◆ isatty

#define isatty (   fd)    1

Definition at line 53 of file checkasm.c.

Referenced by av_log_default_callback(), check_color_terminal(), and color_printf().

◆ is_red

#define is_red (   f)    ((f) && !(f)->color)

Definition at line 406 of file checkasm.c.

Referenced by balance_tree().

Function Documentation

◆ is_negative()

static int is_negative ( union av_intfloat32  u)
static

Definition at line 179 of file checkasm.c.

Referenced by float_near_ulp().

◆ float_near_ulp()

int float_near_ulp ( float  a,
float  b,
unsigned  max_ulp 
)

Definition at line 184 of file checkasm.c.

Referenced by float_near_abs_eps_ulp(), and float_near_ulp_array().

◆ float_near_ulp_array()

int float_near_ulp_array ( const float *  a,
const float *  b,
unsigned  max_ulp,
unsigned  len 
)

Definition at line 202 of file checkasm.c.

Referenced by checkasm_check_fmtconvert().

◆ float_near_abs_eps()

int float_near_abs_eps ( float  a,
float  b,
float  eps 
)

Definition at line 214 of file checkasm.c.

Referenced by float_near_abs_eps_array(), and float_near_abs_eps_ulp().

◆ float_near_abs_eps_array()

int float_near_abs_eps_array ( const float *  a,
const float *  b,
float  eps,
unsigned  len 
)

Definition at line 221 of file checkasm.c.

◆ float_near_abs_eps_ulp()

int float_near_abs_eps_ulp ( float  a,
float  b,
float  eps,
unsigned  max_ulp 
)

Definition at line 233 of file checkasm.c.

Referenced by checkasm_check_synth_filter(), and float_near_abs_eps_array_ulp().

◆ float_near_abs_eps_array_ulp()

int float_near_abs_eps_array_ulp ( const float *  a,
const float *  b,
float  eps,
unsigned  max_ulp,
unsigned  len 
)

Definition at line 238 of file checkasm.c.

◆ color_printf()

static void color_printf ( int  color,
const char *  fmt,
  ... 
)
static

Definition at line 251 of file checkasm.c.

Referenced by checkasm_report(), and print_cpu_name().

◆ destroy_func_tree()

static void destroy_func_tree ( CheckasmFunc f)
static

Definition at line 294 of file checkasm.c.

Referenced by checkasm_malloc(), and main().

◆ checkasm_malloc()

static void* checkasm_malloc ( size_t  size)
static

Definition at line 311 of file checkasm.c.

Referenced by checkasm_check_func(), and get_func().

◆ cpu_suffix()

static const char* cpu_suffix ( int  cpu)
static

Definition at line 323 of file checkasm.c.

Referenced by checkasm_fail_func().

◆ cmp_func_names()

static int cmp_func_names ( const char *  a,
const char *  b 
)
static

Definition at line 381 of file checkasm.c.

Referenced by get_func().

◆ rotate_tree()

static CheckasmFunc* rotate_tree ( CheckasmFunc f,
int  dir 
)
static

Definition at line 396 of file checkasm.c.

Referenced by balance_tree().

◆ balance_tree()

static void balance_tree ( CheckasmFunc **  root)
static

Definition at line 409 of file checkasm.c.

Referenced by get_func().

◆ get_func()

static CheckasmFunc* get_func ( CheckasmFunc **  root,
const char *  name 
)
static

Definition at line 425 of file checkasm.c.

Referenced by checkasm_check_func().

◆ check_cpu_flag()

static void check_cpu_flag ( const char *  name,
int  flag 
)
static

Definition at line 450 of file checkasm.c.

Referenced by main().

◆ print_cpu_name()

static void print_cpu_name ( void  )
static

Definition at line 470 of file checkasm.c.

Referenced by checkasm_fail_func(), and checkasm_report().

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 478 of file checkasm.c.

◆ checkasm_check_func()

void* checkasm_check_func ( void func,
const char *  name,
  ... 
)

Definition at line 536 of file checkasm.c.

◆ checkasm_bench_func()

int checkasm_bench_func ( void  )

Definition at line 583 of file checkasm.c.

◆ checkasm_fail_func()

void checkasm_fail_func ( const char *  msg,
  ... 
)

Definition at line 590 of file checkasm.c.

◆ checkasm_update_bench()

void checkasm_update_bench ( int  iterations,
uint64_t  cycles 
)

Definition at line 608 of file checkasm.c.

◆ checkasm_report()

void checkasm_report ( const char *  name,
  ... 
)

Definition at line 615 of file checkasm.c.

Variable Documentation

◆ name

const char* name

Definition at line 64 of file checkasm.c.

Referenced by check_cpu_flag(), and main().

◆ func

void(* func) (void)

◆ tests

const { ... } tests[]

◆ suffix

const char* suffix

Definition at line 105 of file checkasm.c.

Referenced by ff_hevc_coeff_abs_level_remaining(), and hls_residual_coding().

◆ flag

int flag

Definition at line 106 of file checkasm.c.

Referenced by cpu_suffix(), and main().

◆ cpus

const { ... } cpus[]

Referenced by cpu_suffix(), and main().

◆ funcs

CheckasmFunc* funcs

Definition at line 162 of file checkasm.c.

◆ current_func

CheckasmFunc* current_func

Definition at line 163 of file checkasm.c.

◆ current_func_ver

CheckasmFuncVersion* current_func_ver

Definition at line 164 of file checkasm.c.

◆ current_test_name

const char* current_test_name

Definition at line 165 of file checkasm.c.

◆ bench_pattern

const char* bench_pattern

Definition at line 166 of file checkasm.c.

◆ bench_pattern_len

int bench_pattern_len

Definition at line 167 of file checkasm.c.

◆ num_checked

int num_checked

Definition at line 168 of file checkasm.c.

◆ num_failed

int num_failed

Definition at line 169 of file checkasm.c.

◆ nop_time

int nop_time

Definition at line 170 of file checkasm.c.

◆ cpu_flag

int cpu_flag

Definition at line 171 of file checkasm.c.

◆ cpu_flag_name

const char* cpu_flag_name

Definition at line 172 of file checkasm.c.

◆ state

struct { ... } state

Referenced by adx_parse(), amr_decode_fix_avctx(), av_lzo1x_decode(), bfi_read_packet(), bmp_parse(), cavs_find_frame_end(), check_cpu_flag(), checkasm_bench_func(), checkasm_check_func(), checkasm_fail_func(), checkasm_malloc(), checkasm_report(), checkasm_update_bench(), convert_samples(), cpu_suffix(), dca_find_frame_end(), decode_cabac_intra_mb_type(), decode_slice_header(), delta_decode(), dnxhd_find_frame_end(), dpx_parse(), dts_probe(), dv_probe(), dv_read_header(), dxv_decompress_dxt1(), dxv_decompress_dxt5(), encode_picture_ls(), encode_slice_header(), ff_dither_alloc(), ff_h263_find_frame_end(), ff_jpegls_decode_picture(), ff_mpeg1_find_frame_end(), ff_mpeg4_find_frame_end(), ff_mpeg4video_split(), ff_rtp_send_h263_rfc2190(), ff_samples_to_time_base(), ffv1_encode_frame(), find_any_startcode(), find_frame_end(), find_group3_syncmarker(), find_next_start_code(), get_cabac_inline(), get_rac(), h261_find_frame_end(), h264_find_frame_end(), h264_split(), hevc_split(), latm_find_frame_end(), libgsm_encode_frame(), libschroedinger_decode_frame(), libschroedinger_encode_frame(), main(), mlp_filter_channel(), mpegaudio_parse(), mpegts_write_packet_internal(), mpegvideo_split(), nc_read_packet(), opus_find_frame_end(), parse_nal_units(), parse_presentation_segment(), print_cpu_name(), put_rac(), read_extra_header(), read_header(), read_quant_table(), spdif_probe(), spdif_read_packet(), svc_decode_frame(), sync(), vc1_split(), write_extradata(), write_header(), and write_quant_table().

◆ checkasm_lfg

AVLFG checkasm_lfg

Definition at line 176 of file checkasm.c.