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)
 
#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__)
 

Functions

void checkasm_check_aacpsdsp (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_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_pel (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_opusdsp (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_sw_scale (void)
 
void checkasm_check_utvideodsp (void)
 
void checkasm_check_v210dec (void)
 
void checkasm_check_v210enc (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_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)
 
 DECL_CHECKASM_CHECK_FUNC (uint8_t)
 
 DECL_CHECKASM_CHECK_FUNC (uint16_t)
 
 DECL_CHECKASM_CHECK_FUNC (int16_t)
 
 DECL_CHECKASM_CHECK_FUNC (int32_t)
 

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 111 of file checkasm.h.

◆ BENCH_RUNS

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

Definition at line 115 of file checkasm.h.

◆ check_func

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

Definition at line 118 of file checkasm.h.

◆ declare_func

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

Definition at line 122 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 123 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 124 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 127 of file checkasm.h.

◆ report

#define report   checkasm_report

Definition at line 130 of file checkasm.h.

◆ call_ref

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

Definition at line 133 of file checkasm.h.

◆ declare_new

#define declare_new (   ret,
  ... 
)

Definition at line 201 of file checkasm.h.

◆ declare_new_float

#define declare_new_float (   ret,
  ... 
)

Definition at line 202 of file checkasm.h.

◆ declare_new_emms

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

Definition at line 203 of file checkasm.h.

◆ call_new

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

Definition at line 205 of file checkasm.h.

◆ bench_new

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

Definition at line 268 of file checkasm.h.

◆ PERF_START

#define PERF_START (   t)    while(0)

Definition at line 269 of file checkasm.h.

◆ PERF_STOP

#define PERF_STOP (   t)    while(0)

Definition at line 270 of file checkasm.h.

◆ DECL_CHECKASM_CHECK_FUNC

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

Definition at line 273 of file checkasm.h.

◆ PASTE

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

Definition at line 284 of file checkasm.h.

◆ CONCAT

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

Definition at line 285 of file checkasm.h.

◆ checkasm_check

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

Definition at line 287 of file checkasm.h.

Function Documentation

◆ checkasm_check_aacpsdsp()

void checkasm_check_aacpsdsp ( void  )

Definition at line 234 of file aacpsdsp.c.

◆ checkasm_check_afir()

void checkasm_check_afir ( void  )

Definition at line 80 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 100 of file av_tx.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 55 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_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 57 of file flacdsp.c.

◆ checkasm_check_float_dsp()

void checkasm_check_float_dsp ( void  )

Definition at line 282 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_h264dsp()

void checkasm_check_h264dsp ( void  )

Definition at line 442 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 86 of file hevc_add_res.c.

◆ checkasm_check_hevc_idct()

void checkasm_check_hevc_idct ( void  )

Definition at line 87 of file hevc_idct.c.

◆ checkasm_check_hevc_pel()

void checkasm_check_hevc_pel ( void  )

Definition at line 534 of file hevc_pel.c.

◆ checkasm_check_hevc_sao()

void checkasm_check_hevc_sao ( void  )

Definition at line 132 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 92 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_opusdsp()

void checkasm_check_opusdsp ( void  )

Definition at line 85 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 254 of file sbrdsp.c.

◆ checkasm_check_synth_filter()

void checkasm_check_synth_filter ( void  )

Definition at line 46 of file synth_filter.c.

◆ checkasm_check_sw_rgb()

void checkasm_check_sw_rgb ( void  )

Definition at line 182 of file sw_rgb.c.

◆ checkasm_check_sw_scale()

void checkasm_check_sw_scale ( void  )

Definition at line 238 of file sw_scale.c.

◆ checkasm_check_utvideodsp()

void checkasm_check_utvideodsp ( void  )

Definition at line 91 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 82 of file v210enc.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 81 of file vf_gblur.c.

◆ checkasm_check_vf_hflip()

void checkasm_check_vf_hflip ( void  )

Definition at line 71 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_vp8dsp()

void checkasm_check_vp8dsp ( void  )

Definition at line 508 of file vp8dsp.c.

◆ checkasm_check_vp9dsp()

void checkasm_check_vp9dsp ( void  )

Definition at line 626 of file vp9dsp.c.

◆ checkasm_check_videodsp()

void checkasm_check_videodsp ( void  )

Definition at line 81 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 787 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 812 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 292 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 345 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 310 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 350 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 369 of file checkasm.c.

Referenced by checkasm_check_av_tx().

◆ DECL_CHECKASM_CHECK_FUNC() [1/4]

DECL_CHECKASM_CHECK_FUNC ( uint8_t  )

◆ DECL_CHECKASM_CHECK_FUNC() [2/4]

DECL_CHECKASM_CHECK_FUNC ( uint16_t  )

◆ DECL_CHECKASM_CHECK_FUNC() [3/4]

DECL_CHECKASM_CHECK_FUNC ( int16_t  )

◆ DECL_CHECKASM_CHECK_FUNC() [4/4]

DECL_CHECKASM_CHECK_FUNC ( int32_t  )

Variable Documentation

◆ checkasm_lfg

AVLFG checkasm_lfg

Definition at line 284 of file checkasm.c.

Referenced by main().

◆ func_ref

av_unused void* func_ref
static

Definition at line 113 of file checkasm.h.

◆ func_new

av_unused void * func_new
static

Definition at line 113 of file checkasm.h.

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
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
line
Definition: graph2dot.c:48
h
h
Definition: vp9dsp_template.c:2038