FFmpeg
Data Structures | Macros | Functions | Variables
checkasm.h File Reference
#include <stdint.h>
#include "config.h"
#include "libavutil/avstring.h"
#include "libavutil/cpu.h"
#include "libavutil/internal.h"
#include "libavutil/lfg.h"
#include "libavutil/timer.h"

Go to the source code of this file.

Data Structures

struct  CheckasmPerf
 

Macros

#define rnd()   av_lfg_get(&checkasm_lfg)
 
#define BENCH_RUNS   1000 /* Trade-off between accuracy and speed */
 
#define check_func(func, ...)   (func_ref = checkasm_check_func((func_new = func), __VA_ARGS__))
 
#define declare_func(ret, ...)   declare_new(ret, __VA_ARGS__) typedef ret func_type(__VA_ARGS__)
 
#define declare_func_float(ret, ...)   declare_new_float(ret, __VA_ARGS__) typedef ret func_type(__VA_ARGS__)
 
#define declare_func_emms(cpu_flags, ret, ...)   declare_new_emms(cpu_flags, ret, __VA_ARGS__) typedef ret func_type(__VA_ARGS__)
 
#define fail()   checkasm_fail_func("%s:%d", av_basename(__FILE__), __LINE__)
 
#define report   checkasm_report
 
#define call_ref(...)   ((func_type *)func_ref)(__VA_ARGS__)
 
#define declare_new(ret, ...)
 
#define declare_new_float(ret, ...)
 
#define declare_new_emms(cpu_flags, ret, ...)
 
#define call_new(...)   ((func_type *)func_new)(__VA_ARGS__)
 
#define bench_new(...)   while(0)
 
#define PERF_START(t)   while(0)
 
#define PERF_STOP(t)   while(0)
 

Functions

void checkasm_check_aacpsdsp (void)
 
void checkasm_check_afir (void)
 
void checkasm_check_alacdsp (void)
 
void checkasm_check_audiodsp (void)
 
void checkasm_check_blend (void)
 
void checkasm_check_blockdsp (void)
 
void checkasm_check_bswapdsp (void)
 
void checkasm_check_colorspace (void)
 
void checkasm_check_exrdsp (void)
 
void checkasm_check_fixed_dsp (void)
 
void checkasm_check_flacdsp (void)
 
void checkasm_check_float_dsp (void)
 
void checkasm_check_fmtconvert (void)
 
void checkasm_check_g722dsp (void)
 
void checkasm_check_h264dsp (void)
 
void checkasm_check_h264pred (void)
 
void checkasm_check_h264qpel (void)
 
void checkasm_check_hevc_add_res (void)
 
void checkasm_check_hevc_idct (void)
 
void checkasm_check_hevc_sao (void)
 
void checkasm_check_huffyuvdsp (void)
 
void checkasm_check_jpeg2000dsp (void)
 
void checkasm_check_llviddsp (void)
 
void checkasm_check_llviddspenc (void)
 
void checkasm_check_nlmeans (void)
 
void checkasm_check_pixblockdsp (void)
 
void checkasm_check_sbrdsp (void)
 
void checkasm_check_synth_filter (void)
 
void checkasm_check_sw_rgb (void)
 
void checkasm_check_utvideodsp (void)
 
void checkasm_check_v210dec (void)
 
void checkasm_check_v210enc (void)
 
void checkasm_check_vf_gblur (void)
 
void checkasm_check_vf_hflip (void)
 
void checkasm_check_vf_threshold (void)
 
void checkasm_check_vp8dsp (void)
 
void checkasm_check_vp9dsp (void)
 
void checkasm_check_videodsp (void)
 
void * checkasm_check_func (void *func, const char *name,...) av_printf_format(2
 
void int checkasm_bench_func (void)
 
void checkasm_fail_func (const char *msg,...) av_printf_format(1
 
void struct CheckasmPerfcheckasm_get_perf_context (void)
 
void checkasm_report (const char *name,...) av_printf_format(1
 
void int float_near_ulp (float a, float b, unsigned max_ulp)
 
int float_near_abs_eps (float a, float b, float eps)
 
int float_near_abs_eps_ulp (float a, float b, float eps, unsigned max_ulp)
 
int float_near_ulp_array (const float *a, const float *b, unsigned max_ulp, unsigned len)
 
int float_near_abs_eps_array (const float *a, const float *b, float eps, unsigned len)
 
int float_near_abs_eps_array_ulp (const float *a, const float *b, float eps, unsigned max_ulp, unsigned len)
 
int double_near_abs_eps (double a, double b, double eps)
 
int double_near_abs_eps_array (const double *a, const double *b, double eps, unsigned len)
 

Variables

AVLFG checkasm_lfg
 
static av_unused void * func_ref
 
static av_unused void * func_new
 

Macro Definition Documentation

◆ rnd

#define rnd ( )    av_lfg_get(&checkasm_lfg)

Definition at line 104 of file checkasm.h.

◆ BENCH_RUNS

#define BENCH_RUNS   1000 /* Trade-off between accuracy and speed */

Definition at line 108 of file checkasm.h.

◆ check_func

#define check_func (   func,
  ... 
)    (func_ref = checkasm_check_func((func_new = func), __VA_ARGS__))

Definition at line 111 of file checkasm.h.

◆ declare_func

#define declare_func (   ret,
  ... 
)    declare_new(ret, __VA_ARGS__) typedef ret func_type(__VA_ARGS__)

Definition at line 115 of file checkasm.h.

◆ declare_func_float

#define declare_func_float (   ret,
  ... 
)    declare_new_float(ret, __VA_ARGS__) typedef ret func_type(__VA_ARGS__)

Definition at line 116 of file checkasm.h.

◆ declare_func_emms

#define declare_func_emms (   cpu_flags,
  ret,
  ... 
)    declare_new_emms(cpu_flags, ret, __VA_ARGS__) typedef ret func_type(__VA_ARGS__)

Definition at line 117 of file checkasm.h.

◆ fail

#define fail ( )    checkasm_fail_func("%s:%d", av_basename(__FILE__), __LINE__)
Examples
filter_audio.c, hw_decode.c, qsvdec.c, and vaapi_transcode.c.

Definition at line 120 of file checkasm.h.

◆ report

#define report   checkasm_report

Definition at line 123 of file checkasm.h.

◆ call_ref

#define call_ref (   ...)    ((func_type *)func_ref)(__VA_ARGS__)

Definition at line 126 of file checkasm.h.

◆ declare_new

#define declare_new (   ret,
  ... 
)

Definition at line 189 of file checkasm.h.

◆ declare_new_float

#define declare_new_float (   ret,
  ... 
)

Definition at line 190 of file checkasm.h.

◆ declare_new_emms

#define declare_new_emms (   cpu_flags,
  ret,
  ... 
)

Definition at line 191 of file checkasm.h.

◆ call_new

#define call_new (   ...)    ((func_type *)func_new)(__VA_ARGS__)

Definition at line 193 of file checkasm.h.

◆ bench_new

#define bench_new (   ...)    while(0)

Definition at line 253 of file checkasm.h.

◆ PERF_START

#define PERF_START (   t)    while(0)

Definition at line 254 of file checkasm.h.

◆ PERF_STOP

#define PERF_STOP (   t)    while(0)

Definition at line 255 of file checkasm.h.

Function Documentation

◆ checkasm_check_aacpsdsp()

void checkasm_check_aacpsdsp ( void  )

Definition at line 215 of file aacpsdsp.c.

◆ checkasm_check_afir()

void checkasm_check_afir ( void  )

Definition at line 67 of file af_afir.c.

◆ checkasm_check_alacdsp()

void checkasm_check_alacdsp ( void  )

Definition at line 115 of file alacdsp.c.

◆ checkasm_check_audiodsp()

void checkasm_check_audiodsp ( void  )

Definition at line 51 of file audiodsp.c.

◆ checkasm_check_blend()

void checkasm_check_blend ( void  )

Definition at line 88 of file vf_blend.c.

◆ checkasm_check_blockdsp()

void checkasm_check_blockdsp ( void  )

Definition at line 54 of file blockdsp.c.

◆ checkasm_check_bswapdsp()

void checkasm_check_bswapdsp ( void  )

Definition at line 59 of file bswapdsp.c.

◆ checkasm_check_colorspace()

void checkasm_check_colorspace ( void  )

Definition at line 308 of file vf_colorspace.c.

◆ checkasm_check_exrdsp()

void checkasm_check_exrdsp ( void  )

Definition at line 76 of file exrdsp.c.

◆ checkasm_check_fixed_dsp()

void checkasm_check_fixed_dsp ( void  )

Definition at line 132 of file fixed_dsp.c.

◆ checkasm_check_flacdsp()

void checkasm_check_flacdsp ( void  )

Definition at line 56 of file flacdsp.c.

◆ checkasm_check_float_dsp()

void checkasm_check_float_dsp ( void  )

Definition at line 277 of file float_dsp.c.

◆ checkasm_check_fmtconvert()

void checkasm_check_fmtconvert ( void  )

Definition at line 44 of file fmtconvert.c.

◆ checkasm_check_g722dsp()

void checkasm_check_g722dsp ( void  )

Definition at line 53 of file g722dsp.c.

◆ checkasm_check_h264dsp()

void checkasm_check_h264dsp ( void  )

Definition at line 441 of file h264dsp.c.

◆ checkasm_check_h264pred()

void checkasm_check_h264pred ( void  )

Definition at line 232 of file h264pred.c.

◆ checkasm_check_h264qpel()

void checkasm_check_h264qpel ( void  )

Definition at line 50 of file h264qpel.c.

◆ checkasm_check_hevc_add_res()

void checkasm_check_hevc_add_res ( void  )

Definition at line 74 of file hevc_add_res.c.

◆ checkasm_check_hevc_idct()

void checkasm_check_hevc_idct ( void  )

Definition at line 86 of file hevc_idct.c.

◆ checkasm_check_hevc_sao()

void checkasm_check_hevc_sao ( void  )

Definition at line 131 of file hevc_sao.c.

◆ checkasm_check_huffyuvdsp()

void checkasm_check_huffyuvdsp ( void  )

test width not multiple of mmsize

test always with the same size (for perf test)

Definition at line 67 of file huffyuvdsp.c.

◆ checkasm_check_jpeg2000dsp()

void checkasm_check_jpeg2000dsp ( void  )

Definition at line 91 of file jpeg2000dsp.c.

◆ checkasm_check_llviddsp()

void checkasm_check_llviddsp ( void  )

Definition at line 195 of file llviddsp.c.

◆ checkasm_check_llviddspenc()

void checkasm_check_llviddspenc ( void  )

Definition at line 104 of file llviddspenc.c.

◆ checkasm_check_nlmeans()

void checkasm_check_nlmeans ( void  )

Definition at line 31 of file vf_nlmeans.c.

◆ checkasm_check_pixblockdsp()

void checkasm_check_pixblockdsp ( void  )

Definition at line 81 of file pixblockdsp.c.

◆ checkasm_check_sbrdsp()

void checkasm_check_sbrdsp ( void  )

Definition at line 250 of file sbrdsp.c.

◆ checkasm_check_synth_filter()

void checkasm_check_synth_filter ( void  )

Definition at line 44 of file synth_filter.c.

◆ checkasm_check_sw_rgb()

void checkasm_check_sw_rgb ( void  )

Definition at line 114 of file sw_rgb.c.

◆ checkasm_check_utvideodsp()

void checkasm_check_utvideodsp ( void  )

Definition at line 90 of file utvideodsp.c.

◆ checkasm_check_v210dec()

void checkasm_check_v210dec ( void  )

Definition at line 47 of file v210dec.c.

◆ checkasm_check_v210enc()

void checkasm_check_v210enc ( void  )

Definition at line 81 of file v210enc.c.

◆ checkasm_check_vf_gblur()

void checkasm_check_vf_gblur ( void  )

Definition at line 36 of file vf_gblur.c.

◆ checkasm_check_vf_hflip()

void checkasm_check_vf_hflip ( void  )

Definition at line 69 of file vf_hflip.c.

◆ checkasm_check_vf_threshold()

void checkasm_check_vf_threshold ( void  )

Definition at line 78 of file vf_threshold.c.

◆ checkasm_check_vp8dsp()

void checkasm_check_vp8dsp ( void  )

Definition at line 507 of file vp8dsp.c.

◆ checkasm_check_vp9dsp()

void checkasm_check_vp9dsp ( void  )

Definition at line 625 of file vp9dsp.c.

◆ checkasm_check_videodsp()

void checkasm_check_videodsp ( void  )

Definition at line 80 of file videodsp.c.

◆ checkasm_check_func()

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

◆ checkasm_bench_func()

void int checkasm_bench_func ( void  )

Definition at line 763 of file checkasm.c.

◆ checkasm_fail_func()

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

◆ checkasm_get_perf_context()

void struct CheckasmPerf* checkasm_get_perf_context ( void  )

Definition at line 788 of file checkasm.c.

◆ checkasm_report()

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

◆ float_near_ulp()

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

Definition at line 276 of file checkasm.c.

Referenced by float_near_abs_eps_ulp(), and float_near_ulp_array().

◆ float_near_abs_eps()

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

◆ float_near_abs_eps_ulp()

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

Definition at line 329 of file checkasm.c.

Referenced by checkasm_check_synth_filter(), and float_near_abs_eps_array_ulp().

◆ float_near_ulp_array()

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

Definition at line 294 of file checkasm.c.

Referenced by checkasm_check_audiodsp(), and checkasm_check_fmtconvert().

◆ float_near_abs_eps_array()

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

◆ 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 334 of file checkasm.c.

◆ double_near_abs_eps()

int double_near_abs_eps ( double  a,
double  b,
double  eps 
)

◆ double_near_abs_eps_array()

int double_near_abs_eps_array ( const double *  a,
const double *  b,
double  eps,
unsigned  len 
)

Definition at line 353 of file checkasm.c.

Variable Documentation

◆ checkasm_lfg

AVLFG checkasm_lfg

Definition at line 268 of file checkasm.c.

Referenced by main().

◆ func_ref

av_unused void* func_ref
static

Definition at line 106 of file checkasm.h.

◆ func_new

av_unused void * func_new
static

Definition at line 106 of file checkasm.h.