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

Go to the source code of this file.

Data Structures

struct  CheckasmPerf
 

Macros

#define checkasm_save_context()   checkasm_handle_signal(sigsetjmp(checkasm_context_buf, 1))
 
#define checkasm_load_context(s)   siglongjmp(checkasm_context_buf, s)
 
#define rnd()   av_lfg_get(&checkasm_lfg)
 
#define check_func(func, ...)   (checkasm_save_context(), 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(...)
 
#define declare_new(ret, ...)
 
#define declare_new_float(ret, ...)
 
#define declare_new_emms(cpu_flags, ret, ...)
 
#define call_new(...)
 
#define bench_new(...)   while(0)
 
#define PERF_START(t)   while(0)
 
#define PERF_STOP(t)   while(0)
 
#define DECL_CHECKASM_CHECK_FUNC(type)
 
#define PASTE(a, b)   a ## b
 
#define CONCAT(a, b)   PASTE(a,b)
 
#define checkasm_check(prefix, ...)   CONCAT(checkasm_check_, prefix)(__FILE__, __LINE__, __VA_ARGS__)
 

Typedefs

typedef sigjmp_buf checkasm_context
 

Functions

void checkasm_check_aacencdsp (void)
 
void checkasm_check_aacpsdsp (void)
 
void checkasm_check_ac3dsp (void)
 
void checkasm_check_afir (void)
 
void checkasm_check_alacdsp (void)
 
void checkasm_check_audiodsp (void)
 
void checkasm_check_av_tx (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_fdctdsp (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_h263dsp (void)
 
void checkasm_check_h264chroma (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_deblock (void)
 
void checkasm_check_hevc_idct (void)
 
void checkasm_check_hevc_pel (void)
 
void checkasm_check_hevc_sao (void)
 
void checkasm_check_huffyuvdsp (void)
 
void checkasm_check_idctdsp (void)
 
void checkasm_check_jpeg2000dsp (void)
 
void checkasm_check_llauddsp (void)
 
void checkasm_check_lls (void)
 
void checkasm_check_llviddsp (void)
 
void checkasm_check_llviddspenc (void)
 
void checkasm_check_lpc (void)
 
void checkasm_check_motion (void)
 
void checkasm_check_mpegvideoencdsp (void)
 
void checkasm_check_nlmeans (void)
 
void checkasm_check_opusdsp (void)
 
void checkasm_check_pixblockdsp (void)
 
void checkasm_check_sbrdsp (void)
 
void checkasm_check_rv34dsp (void)
 
void checkasm_check_rv40dsp (void)
 
void checkasm_check_svq1enc (void)
 
void checkasm_check_synth_filter (void)
 
void checkasm_check_sw_gbrp (void)
 
void checkasm_check_sw_range_convert (void)
 
void checkasm_check_sw_rgb (void)
 
void checkasm_check_sw_scale (void)
 
void checkasm_check_sw_yuv2rgb (void)
 
void checkasm_check_sw_yuv2yuv (void)
 
void checkasm_check_takdsp (void)
 
void checkasm_check_utvideodsp (void)
 
void checkasm_check_v210dec (void)
 
void checkasm_check_v210enc (void)
 
void checkasm_check_vc1dsp (void)
 
void checkasm_check_vf_bwdif (void)
 
void checkasm_check_vf_eq (void)
 
void checkasm_check_vf_gblur (void)
 
void checkasm_check_vf_hflip (void)
 
void checkasm_check_vf_threshold (void)
 
void checkasm_check_vf_sobel (void)
 
void checkasm_check_vp8dsp (void)
 
void checkasm_check_vp9dsp (void)
 
void checkasm_check_videodsp (void)
 
void checkasm_check_vorbisdsp (void)
 
void checkasm_check_vvc_alf (void)
 
void checkasm_check_vvc_mc (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 void checkasm_set_signal_handler_state (int enabled)
 
int checkasm_handle_signal (int s)
 
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)
 
 DECL_CHECKASM_CHECK_FUNC (uint8_t)
 
 DECL_CHECKASM_CHECK_FUNC (uint16_t)
 
 DECL_CHECKASM_CHECK_FUNC (uint32_t)
 
 DECL_CHECKASM_CHECK_FUNC (int16_t)
 
 DECL_CHECKASM_CHECK_FUNC (int32_t)
 

Variables

checkasm_context checkasm_context_buf
 
AVLFG checkasm_lfg
 
static av_unused void * func_ref
 
static av_unused void * func_new
 
uint64_t bench_runs
 

Macro Definition Documentation

◆ checkasm_save_context

#define checkasm_save_context ( )    checkasm_handle_signal(sigsetjmp(checkasm_context_buf, 1))

Definition at line 72 of file checkasm.h.

◆ checkasm_load_context

#define checkasm_load_context (   s)    siglongjmp(checkasm_context_buf, s)

Definition at line 73 of file checkasm.h.

◆ rnd

#define rnd ( )    av_lfg_get(&checkasm_lfg)

Definition at line 172 of file checkasm.h.

◆ check_func

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

Definition at line 179 of file checkasm.h.

◆ declare_func

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

Definition at line 183 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 184 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 185 of file checkasm.h.

◆ fail

#define fail ( )    checkasm_fail_func("%s:%d", av_basename(__FILE__), __LINE__)

◆ report

#define report   checkasm_report

Definition at line 191 of file checkasm.h.

◆ call_ref

#define call_ref (   ...)
Value:
((func_type *)func_ref)(__VA_ARGS__));\
checkasm_set_signal_handler_state(0)

Definition at line 194 of file checkasm.h.

◆ declare_new

#define declare_new (   ret,
  ... 
)

Definition at line 293 of file checkasm.h.

◆ declare_new_float

#define declare_new_float (   ret,
  ... 
)

Definition at line 294 of file checkasm.h.

◆ declare_new_emms

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

Definition at line 295 of file checkasm.h.

◆ call_new

#define call_new (   ...)
Value:
((func_type *)func_new)(__VA_ARGS__));\
checkasm_set_signal_handler_state(0)

Definition at line 297 of file checkasm.h.

◆ bench_new

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

Definition at line 368 of file checkasm.h.

◆ PERF_START

#define PERF_START (   t)    while(0)

Definition at line 369 of file checkasm.h.

◆ PERF_STOP

#define PERF_STOP (   t)    while(0)

Definition at line 370 of file checkasm.h.

◆ DECL_CHECKASM_CHECK_FUNC

#define DECL_CHECKASM_CHECK_FUNC (   type)
Value:
int checkasm_check_##type(const char *file, int line, \
const type *buf1, ptrdiff_t stride1, \
const type *buf2, ptrdiff_t stride2, \
int w, int h, const char *name)

Definition at line 373 of file checkasm.h.

◆ PASTE

#define PASTE (   a,
  b 
)    a ## b

Definition at line 385 of file checkasm.h.

◆ CONCAT

#define CONCAT (   a,
  b 
)    PASTE(a,b)

Definition at line 386 of file checkasm.h.

◆ checkasm_check

#define checkasm_check (   prefix,
  ... 
)    CONCAT(checkasm_check_, prefix)(__FILE__, __LINE__, __VA_ARGS__)

Definition at line 388 of file checkasm.h.

Typedef Documentation

◆ checkasm_context

typedef sigjmp_buf checkasm_context

Definition at line 71 of file checkasm.h.

Function Documentation

◆ checkasm_check_aacencdsp()

void checkasm_check_aacencdsp ( void  )

Definition at line 100 of file aacencdsp.c.

◆ checkasm_check_aacpsdsp()

void checkasm_check_aacpsdsp ( void  )

Definition at line 234 of file aacpsdsp.c.

◆ checkasm_check_ac3dsp()

void checkasm_check_ac3dsp ( void  )

Definition at line 193 of file ac3dsp.c.

◆ checkasm_check_afir()

void checkasm_check_afir ( void  )

Definition at line 144 of file af_afir.c.

◆ checkasm_check_alacdsp()

void checkasm_check_alacdsp ( void  )

Definition at line 116 of file alacdsp.c.

◆ checkasm_check_audiodsp()

void checkasm_check_audiodsp ( void  )

Definition at line 52 of file audiodsp.c.

◆ checkasm_check_av_tx()

void checkasm_check_av_tx ( void  )

Definition at line 102 of file av_tx.c.

◆ checkasm_check_blend()

void checkasm_check_blend ( void  )

Definition at line 89 of file vf_blend.c.

◆ checkasm_check_blockdsp()

void checkasm_check_blockdsp ( void  )

Definition at line 78 of file blockdsp.c.

◆ checkasm_check_bswapdsp()

void checkasm_check_bswapdsp ( void  )

Definition at line 60 of file bswapdsp.c.

◆ checkasm_check_colorspace()

void checkasm_check_colorspace ( void  )

Definition at line 309 of file vf_colorspace.c.

◆ checkasm_check_exrdsp()

void checkasm_check_exrdsp ( void  )

Definition at line 77 of file exrdsp.c.

◆ checkasm_check_fdctdsp()

void checkasm_check_fdctdsp ( void  )

Definition at line 67 of file fdctdsp.c.

◆ checkasm_check_fixed_dsp()

void checkasm_check_fixed_dsp ( void  )

Definition at line 133 of file fixed_dsp.c.

◆ checkasm_check_flacdsp()

void checkasm_check_flacdsp ( void  )

Definition at line 155 of file flacdsp.c.

◆ checkasm_check_float_dsp()

void checkasm_check_float_dsp ( void  )

Definition at line 297 of file float_dsp.c.

◆ checkasm_check_fmtconvert()

void checkasm_check_fmtconvert ( void  )

Definition at line 46 of file fmtconvert.c.

◆ checkasm_check_g722dsp()

void checkasm_check_g722dsp ( void  )

Definition at line 53 of file g722dsp.c.

◆ checkasm_check_h263dsp()

void checkasm_check_h263dsp ( void  )

Definition at line 54 of file h263dsp.c.

◆ checkasm_check_h264chroma()

void checkasm_check_h264chroma ( void  )

Definition at line 81 of file h264chroma.c.

◆ checkasm_check_h264dsp()

void checkasm_check_h264dsp ( void  )

Definition at line 452 of file h264dsp.c.

◆ checkasm_check_h264pred()

void checkasm_check_h264pred ( void  )

Definition at line 233 of file h264pred.c.

◆ checkasm_check_h264qpel()

void checkasm_check_h264qpel ( void  )

Definition at line 51 of file h264qpel.c.

◆ checkasm_check_hevc_add_res()

void checkasm_check_hevc_add_res ( void  )

Definition at line 87 of file hevc_add_res.c.

◆ checkasm_check_hevc_deblock()

void checkasm_check_hevc_deblock ( void  )

Definition at line 264 of file hevc_deblock.c.

◆ checkasm_check_hevc_idct()

void checkasm_check_hevc_idct ( void  )

Definition at line 108 of file hevc_idct.c.

◆ checkasm_check_hevc_pel()

void checkasm_check_hevc_pel ( void  )

Definition at line 607 of file hevc_pel.c.

◆ checkasm_check_hevc_sao()

void checkasm_check_hevc_sao ( void  )

Definition at line 141 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 95 of file huffyuvdsp.c.

◆ checkasm_check_idctdsp()

void checkasm_check_idctdsp ( void  )

Definition at line 95 of file idctdsp.c.

◆ checkasm_check_jpeg2000dsp()

void checkasm_check_jpeg2000dsp ( void  )

Definition at line 92 of file jpeg2000dsp.c.

◆ checkasm_check_llauddsp()

void checkasm_check_llauddsp ( void  )

Definition at line 108 of file llauddsp.c.

◆ checkasm_check_lls()

void checkasm_check_lls ( void  )

Definition at line 84 of file lls.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_lpc()

void checkasm_check_lpc ( void  )

Definition at line 96 of file lpc.c.

◆ checkasm_check_motion()

void checkasm_check_motion ( void  )

Definition at line 137 of file motion.c.

◆ checkasm_check_mpegvideoencdsp()

void checkasm_check_mpegvideoencdsp ( void  )

Definition at line 132 of file mpegvideoencdsp.c.

◆ checkasm_check_nlmeans()

void checkasm_check_nlmeans ( void  )

Definition at line 32 of file vf_nlmeans.c.

◆ checkasm_check_opusdsp()

void checkasm_check_opusdsp ( void  )

Definition at line 86 of file opusdsp.c.

◆ checkasm_check_pixblockdsp()

void checkasm_check_pixblockdsp ( void  )

Definition at line 82 of file pixblockdsp.c.

◆ checkasm_check_sbrdsp()

void checkasm_check_sbrdsp ( void  )

Definition at line 257 of file sbrdsp.c.

◆ checkasm_check_rv34dsp()

void checkasm_check_rv34dsp ( void  )

Definition at line 82 of file rv34dsp.c.

◆ checkasm_check_rv40dsp()

void checkasm_check_rv40dsp ( void  )

Definition at line 71 of file rv40dsp.c.

◆ checkasm_check_svq1enc()

void checkasm_check_svq1enc ( void  )

Definition at line 63 of file svq1enc.c.

◆ checkasm_check_synth_filter()

void checkasm_check_synth_filter ( void  )

Definition at line 47 of file synth_filter.c.

◆ checkasm_check_sw_gbrp()

void checkasm_check_sw_gbrp ( void  )

Definition at line 398 of file sw_gbrp.c.

◆ checkasm_check_sw_range_convert()

void checkasm_check_sw_range_convert ( void  )

Definition at line 158 of file sw_range_convert.c.

◆ checkasm_check_sw_rgb()

void checkasm_check_sw_rgb ( void  )

Definition at line 451 of file sw_rgb.c.

◆ checkasm_check_sw_scale()

void checkasm_check_sw_scale ( void  )

Definition at line 365 of file sw_scale.c.

◆ checkasm_check_sw_yuv2rgb()

void checkasm_check_sw_yuv2rgb ( void  )

Definition at line 233 of file sw_yuv2rgb.c.

◆ checkasm_check_sw_yuv2yuv()

void checkasm_check_sw_yuv2yuv ( void  )

Definition at line 131 of file sw_yuv2yuv.c.

◆ checkasm_check_takdsp()

void checkasm_check_takdsp ( void  )

Definition at line 145 of file takdsp.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 84 of file v210enc.c.

◆ checkasm_check_vc1dsp()

void checkasm_check_vc1dsp ( void  )

Definition at line 476 of file vc1dsp.c.

◆ checkasm_check_vf_bwdif()

void checkasm_check_vf_bwdif ( void  )

Definition at line 72 of file vf_bwdif.c.

◆ checkasm_check_vf_eq()

void checkasm_check_vf_eq ( void  )

Definition at line 76 of file vf_eq.c.

◆ checkasm_check_vf_gblur()

void checkasm_check_vf_gblur ( void  )

Definition at line 82 of file vf_gblur.c.

◆ checkasm_check_vf_hflip()

void checkasm_check_vf_hflip ( void  )

Definition at line 72 of file vf_hflip.c.

◆ checkasm_check_vf_threshold()

void checkasm_check_vf_threshold ( void  )

Definition at line 79 of file vf_threshold.c.

◆ checkasm_check_vf_sobel()

void checkasm_check_vf_sobel ( void  )

Definition at line 100 of file vf_convolution.c.

◆ checkasm_check_vp8dsp()

void checkasm_check_vp8dsp ( void  )

Definition at line 510 of file vp8dsp.c.

◆ checkasm_check_vp9dsp()

void checkasm_check_vp9dsp ( void  )

Definition at line 627 of file vp9dsp.c.

◆ checkasm_check_videodsp()

void checkasm_check_videodsp ( void  )

Definition at line 81 of file videodsp.c.

◆ checkasm_check_vorbisdsp()

void checkasm_check_vorbisdsp ( void  )

Definition at line 76 of file vorbisdsp.c.

◆ checkasm_check_vvc_alf()

void checkasm_check_vvc_alf ( void  )

Definition at line 184 of file vvc_alf.c.

◆ checkasm_check_vvc_mc()

void checkasm_check_vvc_mc ( void  )

Definition at line 471 of file vvc_mc.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 1069 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 1114 of file checkasm.c.

◆ checkasm_report()

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

◆ checkasm_set_signal_handler_state()

void void checkasm_set_signal_handler_state ( int  enabled)

Definition at line 1095 of file checkasm.c.

Referenced by bench_init_ffmpeg().

◆ checkasm_handle_signal()

int checkasm_handle_signal ( int  s)

Definition at line 1099 of file checkasm.c.

◆ float_near_ulp()

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

Definition at line 414 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 467 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 
)

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

Referenced by checkasm_check_av_tx().

◆ DECL_CHECKASM_CHECK_FUNC() [1/5]

DECL_CHECKASM_CHECK_FUNC ( uint8_t  )

◆ DECL_CHECKASM_CHECK_FUNC() [2/5]

DECL_CHECKASM_CHECK_FUNC ( uint16_t  )

◆ DECL_CHECKASM_CHECK_FUNC() [3/5]

DECL_CHECKASM_CHECK_FUNC ( uint32_t  )

◆ DECL_CHECKASM_CHECK_FUNC() [4/5]

DECL_CHECKASM_CHECK_FUNC ( int16_t  )

◆ DECL_CHECKASM_CHECK_FUNC() [5/5]

DECL_CHECKASM_CHECK_FUNC ( int32_t  )

Variable Documentation

◆ checkasm_context_buf

checkasm_context checkasm_context_buf

Definition at line 729 of file checkasm.c.

◆ checkasm_lfg

AVLFG checkasm_lfg

Definition at line 406 of file checkasm.c.

Referenced by main().

◆ func_ref

av_unused void* func_ref
static

Definition at line 174 of file checkasm.h.

◆ func_new

av_unused void * func_new
static

Definition at line 174 of file checkasm.h.

◆ bench_runs

uint64_t bench_runs

Definition at line 108 of file checkasm.c.

Referenced by main().

name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
w
uint8_t w
Definition: llviddspenc.c:38
func_ref
static av_unused void * func_ref
Definition: checkasm.h:174
func_new
static av_unused void * func_new
Definition: checkasm.h:174
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
checkasm_set_signal_handler_state
void void checkasm_set_signal_handler_state(int enabled)
Definition: checkasm.c:1095
line
Definition: graph2dot.c:48
h
h
Definition: vp9dsp_template.c:2070