FFmpeg
checkasm.c
Go to the documentation of this file.
1 /*
2  * Assembly testing and benchmarking tool
3  * Copyright (c) 2015 Henrik Gramner
4  * Copyright (c) 2008 Loren Merritt
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  *
22  * Copyright © 2018, VideoLAN and dav1d authors
23  * Copyright © 2018, Two Orioles, LLC
24  * All rights reserved.
25  *
26  * Redistribution and use in source and binary forms, with or without
27  * modification, are permitted provided that the following conditions are met:
28  *
29  * 1. Redistributions of source code must retain the above copyright notice, this
30  * list of conditions and the following disclaimer.
31  *
32  * 2. Redistributions in binary form must reproduce the above copyright notice,
33  * this list of conditions and the following disclaimer in the documentation
34  * and/or other materials provided with the distribution.
35  *
36  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
37  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
38  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
40  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
41  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
42  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
43  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
44  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
45  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46  */
47 
48 #include "config.h"
49 #include "config_components.h"
50 
51 #ifndef _GNU_SOURCE
52 # define _GNU_SOURCE // for syscall (performance monitoring API), strsignal()
53 #endif
54 
55 #include <signal.h>
56 #include <stdarg.h>
57 #include <stdio.h>
58 #include <stdlib.h>
59 #include <string.h>
60 #include "checkasm.h"
61 #include "libavutil/avassert.h"
62 #include "libavutil/common.h"
63 #include "libavutil/cpu.h"
64 #include "libavutil/intfloat.h"
65 #include "libavutil/random_seed.h"
66 
67 #if HAVE_IO_H
68 #include <io.h>
69 #endif
70 #if HAVE_PRCTL
71 #include <sys/prctl.h>
72 #endif
73 
74 #if defined(_WIN32) && !defined(SIGBUS)
75 /* non-standard, use the same value as mingw-w64 */
76 #define SIGBUS 10
77 #endif
78 
79 #if HAVE_SETCONSOLETEXTATTRIBUTE && HAVE_GETSTDHANDLE
80 #include <windows.h>
81 #define COLOR_RED FOREGROUND_RED
82 #define COLOR_GREEN FOREGROUND_GREEN
83 #define COLOR_YELLOW (FOREGROUND_RED|FOREGROUND_GREEN)
84 #else
85 #define COLOR_RED 1
86 #define COLOR_GREEN 2
87 #define COLOR_YELLOW 3
88 #endif
89 
90 #if HAVE_UNISTD_H
91 #include <unistd.h>
92 #endif
93 
94 #if !HAVE_ISATTY
95 #define isatty(fd) 1
96 #endif
97 
98 #if ARCH_AARCH64
99 #include "libavutil/aarch64/cpu.h"
100 #elif ARCH_RISCV
101 #include "libavutil/riscv/cpu.h"
102 #endif
103 
104 #if ARCH_ARM && HAVE_ARMV5TE_EXTERNAL
105 #include "libavutil/arm/cpu.h"
106 
107 void (*checkasm_checked_call)(void *func, int dummy, ...) = checkasm_checked_call_novfp;
108 #endif
109 
110 /* Trade-off between speed and accuracy */
111 uint64_t bench_runs = 1U << 10;
112 
113 /* List of tests to invoke */
114 static const struct {
115  const char *name;
116  void (*func)(void);
117 } tests[] = {
118 #if CONFIG_AVCODEC
119  #if CONFIG_AAC_DECODER
120  { "aacpsdsp", checkasm_check_aacpsdsp },
121  { "sbrdsp", checkasm_check_sbrdsp },
122  #endif
123  #if CONFIG_AAC_ENCODER
124  { "aacencdsp", checkasm_check_aacencdsp },
125  #endif
126  #if CONFIG_AC3DSP
127  { "ac3dsp", checkasm_check_ac3dsp },
128  #endif
129  #if CONFIG_ALAC_DECODER
130  { "alacdsp", checkasm_check_alacdsp },
131  #endif
132  #if CONFIG_AUDIODSP
133  { "audiodsp", checkasm_check_audiodsp },
134  #endif
135  #if CONFIG_BLOCKDSP
136  { "blockdsp", checkasm_check_blockdsp },
137  #endif
138  #if CONFIG_BSWAPDSP
139  { "bswapdsp", checkasm_check_bswapdsp },
140  #endif
141  #if CONFIG_DCA_DECODER
142  { "synth_filter", checkasm_check_synth_filter },
143  #endif
144  #if CONFIG_DIRAC_DECODER
145  { "diracdsp", checkasm_check_diracdsp },
146  #endif
147  #if CONFIG_EXR_DECODER
148  { "exrdsp", checkasm_check_exrdsp },
149  #endif
150  #if CONFIG_FDCTDSP
151  { "fdctdsp", checkasm_check_fdctdsp },
152  #endif
153  #if CONFIG_FLAC_DECODER
154  { "flacdsp", checkasm_check_flacdsp },
155  #endif
156  #if CONFIG_FMTCONVERT
157  { "fmtconvert", checkasm_check_fmtconvert },
158  #endif
159  #if CONFIG_G722DSP
160  { "g722dsp", checkasm_check_g722dsp },
161  #endif
162  #if CONFIG_H263DSP
163  { "h263dsp", checkasm_check_h263dsp },
164  #endif
165  #if CONFIG_H264CHROMA
166  { "h264chroma", checkasm_check_h264chroma },
167  #endif
168  #if CONFIG_H264DSP
169  { "h264dsp", checkasm_check_h264dsp },
170  #endif
171  #if CONFIG_H264PRED
172  { "h264pred", checkasm_check_h264pred },
173  #endif
174  #if CONFIG_H264QPEL
175  { "h264qpel", checkasm_check_h264qpel },
176  #endif
177  #if CONFIG_HEVC_DECODER
178  { "hevc_add_res", checkasm_check_hevc_add_res },
179  { "hevc_deblock", checkasm_check_hevc_deblock },
180  { "hevc_idct", checkasm_check_hevc_idct },
181  { "hevc_pel", checkasm_check_hevc_pel },
182  { "hevc_sao", checkasm_check_hevc_sao },
183  #endif
184  #if CONFIG_HUFFYUV_DECODER
185  { "huffyuvdsp", checkasm_check_huffyuvdsp },
186  #endif
187  #if CONFIG_IDCTDSP
188  { "idctdsp", checkasm_check_idctdsp },
189  #endif
190  #if CONFIG_JPEG2000_DECODER
191  { "jpeg2000dsp", checkasm_check_jpeg2000dsp },
192  #endif
193  #if CONFIG_LLAUDDSP
194  { "llauddsp", checkasm_check_llauddsp },
195  #endif
196  #if CONFIG_HUFFYUVDSP
197  { "llviddsp", checkasm_check_llviddsp },
198  #endif
199  #if CONFIG_LLVIDENCDSP
200  { "llviddspenc", checkasm_check_llviddspenc },
201  #endif
202  #if CONFIG_LPC
203  { "lpc", checkasm_check_lpc },
204  #endif
205  #if CONFIG_ME_CMP
206  { "motion", checkasm_check_motion },
207  #endif
208  #if CONFIG_MPEGVIDEOENC
209  { "mpegvideoencdsp", checkasm_check_mpegvideoencdsp },
210  #endif
211  #if CONFIG_OPUS_DECODER
212  { "opusdsp", checkasm_check_opusdsp },
213  #endif
214  #if CONFIG_PIXBLOCKDSP
215  { "pixblockdsp", checkasm_check_pixblockdsp },
216  #endif
217  #if CONFIG_RV34DSP
218  { "rv34dsp", checkasm_check_rv34dsp },
219  #endif
220  #if CONFIG_RV40_DECODER
221  { "rv40dsp", checkasm_check_rv40dsp },
222  #endif
223  #if CONFIG_SVQ1_ENCODER
224  { "svq1enc", checkasm_check_svq1enc },
225  #endif
226  #if CONFIG_TAK_DECODER
227  { "takdsp", checkasm_check_takdsp },
228  #endif
229  #if CONFIG_UTVIDEO_DECODER
230  { "utvideodsp", checkasm_check_utvideodsp },
231  #endif
232  #if CONFIG_V210_DECODER
233  { "v210dec", checkasm_check_v210dec },
234  #endif
235  #if CONFIG_V210_ENCODER
236  { "v210enc", checkasm_check_v210enc },
237  #endif
238  #if CONFIG_VC1DSP
239  { "vc1dsp", checkasm_check_vc1dsp },
240  #endif
241  #if CONFIG_VP8DSP
242  { "vp8dsp", checkasm_check_vp8dsp },
243  #endif
244  #if CONFIG_VP9_DECODER
245  { "vp9dsp", checkasm_check_vp9dsp },
246  #endif
247  #if CONFIG_VIDEODSP
248  { "videodsp", checkasm_check_videodsp },
249  #endif
250  #if CONFIG_VORBIS_DECODER
251  { "vorbisdsp", checkasm_check_vorbisdsp },
252  #endif
253  #if CONFIG_VVC_DECODER
254  { "vvc_alf", checkasm_check_vvc_alf },
255  { "vvc_mc", checkasm_check_vvc_mc },
256  #endif
257 #endif
258 #if CONFIG_AVFILTER
259  #if CONFIG_AFIR_FILTER
260  { "af_afir", checkasm_check_afir },
261  #endif
262  #if CONFIG_BLEND_FILTER
263  { "vf_blend", checkasm_check_blend },
264  #endif
265  #if CONFIG_BWDIF_FILTER
266  { "vf_bwdif", checkasm_check_vf_bwdif },
267  #endif
268  #if CONFIG_COLORSPACE_FILTER
269  { "vf_colorspace", checkasm_check_colorspace },
270  #endif
271  #if CONFIG_EQ_FILTER
272  { "vf_eq", checkasm_check_vf_eq },
273  #endif
274  #if CONFIG_GBLUR_FILTER
275  { "vf_gblur", checkasm_check_vf_gblur },
276  #endif
277  #if CONFIG_HFLIP_FILTER
278  { "vf_hflip", checkasm_check_vf_hflip },
279  #endif
280  #if CONFIG_NLMEANS_FILTER
281  { "vf_nlmeans", checkasm_check_nlmeans },
282  #endif
283  #if CONFIG_THRESHOLD_FILTER
284  { "vf_threshold", checkasm_check_vf_threshold },
285  #endif
286  #if CONFIG_SOBEL_FILTER
287  { "vf_sobel", checkasm_check_vf_sobel },
288  #endif
289 #endif
290 #if CONFIG_SWSCALE
291  { "sw_gbrp", checkasm_check_sw_gbrp },
292  { "sw_range_convert", checkasm_check_sw_range_convert },
293  { "sw_rgb", checkasm_check_sw_rgb },
294  { "sw_scale", checkasm_check_sw_scale },
295  { "sw_yuv2rgb", checkasm_check_sw_yuv2rgb },
296  { "sw_yuv2yuv", checkasm_check_sw_yuv2yuv },
297 #endif
298 #if CONFIG_AVUTIL
299  { "aes", checkasm_check_aes },
300  { "fixed_dsp", checkasm_check_fixed_dsp },
301  { "float_dsp", checkasm_check_float_dsp },
302  { "lls", checkasm_check_lls },
303  { "av_tx", checkasm_check_av_tx },
304 #endif
305  { NULL }
306 };
307 
308 /* List of cpu flags to check */
309 static const struct {
310  const char *name;
311  const char *suffix;
312  int flag;
313 } cpus[] = {
314 #if ARCH_AARCH64
315  { "ARMV8", "armv8", AV_CPU_FLAG_ARMV8 },
316  { "NEON", "neon", AV_CPU_FLAG_NEON },
317  { "DOTPROD", "dotprod", AV_CPU_FLAG_DOTPROD },
318  { "I8MM", "i8mm", AV_CPU_FLAG_I8MM },
319  { "SVE", "sve", AV_CPU_FLAG_SVE },
320  { "SVE2", "sve2", AV_CPU_FLAG_SVE2 },
321 #elif ARCH_ARM
322  { "ARMV5TE", "armv5te", AV_CPU_FLAG_ARMV5TE },
323  { "ARMV6", "armv6", AV_CPU_FLAG_ARMV6 },
324  { "ARMV6T2", "armv6t2", AV_CPU_FLAG_ARMV6T2 },
325  { "VFP", "vfp", AV_CPU_FLAG_VFP },
326  { "VFP_VM", "vfp_vm", AV_CPU_FLAG_VFP_VM },
327  { "VFPV3", "vfp3", AV_CPU_FLAG_VFPV3 },
328  { "NEON", "neon", AV_CPU_FLAG_NEON },
329 #elif ARCH_PPC
330  { "ALTIVEC", "altivec", AV_CPU_FLAG_ALTIVEC },
331  { "VSX", "vsx", AV_CPU_FLAG_VSX },
332  { "POWER8", "power8", AV_CPU_FLAG_POWER8 },
333 #elif ARCH_RISCV
334  { "RVI", "rvi", AV_CPU_FLAG_RVI },
335  { "misaligned", "misaligned", AV_CPU_FLAG_RV_MISALIGNED },
336  { "RV_zbb", "rvb_b", AV_CPU_FLAG_RVB_BASIC },
337  { "RVB", "rvb", AV_CPU_FLAG_RVB },
338  { "RV_zve32x","rvv_i32", AV_CPU_FLAG_RVV_I32 },
339  { "RV_zve32f","rvv_f32", AV_CPU_FLAG_RVV_F32 },
340  { "RV_zve64x","rvv_i64", AV_CPU_FLAG_RVV_I64 },
341  { "RV_zve64d","rvv_f64", AV_CPU_FLAG_RVV_F64 },
342  { "RV_zvbb", "rv_zvbb", AV_CPU_FLAG_RV_ZVBB },
343 #elif ARCH_MIPS
344  { "MMI", "mmi", AV_CPU_FLAG_MMI },
345  { "MSA", "msa", AV_CPU_FLAG_MSA },
346 #elif ARCH_X86
347  { "MMX", "mmx", AV_CPU_FLAG_MMX|AV_CPU_FLAG_CMOV },
348  { "MMXEXT", "mmxext", AV_CPU_FLAG_MMXEXT },
349  { "3DNOW", "3dnow", AV_CPU_FLAG_3DNOW },
350  { "3DNOWEXT", "3dnowext", AV_CPU_FLAG_3DNOWEXT },
351  { "SSE", "sse", AV_CPU_FLAG_SSE },
352  { "SSE2", "sse2", AV_CPU_FLAG_SSE2|AV_CPU_FLAG_SSE2SLOW },
353  { "SSE3", "sse3", AV_CPU_FLAG_SSE3|AV_CPU_FLAG_SSE3SLOW },
354  { "SSSE3", "ssse3", AV_CPU_FLAG_SSSE3|AV_CPU_FLAG_ATOM },
355  { "SSE4.1", "sse4", AV_CPU_FLAG_SSE4 },
356  { "SSE4.2", "sse42", AV_CPU_FLAG_SSE42 },
357  { "AES-NI", "aesni", AV_CPU_FLAG_AESNI },
358  { "AVX", "avx", AV_CPU_FLAG_AVX },
359  { "XOP", "xop", AV_CPU_FLAG_XOP },
360  { "FMA3", "fma3", AV_CPU_FLAG_FMA3 },
361  { "FMA4", "fma4", AV_CPU_FLAG_FMA4 },
362  { "AVX2", "avx2", AV_CPU_FLAG_AVX2 },
363  { "AVX-512", "avx512", AV_CPU_FLAG_AVX512 },
364  { "AVX-512ICL", "avx512icl", AV_CPU_FLAG_AVX512ICL },
365 #elif ARCH_LOONGARCH
366  { "LSX", "lsx", AV_CPU_FLAG_LSX },
367  { "LASX", "lasx", AV_CPU_FLAG_LASX },
368 #elif ARCH_WASM
369  { "SIMD128", "simd128", AV_CPU_FLAG_SIMD128 },
370 #endif
371  { NULL }
372 };
373 
374 typedef struct CheckasmFuncVersion {
376  void *func;
377  int ok;
378  int cpu;
381 
382 /* Binary search tree node */
383 typedef struct CheckasmFunc {
384  struct CheckasmFunc *child[2];
386  uint8_t color; /* 0 = red, 1 = black */
387  char name[1];
388 } CheckasmFunc;
389 
390 /* Internal state */
391 static struct {
395  const char *current_test_name;
396  const char *bench_pattern;
400 
401  /* perf */
402  int nop_time;
403  int sysfd;
404 
405  int cpu_flag;
406  const char *cpu_flag_name;
407  const char *test_pattern;
408  int verbose;
409  int csv;
410  int tsv;
411  volatile sig_atomic_t catch_signals;
412 } state;
413 
414 /* PRNG state */
416 
417 /* float compare support code */
418 static int is_negative(union av_intfloat32 u)
419 {
420  return u.i >> 31;
421 }
422 
423 int float_near_ulp(float a, float b, unsigned max_ulp)
424 {
425  union av_intfloat32 x, y;
426 
427  x.f = a;
428  y.f = b;
429 
430  if (is_negative(x) != is_negative(y)) {
431  // handle -0.0 == +0.0
432  return a == b;
433  }
434 
435  if (llabs((int64_t)x.i - y.i) <= max_ulp)
436  return 1;
437 
438  return 0;
439 }
440 
441 int float_near_ulp_array(const float *a, const float *b, unsigned max_ulp,
442  unsigned len)
443 {
444  unsigned i;
445 
446  for (i = 0; i < len; i++) {
447  if (!float_near_ulp(a[i], b[i], max_ulp))
448  return 0;
449  }
450  return 1;
451 }
452 
453 int float_near_abs_eps(float a, float b, float eps)
454 {
455  float abs_diff = fabsf(a - b);
456  if (abs_diff < eps)
457  return 1;
458 
459  fprintf(stderr, "test failed comparing %g with %g (abs diff=%g with EPS=%g)\n", a, b, abs_diff, eps);
460 
461  return 0;
462 }
463 
464 int float_near_abs_eps_array(const float *a, const float *b, float eps,
465  unsigned len)
466 {
467  unsigned i;
468 
469  for (i = 0; i < len; i++) {
470  if (!float_near_abs_eps(a[i], b[i], eps))
471  return 0;
472  }
473  return 1;
474 }
475 
476 int float_near_abs_eps_ulp(float a, float b, float eps, unsigned max_ulp)
477 {
478  return float_near_ulp(a, b, max_ulp) || float_near_abs_eps(a, b, eps);
479 }
480 
481 int float_near_abs_eps_array_ulp(const float *a, const float *b, float eps,
482  unsigned max_ulp, unsigned len)
483 {
484  unsigned i;
485 
486  for (i = 0; i < len; i++) {
487  if (!float_near_abs_eps_ulp(a[i], b[i], eps, max_ulp))
488  return 0;
489  }
490  return 1;
491 }
492 
493 int double_near_abs_eps(double a, double b, double eps)
494 {
495  double abs_diff = fabs(a - b);
496 
497  return abs_diff < eps;
498 }
499 
500 int double_near_abs_eps_array(const double *a, const double *b, double eps,
501  unsigned len)
502 {
503  unsigned i;
504 
505  for (i = 0; i < len; i++) {
506  if (!double_near_abs_eps(a[i], b[i], eps))
507  return 0;
508  }
509  return 1;
510 }
511 
512 /* Print colored text to stderr if the terminal supports it */
513 static void color_printf(int color, const char *fmt, ...)
514 {
515  static int use_color = -1;
516  va_list arg;
517 
518 #if HAVE_SETCONSOLETEXTATTRIBUTE && HAVE_GETSTDHANDLE
519  static HANDLE con;
520  static WORD org_attributes;
521 
522  if (use_color < 0) {
523  CONSOLE_SCREEN_BUFFER_INFO con_info;
524  con = GetStdHandle(STD_ERROR_HANDLE);
525  if (con && con != INVALID_HANDLE_VALUE && GetConsoleScreenBufferInfo(con, &con_info)) {
526  org_attributes = con_info.wAttributes;
527  use_color = 1;
528  } else
529  use_color = 0;
530  }
531  if (use_color)
532  SetConsoleTextAttribute(con, (org_attributes & 0xfff0) | (color & 0x0f));
533 #else
534  if (use_color < 0) {
535  const char *term = getenv("TERM");
536  use_color = term && strcmp(term, "dumb") && isatty(2);
537  }
538  if (use_color)
539  fprintf(stderr, "\x1b[%d;3%dm", (color & 0x08) >> 3, color & 0x07);
540 #endif
541 
542  va_start(arg, fmt);
543  vfprintf(stderr, fmt, arg);
544  va_end(arg);
545 
546  if (use_color) {
547 #if HAVE_SETCONSOLETEXTATTRIBUTE && HAVE_GETSTDHANDLE
548  SetConsoleTextAttribute(con, org_attributes);
549 #else
550  fprintf(stderr, "\x1b[0m");
551 #endif
552  }
553 }
554 
555 /* Deallocate a tree */
557 {
558  if (f) {
559  CheckasmFuncVersion *v = f->versions.next;
560  while (v) {
561  CheckasmFuncVersion *next = v->next;
562  free(v);
563  v = next;
564  }
565 
566  destroy_func_tree(f->child[0]);
567  destroy_func_tree(f->child[1]);
568  free(f);
569  }
570 }
571 
572 /* Allocate a zero-initialized block, clean up and exit on failure */
573 static void *checkasm_malloc(size_t size)
574 {
575  void *ptr = calloc(1, size);
576  if (!ptr) {
577  fprintf(stderr, "checkasm: malloc failed\n");
578  destroy_func_tree(state.funcs);
579  exit(1);
580  }
581  return ptr;
582 }
583 
584 /* Get the suffix of the specified cpu flag */
585 static const char *cpu_suffix(int cpu)
586 {
587  int i = FF_ARRAY_ELEMS(cpus);
588 
589  while (--i >= 0)
590  if (cpu & cpus[i].flag)
591  return cpus[i].suffix;
592 
593  return "c";
594 }
595 
596 static int cmp_nop(const void *a, const void *b)
597 {
598  return *(const uint16_t*)a - *(const uint16_t*)b;
599 }
600 
601 /* Measure the overhead of the timing code (in decicycles) */
602 static int measure_nop_time(void)
603 {
604  uint16_t nops[10000];
605  int i, nop_sum = 0;
606  av_unused const int sysfd = state.sysfd;
607 
608  uint64_t t = 0;
609  for (i = 0; i < 10000; i++) {
610  PERF_START(t);
611  PERF_STOP(t);
612  nops[i] = t;
613  }
614 
615  qsort(nops, 10000, sizeof(uint16_t), cmp_nop);
616  for (i = 2500; i < 7500; i++)
617  nop_sum += nops[i];
618 
619  return nop_sum / 500;
620 }
621 
622 static inline double avg_cycles_per_call(const CheckasmPerf *const p)
623 {
624  if (p->iterations) {
625  const double cycles = (double)(10 * p->cycles) / p->iterations - state.nop_time;
626  if (cycles > 0.0)
627  return cycles / 4.0; /* 4 calls per iteration */
628  }
629  return 0.0;
630 }
631 
632 /* Print benchmark results */
634 {
635  if (f) {
636  CheckasmFuncVersion *v = &f->versions;
637  const CheckasmPerf *p = &v->perf;
638  const double baseline = avg_cycles_per_call(p);
639  double decicycles;
640 
641  print_benchs(f->child[0]);
642 
643  do {
644  if (p->iterations) {
645  p = &v->perf;
646  decicycles = avg_cycles_per_call(p);
647  if (state.csv || state.tsv) {
648  const char sep = state.csv ? ',' : '\t';
649  printf("%s%c%s%c%.1f\n", f->name, sep,
650  cpu_suffix(v->cpu), sep,
651  decicycles / 10.0);
652  } else {
653  const int pad_length = 10 + 50 -
654  printf("%s_%s:", f->name, cpu_suffix(v->cpu));
655  const double ratio = decicycles ?
656  baseline / decicycles : 0.0;
657  printf("%*.1f (%5.2fx)\n", FFMAX(pad_length, 0),
658  decicycles / 10.0, ratio);
659  }
660  }
661  } while ((v = v->next));
662 
663  print_benchs(f->child[1]);
664  }
665 }
666 
667 /* ASCIIbetical sort except preserving natural order for numbers */
668 static int cmp_func_names(const char *a, const char *b)
669 {
670  const char *start = a;
671  int ascii_diff, digit_diff;
672 
673  for (; !(ascii_diff = *(const unsigned char*)a - *(const unsigned char*)b) && *a; a++, b++);
674  for (; av_isdigit(*a) && av_isdigit(*b); a++, b++);
675 
676  if (a > start && av_isdigit(a[-1]) && (digit_diff = av_isdigit(*a) - av_isdigit(*b)))
677  return digit_diff;
678 
679  return ascii_diff;
680 }
681 
682 /* Perform a tree rotation in the specified direction and return the new root */
684 {
685  CheckasmFunc *r = f->child[dir^1];
686  f->child[dir^1] = r->child[dir];
687  r->child[dir] = f;
688  r->color = f->color;
689  f->color = 0;
690  return r;
691 }
692 
693 #define is_red(f) ((f) && !(f)->color)
694 
695 /* Balance a left-leaning red-black tree at the specified node */
696 static void balance_tree(CheckasmFunc **root)
697 {
698  CheckasmFunc *f = *root;
699 
700  if (is_red(f->child[0]) && is_red(f->child[1])) {
701  f->color ^= 1;
702  f->child[0]->color = f->child[1]->color = 1;
703  }
704 
705  if (!is_red(f->child[0]) && is_red(f->child[1]))
706  *root = rotate_tree(f, 0); /* Rotate left */
707  else if (is_red(f->child[0]) && is_red(f->child[0]->child[0]))
708  *root = rotate_tree(f, 1); /* Rotate right */
709 }
710 
711 /* Get a node with the specified name, creating it if it doesn't exist */
712 static CheckasmFunc *get_func(CheckasmFunc **root, const char *name)
713 {
714  CheckasmFunc *f = *root;
715 
716  if (f) {
717  /* Search the tree for a matching node */
718  int cmp = cmp_func_names(name, f->name);
719  if (cmp) {
720  f = get_func(&f->child[cmp > 0], name);
721 
722  /* Rebalance the tree on the way up if a new node was inserted */
723  if (!f->versions.func)
724  balance_tree(root);
725  }
726  } else {
727  /* Allocate and insert a new node into the tree */
728  int name_length = strlen(name);
729  f = *root = checkasm_malloc(sizeof(CheckasmFunc) + name_length);
730  memcpy(f->name, name, name_length + 1);
731  }
732 
733  return f;
734 }
735 
737 
738 /* Crash handling: attempt to catch crashes and handle them
739  * gracefully instead of just aborting abruptly. */
740 #ifdef _WIN32
741 #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
742 static LONG NTAPI signal_handler(EXCEPTION_POINTERS *e) {
743  int s;
744 
745  if (!state.catch_signals)
746  return EXCEPTION_CONTINUE_SEARCH;
747 
748  switch (e->ExceptionRecord->ExceptionCode) {
749  case EXCEPTION_FLT_DIVIDE_BY_ZERO:
750  case EXCEPTION_INT_DIVIDE_BY_ZERO:
751  s = SIGFPE;
752  break;
753  case EXCEPTION_ILLEGAL_INSTRUCTION:
754  case EXCEPTION_PRIV_INSTRUCTION:
755  s = SIGILL;
756  break;
757  case EXCEPTION_ACCESS_VIOLATION:
758  case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
759  case EXCEPTION_DATATYPE_MISALIGNMENT:
760  case EXCEPTION_STACK_OVERFLOW:
761  s = SIGSEGV;
762  break;
763  case EXCEPTION_IN_PAGE_ERROR:
764  s = SIGBUS;
765  break;
766  default:
767  return EXCEPTION_CONTINUE_SEARCH;
768  }
769  state.catch_signals = 0;
771  return EXCEPTION_CONTINUE_EXECUTION; /* never reached, but shuts up gcc */
772 }
773 #endif
774 #elif !defined(_WASI_EMULATED_SIGNAL)
775 static void signal_handler(int s);
776 
777 static const struct sigaction signal_handler_act = {
778  .sa_handler = signal_handler,
779  .sa_flags = SA_RESETHAND,
780 };
781 
782 static void signal_handler(int s) {
783  if (state.catch_signals) {
784  state.catch_signals = 0;
785  sigaction(s, &signal_handler_act, NULL);
787  }
788 }
789 #endif
790 
791 /* Compares a string with a wildcard pattern. */
792 static int wildstrcmp(const char *str, const char *pattern)
793 {
794  const char *wild = strchr(pattern, '*');
795  if (wild) {
796  const size_t len = wild - pattern;
797  if (strncmp(str, pattern, len)) return 1;
798  while (*++wild == '*');
799  if (!*wild) return 0;
800  str += len;
801  while (*str && wildstrcmp(str, wild)) str++;
802  return !*str;
803  }
804  return strcmp(str, pattern);
805 }
806 
807 /* Perform tests and benchmarks for the specified cpu flag if supported by the host */
808 static void check_cpu_flag(const char *name, int flag)
809 {
810  int old_cpu_flag = state.cpu_flag;
811 
812  flag |= old_cpu_flag;
813  av_force_cpu_flags(-1);
814  state.cpu_flag = flag & av_get_cpu_flags();
815  av_force_cpu_flags(state.cpu_flag);
816 
817  if (!flag || state.cpu_flag != old_cpu_flag) {
818  int i;
819 
820  state.cpu_flag_name = name;
821  for (i = 0; tests[i].func; i++) {
822  if (state.test_pattern && wildstrcmp(tests[i].name, state.test_pattern))
823  continue;
824  state.current_test_name = tests[i].name;
825  tests[i].func();
826  }
827  }
828 }
829 
830 /* Print the name of the current CPU flag, but only do it once */
831 static void print_cpu_name(void)
832 {
833  if (state.cpu_flag_name) {
834  color_printf(COLOR_YELLOW, "%s:\n", state.cpu_flag_name);
835  state.cpu_flag_name = NULL;
836  }
837 }
838 
839 #if CONFIG_LINUX_PERF
840 static int bench_init_linux(void)
841 {
842  struct perf_event_attr attr = {
843  .type = PERF_TYPE_HARDWARE,
844  .size = sizeof(struct perf_event_attr),
845  .config = PERF_COUNT_HW_CPU_CYCLES,
846  .disabled = 1, // start counting only on demand
847  .exclude_kernel = 1,
848  .exclude_hv = 1,
849 #if !ARCH_X86
850  .exclude_guest = 1,
851 #endif
852  };
853 
854  fprintf(stderr, "benchmarking with Linux Perf Monitoring API\n");
855 
856  state.sysfd = syscall(__NR_perf_event_open, &attr, 0, -1, -1, 0);
857  if (state.sysfd == -1) {
858  perror("perf_event_open");
859  return -1;
860  }
861  return 0;
862 }
863 #elif CONFIG_MACOS_KPERF
864 static int bench_init_kperf(void)
865 {
866  ff_kperf_init();
867  return 0;
868 }
869 #else
870 static int bench_init_ffmpeg(void)
871 {
872 #ifdef AV_READ_TIME
873  if (!checkasm_save_context()) {
875  AV_READ_TIME();
877  } else {
878  fprintf(stderr, "checkasm: unable to execute platform specific timer\n");
879  return -1;
880  }
881  fprintf(stderr, "benchmarking with native FFmpeg timers\n");
882  return 0;
883 #else
884  fprintf(stderr, "checkasm: --bench is not supported on your system\n");
885  return -1;
886 #endif
887 }
888 #endif
889 
890 static int bench_init(void)
891 {
892 #if CONFIG_LINUX_PERF
893  int ret = bench_init_linux();
894 #elif CONFIG_MACOS_KPERF
895  int ret = bench_init_kperf();
896 #else
897  int ret = bench_init_ffmpeg();
898 #endif
899  if (ret < 0)
900  return ret;
901 
902  state.nop_time = measure_nop_time();
903  fprintf(stderr, "nop: %d.%d\n", state.nop_time/10, state.nop_time%10);
904  return 0;
905 }
906 
907 static void bench_uninit(void)
908 {
909 #if CONFIG_LINUX_PERF
910  close(state.sysfd);
911 #endif
912 }
913 
914 static int usage(const char *path)
915 {
916  fprintf(stderr,
917  "Usage: %s [options...] [seed]\n"
918  " --test=<pattern> Run specific test.\n"
919  " --bench Run benchmark.\n"
920  " --csv, --tsv Output results in rows of comma or tab separated values.\n"
921  " --runs=<ptwo> Manual number of benchmark iterations to run 2**<ptwo>.\n"
922  " --verbose Increase verbosity.\n",
923  path);
924  return 1;
925 }
926 
927 int main(int argc, char *argv[])
928 {
929  unsigned int seed = av_get_random_seed();
930  int i, ret = 0;
931  char arch_info_buf[50] = "";
932 
933 #ifdef _WIN32
934 #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
935  AddVectoredExceptionHandler(0, signal_handler);
936 #endif
937 #elif !defined(_WASI_EMULATED_SIGNAL)
938  sigaction(SIGBUS, &signal_handler_act, NULL);
939  sigaction(SIGFPE, &signal_handler_act, NULL);
940  sigaction(SIGILL, &signal_handler_act, NULL);
941  sigaction(SIGSEGV, &signal_handler_act, NULL);
942 #endif
943 #if HAVE_PRCTL && defined(PR_SET_UNALIGN)
944  prctl(PR_SET_UNALIGN, PR_UNALIGN_SIGBUS);
945 #endif
946 #if ARCH_ARM && HAVE_ARMV5TE_EXTERNAL
948  checkasm_checked_call = checkasm_checked_call_vfp;
949 #endif
950 
951  if (!tests[0].func || !cpus[0].flag) {
952  fprintf(stderr, "checkasm: no tests to perform\n");
953  return 0;
954  }
955 
956  for (i = 1; i < argc; i++) {
957  const char *arg = argv[i];
958  unsigned long l;
959  char *end;
960 
961  if (!strncmp(arg, "--bench", 7)) {
962  if (bench_init() < 0)
963  return 1;
964  if (arg[7] == '=') {
965  state.bench_pattern = arg + 8;
966  state.bench_pattern_len = strlen(state.bench_pattern);
967  } else
968  state.bench_pattern = "*";
969  } else if (!strncmp(arg, "--test=", 7)) {
970  state.test_pattern = arg + 7;
971  } else if (!strcmp(arg, "--csv")) {
972  state.csv = 1; state.tsv = 0;
973  } else if (!strcmp(arg, "--tsv")) {
974  state.csv = 0; state.tsv = 1;
975  } else if (!strcmp(arg, "--verbose") || !strcmp(arg, "-v")) {
976  state.verbose = 1;
977  } else if (!strncmp(arg, "--runs=", 7)) {
978  l = strtoul(arg + 7, &end, 10);
979  if (*end == '\0') {
980  if (l > 30) {
981  fprintf(stderr, "checkasm: error: runs exponent must be within the range 0 <= 30\n");
982  usage(argv[0]);
983  }
984  bench_runs = 1U << l;
985  } else {
986  return usage(argv[0]);
987  }
988  } else if ((l = strtoul(arg, &end, 10)) <= UINT_MAX &&
989  *end == '\0') {
990  seed = l;
991  } else {
992  return usage(argv[0]);
993  }
994  }
995 
996 #if ARCH_AARCH64 && HAVE_SVE
997  if (have_sve(av_get_cpu_flags()))
998  snprintf(arch_info_buf, sizeof(arch_info_buf),
999  "SVE %d bits, ", 8 * ff_aarch64_sve_length());
1000 #elif ARCH_RISCV && HAVE_RVV
1002  snprintf(arch_info_buf, sizeof (arch_info_buf),
1003  "%zu-bit vectors, ", 8 * ff_get_rv_vlenb());
1004 #endif
1005  fprintf(stderr, "checkasm: %susing random seed %u\n", arch_info_buf, seed);
1007 
1008  if (state.bench_pattern)
1009  fprintf(stderr, "checkasm: bench runs %" PRIu64 " (1 << %i)\n", bench_runs, av_log2(bench_runs));
1010 
1011  check_cpu_flag(NULL, 0);
1012  for (i = 0; cpus[i].flag; i++)
1014 
1015  if (state.num_failed) {
1016  fprintf(stderr, "checkasm: %d of %d tests have failed\n", state.num_failed, state.num_checked);
1017  ret = 1;
1018  } else {
1019  fprintf(stderr, "checkasm: all %d tests passed\n", state.num_checked);
1020  if (state.bench_pattern) {
1021  print_benchs(state.funcs);
1022  }
1023  }
1024 
1025  destroy_func_tree(state.funcs);
1026  bench_uninit();
1027  return ret;
1028 }
1029 
1030 /* Decide whether or not the specified function needs to be tested and
1031  * allocate/initialize data structures if needed. Returns a pointer to a
1032  * reference function if the function should be tested, otherwise NULL */
1033 void *checkasm_check_func(void *func, const char *name, ...)
1034 {
1035  char name_buf[256];
1036  void *ref = func;
1038  int name_length;
1039  va_list arg;
1040 
1041  va_start(arg, name);
1042  name_length = vsnprintf(name_buf, sizeof(name_buf), name, arg);
1043  va_end(arg);
1044 
1045  if (!func || name_length <= 0 || name_length >= sizeof(name_buf))
1046  return NULL;
1047 
1048  state.current_func = get_func(&state.funcs, name_buf);
1049  state.funcs->color = 1;
1050  v = &state.current_func->versions;
1051 
1052  if (v->func) {
1053  CheckasmFuncVersion *prev;
1054  do {
1055  /* Only test functions that haven't already been tested */
1056  if (v->func == func)
1057  return NULL;
1058 
1059  if (v->ok)
1060  ref = v->func;
1061 
1062  prev = v;
1063  } while ((v = v->next));
1064 
1065  v = prev->next = checkasm_malloc(sizeof(CheckasmFuncVersion));
1066  }
1067 
1068  v->func = func;
1069  v->ok = 1;
1070  v->cpu = state.cpu_flag;
1071  state.current_func_ver = v;
1072 
1073  if (state.cpu_flag)
1074  state.num_checked++;
1075 
1076  return ref;
1077 }
1078 
1079 /* Decide whether or not the current function needs to be benchmarked */
1081 {
1082  return !state.num_failed && state.bench_pattern &&
1083  !wildstrcmp(state.current_func->name, state.bench_pattern);
1084 }
1085 
1086 /* Indicate that the current test has failed, return whether verbose printing
1087  * is requested. */
1088 int checkasm_fail_func(const char *msg, ...)
1089 {
1090  if (state.current_func_ver && state.current_func_ver->cpu &&
1091  state.current_func_ver->ok)
1092  {
1093  va_list arg;
1094 
1095  print_cpu_name();
1096  fprintf(stderr, " %s_%s (", state.current_func->name, cpu_suffix(state.current_func_ver->cpu));
1097  va_start(arg, msg);
1098  vfprintf(stderr, msg, arg);
1099  va_end(arg);
1100  fprintf(stderr, ")\n");
1101 
1102  state.current_func_ver->ok = 0;
1103  state.num_failed++;
1104  }
1105  return state.verbose;
1106 }
1107 
1109  state.catch_signals = enabled;
1110 }
1111 
1113  if (s) {
1114 #ifdef __GLIBC__
1115  checkasm_fail_func("fatal signal %d: %s", s, strsignal(s));
1116 #else
1117  checkasm_fail_func(s == SIGFPE ? "fatal arithmetic error" :
1118  s == SIGILL ? "illegal instruction" :
1119  s == SIGBUS ? "bus error" :
1120  "segmentation fault");
1121 #endif
1122  }
1123  return s;
1124 }
1125 
1126 /* Get the benchmark context of the current function */
1128 {
1129  CheckasmPerf *perf = &state.current_func_ver->perf;
1130  memset(perf, 0, sizeof(*perf));
1131  perf->sysfd = state.sysfd;
1132  return perf;
1133 }
1134 
1135 /* Print the outcome of all tests performed since the last time this function was called */
1136 void checkasm_report(const char *name, ...)
1137 {
1138  static int prev_checked, prev_failed, max_length;
1139 
1140  if (state.num_checked > prev_checked) {
1141  int pad_length = max_length + 4;
1142  va_list arg;
1143 
1144  print_cpu_name();
1145  pad_length -= fprintf(stderr, " - %s.", state.current_test_name);
1146  va_start(arg, name);
1147  pad_length -= vfprintf(stderr, name, arg);
1148  va_end(arg);
1149  fprintf(stderr, "%*c", FFMAX(pad_length, 0) + 2, '[');
1150 
1151  if (state.num_failed == prev_failed)
1152  color_printf(COLOR_GREEN, "OK");
1153  else
1154  color_printf(COLOR_RED, "FAILED");
1155  fprintf(stderr, "]\n");
1156 
1157  prev_checked = state.num_checked;
1158  prev_failed = state.num_failed;
1159  } else if (!state.cpu_flag) {
1160  /* Calculate the amount of padding required to make the output vertically aligned */
1161  int length = strlen(state.current_test_name);
1162  va_list arg;
1163 
1164  va_start(arg, name);
1165  length += vsnprintf(NULL, 0, name, arg);
1166  va_end(arg);
1167 
1168  if (length > max_length)
1169  max_length = length;
1170  }
1171 }
1172 
1173 static int check_err(const char *file, int line,
1174  const char *name, int w, int h,
1175  int *err)
1176 {
1177  if (*err)
1178  return 0;
1179  if (!checkasm_fail_func("%s:%d", file, line))
1180  return 1;
1181  *err = 1;
1182  fprintf(stderr, "%s (%dx%d):\n", name, w, h);
1183  return 0;
1184 }
1185 
1186 #define DEF_CHECKASM_CHECK_FUNC(type, fmt) \
1187 int checkasm_check_##type(const char *file, int line, \
1188  const type *buf1, ptrdiff_t stride1, \
1189  const type *buf2, ptrdiff_t stride2, \
1190  int w, int h, const char *name, \
1191  int align_w, int align_h, \
1192  int padding) \
1193 { \
1194  int64_t aligned_w = (w - 1LL + align_w) & ~(align_w - 1); \
1195  int64_t aligned_h = (h - 1LL + align_h) & ~(align_h - 1); \
1196  int err = 0; \
1197  int y = 0; \
1198  av_assert0(aligned_w == (int32_t)aligned_w);\
1199  av_assert0(aligned_h == (int32_t)aligned_h);\
1200  stride1 /= sizeof(*buf1); \
1201  stride2 /= sizeof(*buf2); \
1202  for (y = 0; y < h; y++) \
1203  if (memcmp(&buf1[y*stride1], &buf2[y*stride2], w*sizeof(*buf1))) \
1204  break; \
1205  if (y != h) { \
1206  if (check_err(file, line, name, w, h, &err)) \
1207  return 1; \
1208  for (y = 0; y < h; y++) { \
1209  for (int x = 0; x < w; x++) \
1210  fprintf(stderr, " " fmt, buf1[x]); \
1211  fprintf(stderr, " "); \
1212  for (int x = 0; x < w; x++) \
1213  fprintf(stderr, " " fmt, buf2[x]); \
1214  fprintf(stderr, " "); \
1215  for (int x = 0; x < w; x++) \
1216  fprintf(stderr, "%c", buf1[x] != buf2[x] ? 'x' : '.'); \
1217  buf1 += stride1; \
1218  buf2 += stride2; \
1219  fprintf(stderr, "\n"); \
1220  } \
1221  buf1 -= h*stride1; \
1222  buf2 -= h*stride2; \
1223  } \
1224  for (y = -padding; y < 0; y++) \
1225  if (memcmp(&buf1[y*stride1 - padding], &buf2[y*stride2 - padding], \
1226  (w + 2*padding)*sizeof(*buf1))) { \
1227  if (check_err(file, line, name, w, h, &err)) \
1228  return 1; \
1229  fprintf(stderr, " overwrite above\n"); \
1230  break; \
1231  } \
1232  for (y = aligned_h; y < aligned_h + padding; y++) \
1233  if (memcmp(&buf1[y*stride1 - padding], &buf2[y*stride2 - padding], \
1234  (w + 2*padding)*sizeof(*buf1))) { \
1235  if (check_err(file, line, name, w, h, &err)) \
1236  return 1; \
1237  fprintf(stderr, " overwrite below\n"); \
1238  break; \
1239  } \
1240  for (y = 0; y < h; y++) \
1241  if (memcmp(&buf1[y*stride1 - padding], &buf2[y*stride2 - padding], \
1242  padding*sizeof(*buf1))) { \
1243  if (check_err(file, line, name, w, h, &err)) \
1244  return 1; \
1245  fprintf(stderr, " overwrite left\n"); \
1246  break; \
1247  } \
1248  for (y = 0; y < h; y++) \
1249  if (memcmp(&buf1[y*stride1 + aligned_w], &buf2[y*stride2 + aligned_w], \
1250  padding*sizeof(*buf1))) { \
1251  if (check_err(file, line, name, w, h, &err)) \
1252  return 1; \
1253  fprintf(stderr, " overwrite right\n"); \
1254  break; \
1255  } \
1256  return err; \
1257 }
1258 
1259 DEF_CHECKASM_CHECK_FUNC(uint8_t, "%02x")
1260 DEF_CHECKASM_CHECK_FUNC(uint16_t, "%04x")
1261 DEF_CHECKASM_CHECK_FUNC(uint32_t, "%08x")
1262 DEF_CHECKASM_CHECK_FUNC(int16_t, "%6d")
checkasm_check_nlmeans
void checkasm_check_nlmeans(void)
Definition: vf_nlmeans.c:32
AV_CPU_FLAG_VFP
#define AV_CPU_FLAG_VFP
Definition: cpu.h:68
checkasm_check_sw_gbrp
void checkasm_check_sw_gbrp(void)
Definition: sw_gbrp.c:398
bench_pattern_len
int bench_pattern_len
Definition: checkasm.c:397
av_force_cpu_flags
void av_force_cpu_flags(int arg)
Disables cpu detection and forces the specified flags.
Definition: cpu.c:81
checkasm_check_vp8dsp
void checkasm_check_vp8dsp(void)
Definition: vp8dsp.c:511
checkasm_check_blockdsp
void checkasm_check_blockdsp(void)
Definition: blockdsp.c:78
AV_CPU_FLAG_SSE3
#define AV_CPU_FLAG_SSE3
Prescott SSE3 functions.
Definition: cpu.h:39
checkasm_check_fdctdsp
void checkasm_check_fdctdsp(void)
Definition: fdctdsp.c:67
destroy_func_tree
static void destroy_func_tree(CheckasmFunc *f)
Definition: checkasm.c:556
r
const char * r
Definition: vf_curves.c:127
checkasm_check_videodsp
void checkasm_check_videodsp(void)
Definition: videodsp.c:80
cmp_nop
static int cmp_nop(const void *a, const void *b)
Definition: checkasm.c:596
checkasm_check_vf_eq
void checkasm_check_vf_eq(void)
Definition: vf_eq.c:76
AV_CPU_FLAG_RVB_BASIC
#define AV_CPU_FLAG_RVB_BASIC
Basic bit-manipulations.
Definition: cpu.h:96
COLOR_RED
#define COLOR_RED
Definition: checkasm.c:85
wildstrcmp
static int wildstrcmp(const char *str, const char *pattern)
Definition: checkasm.c:792
checkasm_lfg
AVLFG checkasm_lfg
Definition: checkasm.c:415
color
Definition: vf_paletteuse.c:513
av_lfg_init
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
Definition: lfg.c:32
u
#define u(width, name, range_min, range_max)
Definition: cbs_h2645.c:251
checkasm_check_alacdsp
void checkasm_check_alacdsp(void)
Definition: alacdsp.c:116
AV_CPU_FLAG_LSX
#define AV_CPU_FLAG_LSX
Definition: cpu.h:83
checkasm_check_v210dec
void checkasm_check_v210dec(void)
Definition: v210dec.c:47
float_near_abs_eps_array
int float_near_abs_eps_array(const float *a, const float *b, float eps, unsigned len)
Definition: checkasm.c:464
AV_CPU_FLAG_SSE3SLOW
#define AV_CPU_FLAG_SSE3SLOW
SSE3 supported, but usually not faster.
Definition: cpu.h:40
CheckasmFunc
Definition: checkasm.c:383
checkasm_check_sw_yuv2yuv
void checkasm_check_sw_yuv2yuv(void)
Definition: sw_yuv2yuv.c:131
name
const char * name
Definition: checkasm.c:115
checkasm_fail_func
int checkasm_fail_func(const char *msg,...)
Definition: checkasm.c:1088
bench_pattern
const char * bench_pattern
Definition: checkasm.c:396
AV_CPU_FLAG_RV_ZVBB
#define AV_CPU_FLAG_RV_ZVBB
Vector basic bit-manipulations.
Definition: cpu.h:100
int64_t
long long int64_t
Definition: coverity.c:34
av_unused
#define av_unused
Definition: attributes.h:131
checkasm_check_hevc_idct
void checkasm_check_hevc_idct(void)
Definition: hevc_idct.c:108
checkasm_check_sw_scale
void checkasm_check_sw_scale(void)
Definition: sw_scale.c:437
CheckasmFunc::child
struct CheckasmFunc * child[2]
Definition: checkasm.c:384
AV_CPU_FLAG_SVE2
#define AV_CPU_FLAG_SVE2
Definition: cpu.h:76
checkasm_check_afir
void checkasm_check_afir(void)
Definition: af_afir.c:144
checkasm_check_aes
void checkasm_check_aes(void)
Definition: aes.c:28
print_cpu_name
static void print_cpu_name(void)
Definition: checkasm.c:831
AV_CPU_FLAG_3DNOW
#define AV_CPU_FLAG_3DNOW
AMD 3DNOW.
Definition: cpu.h:33
w
uint8_t w
Definition: llviddspenc.c:38
av_intfloat32::i
uint32_t i
Definition: intfloat.h:28
AV_CPU_FLAG_SVE
#define AV_CPU_FLAG_SVE
Definition: cpu.h:75
float_near_abs_eps
int float_near_abs_eps(float a, float b, float eps)
Definition: checkasm.c:453
b
#define b
Definition: input.c:42
checkasm_check_aacpsdsp
void checkasm_check_aacpsdsp(void)
Definition: aacpsdsp.c:234
bench_uninit
static void bench_uninit(void)
Definition: checkasm.c:907
CheckasmFuncVersion::cpu
int cpu
Definition: checkasm.c:378
cpu_flag
int cpu_flag
Definition: checkasm.c:405
AV_CPU_FLAG_DOTPROD
#define AV_CPU_FLAG_DOTPROD
Definition: cpu.h:73
FFMAX
#define FFMAX(a, b)
Definition: macros.h:47
av_get_cpu_flags
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition: cpu.c:109
cpu_suffix
static const char * cpu_suffix(int cpu)
Definition: checkasm.c:585
CheckasmPerf::sysfd
int sysfd
Definition: checkasm.h:317
checkasm_check_llviddspenc
void checkasm_check_llviddspenc(void)
Definition: llviddspenc.c:104
intfloat.h
checkasm_check_h264dsp
void checkasm_check_h264dsp(void)
Definition: h264dsp.c:452
tf_sess_config.config
config
Definition: tf_sess_config.py:33
color_printf
static void color_printf(int color, const char *fmt,...)
Definition: checkasm.c:513
AV_CPU_FLAG_RVV_F64
#define AV_CPU_FLAG_RVV_F64
Vectors of double's.
Definition: cpu.h:95
av_get_random_seed
uint32_t av_get_random_seed(void)
Get a seed to use in conjunction with random functions.
Definition: random_seed.c:196
main
int main(int argc, char *argv[])
Definition: checkasm.c:927
state
static struct @488 state
checkasm_check_motion
void checkasm_check_motion(void)
Definition: motion.c:137
checkasm_check_h263dsp
void checkasm_check_h263dsp(void)
Definition: h263dsp.c:54
AV_CPU_FLAG_RVB
#define AV_CPU_FLAG_RVB
B (bit manipulations)
Definition: cpu.h:102
AV_CPU_FLAG_SSSE3
#define AV_CPU_FLAG_SSSE3
Conroe SSSE3 functions.
Definition: cpu.h:42
double_near_abs_eps
int double_near_abs_eps(double a, double b, double eps)
Definition: checkasm.c:493
CheckasmPerf
Definition: checkasm.h:316
current_test_name
const char * current_test_name
Definition: checkasm.c:395
PERF_START
#define PERF_START(t)
Definition: checkasm.h:375
rotate_tree
static CheckasmFunc * rotate_tree(CheckasmFunc *f, int dir)
Definition: checkasm.c:683
dummy
int dummy
Definition: motion.c:66
AV_CPU_FLAG_XOP
#define AV_CPU_FLAG_XOP
Bulldozer XOP functions.
Definition: cpu.h:50
checkasm_check_vp9dsp
void checkasm_check_vp9dsp(void)
Definition: vp9dsp.c:627
checkasm.h
checkasm_check_vf_threshold
void checkasm_check_vf_threshold(void)
Definition: vf_threshold.c:79
checkasm_check_vf_gblur
void checkasm_check_vf_gblur(void)
Definition: vf_gblur.c:82
AV_CPU_FLAG_3DNOWEXT
#define AV_CPU_FLAG_3DNOWEXT
AMD 3DNowExt.
Definition: cpu.h:38
float_near_abs_eps_ulp
int float_near_abs_eps_ulp(float a, float b, float eps, unsigned max_ulp)
Definition: checkasm.c:476
have_sve
#define have_sve(flags)
Definition: cpu.h:30
checkasm_check_vvc_mc
void checkasm_check_vvc_mc(void)
Definition: vvc_mc.c:471
AV_CPU_FLAG_VSX
#define AV_CPU_FLAG_VSX
ISA 2.06.
Definition: cpu.h:62
fabsf
static __device__ float fabsf(float a)
Definition: cuda_runtime.h:181
checkasm_check_sw_yuv2rgb
void checkasm_check_sw_yuv2rgb(void)
Definition: sw_yuv2rgb.c:233
AV_CPU_FLAG_RVV_F32
#define AV_CPU_FLAG_RVV_F32
Vectors of float's *‍/.
Definition: cpu.h:93
num_failed
int num_failed
Definition: checkasm.c:399
checkasm_check_float_dsp
void checkasm_check_float_dsp(void)
Definition: float_dsp.c:297
AV_CPU_FLAG_AVX512
#define AV_CPU_FLAG_AVX512
AVX-512 functions: requires OS support even if YMM/ZMM registers aren't used.
Definition: cpu.h:57
bench_init
static int bench_init(void)
Definition: checkasm.c:890
avassert.h
checkasm_check_pixblockdsp
void checkasm_check_pixblockdsp(void)
Definition: pixblockdsp.c:82
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen.c:29
CheckasmFuncVersion
Definition: checkasm.c:374
COLOR_YELLOW
#define COLOR_YELLOW
Definition: checkasm.c:87
nop_time
int nop_time
Definition: checkasm.c:402
CheckasmFuncVersion::perf
CheckasmPerf perf
Definition: checkasm.c:379
s
#define s(width, name)
Definition: cbs_vp9.c:198
checkasm_check_vf_bwdif
void checkasm_check_vf_bwdif(void)
Definition: vf_bwdif.c:72
checkasm_report
void checkasm_report(const char *name,...)
Definition: checkasm.c:1136
get_func
static CheckasmFunc * get_func(CheckasmFunc **root, const char *name)
Definition: checkasm.c:712
cpu.h
checkasm_check_sw_rgb
void checkasm_check_sw_rgb(void)
Definition: sw_rgb.c:804
checkasm_check_hevc_sao
void checkasm_check_hevc_sao(void)
Definition: hevc_sao.c:141
num_checked
int num_checked
Definition: checkasm.c:398
AV_CPU_FLAG_ARMV6
#define AV_CPU_FLAG_ARMV6
Definition: cpu.h:66
AV_READ_TIME
#define AV_READ_TIME
Definition: timer.h:28
AV_CPU_FLAG_SSE4
#define AV_CPU_FLAG_SSE4
Penryn SSE4.1 functions.
Definition: cpu.h:45
checkasm_check_hevc_pel
void checkasm_check_hevc_pel(void)
Definition: hevc_pel.c:621
checkasm_set_signal_handler_state
void checkasm_set_signal_handler_state(int enabled)
Definition: checkasm.c:1108
CheckasmPerf::iterations
int iterations
Definition: checkasm.h:319
CheckasmFuncVersion::ok
int ok
Definition: checkasm.c:377
arg
const char * arg
Definition: jacosubdec.c:67
func
void(* func)(void)
Definition: checkasm.c:116
fabs
static __device__ float fabs(float a)
Definition: cuda_runtime.h:182
NULL
#define NULL
Definition: coverity.c:32
measure_nop_time
static int measure_nop_time(void)
Definition: checkasm.c:602
checkasm_check_takdsp
void checkasm_check_takdsp(void)
Definition: takdsp.c:145
double_near_abs_eps_array
int double_near_abs_eps_array(const double *a, const double *b, double eps, unsigned len)
Definition: checkasm.c:500
AV_CPU_FLAG_LASX
#define AV_CPU_FLAG_LASX
Definition: cpu.h:84
AV_CPU_FLAG_AVX512ICL
#define AV_CPU_FLAG_AVX512ICL
F/CD/BW/DQ/VL/VNNI/IFMA/VBMI/VBMI2/VPOPCNTDQ/BITALG/GFNI/VAES/VPCLMULQDQ.
Definition: cpu.h:58
checkasm_check_fmtconvert
void checkasm_check_fmtconvert(void)
Definition: fmtconvert.c:46
checkasm_load_context
#define checkasm_load_context(s)
Definition: checkasm.h:77
AV_CPU_FLAG_MSA
#define AV_CPU_FLAG_MSA
Definition: cpu.h:80
checkasm_save_context
#define checkasm_save_context()
Definition: checkasm.h:76
COLOR_GREEN
#define COLOR_GREEN
Definition: checkasm.c:86
checkasm_check_aacencdsp
void checkasm_check_aacencdsp(void)
Definition: aacencdsp.c:100
checkasm_check_vorbisdsp
void checkasm_check_vorbisdsp(void)
Definition: vorbisdsp.c:76
cpu.h
double
double
Definition: af_crystalizer.c:132
av_intfloat32
Definition: intfloat.h:27
AV_CPU_FLAG_CMOV
#define AV_CPU_FLAG_CMOV
supports cmov instruction
Definition: cpu.h:52
seed
static unsigned int seed
Definition: videogen.c:78
close
av_cold void CBS_FUNC() close(CodedBitstreamContext **ctx_ptr)
Close a context and free all internal state.
Definition: cbs.c:140
AV_CPU_FLAG_ALTIVEC
#define AV_CPU_FLAG_ALTIVEC
standard
Definition: cpu.h:61
checkasm_check_rv40dsp
void checkasm_check_rv40dsp(void)
Definition: rv40dsp.c:71
print_benchs
static void print_benchs(CheckasmFunc *f)
Definition: checkasm.c:633
current_func
CheckasmFunc * current_func
Definition: checkasm.c:393
AV_CPU_FLAG_I8MM
#define AV_CPU_FLAG_I8MM
Definition: cpu.h:74
checkasm_check_vc1dsp
void checkasm_check_vc1dsp(void)
Definition: vc1dsp.c:476
catch_signals
volatile sig_atomic_t catch_signals
Definition: checkasm.c:411
checkasm_check_h264chroma
void checkasm_check_h264chroma(void)
Definition: h264chroma.c:81
AV_CPU_FLAG_SSE2
#define AV_CPU_FLAG_SSE2
PIV SSE2 functions.
Definition: cpu.h:35
CheckasmFunc::color
uint8_t color
Definition: checkasm.c:386
AVLFG
Context structure for the Lagged Fibonacci PRNG.
Definition: lfg.h:33
f
f
Definition: af_crystalizer.c:122
checkasm_check_llauddsp
void checkasm_check_llauddsp(void)
Definition: llauddsp.c:108
AV_CPU_FLAG_AVX
#define AV_CPU_FLAG_AVX
AVX functions: requires OS support even if YMM registers aren't used.
Definition: cpu.h:48
csv
int csv
Definition: checkasm.c:409
AV_CPU_FLAG_FMA4
#define AV_CPU_FLAG_FMA4
Bulldozer FMA4 functions.
Definition: cpu.h:51
cpu.h
AV_CPU_FLAG_AVX2
#define AV_CPU_FLAG_AVX2
AVX2 functions: requires OS support even if YMM registers aren't used.
Definition: cpu.h:53
checkasm_check_llviddsp
void checkasm_check_llviddsp(void)
Definition: llviddsp.c:195
checkasm_handle_signal
int checkasm_handle_signal(int s)
Definition: checkasm.c:1112
AV_CPU_FLAG_SSE2SLOW
#define AV_CPU_FLAG_SSE2SLOW
SSE2 supported, but usually not faster.
Definition: cpu.h:36
AV_CPU_FLAG_NEON
#define AV_CPU_FLAG_NEON
Definition: cpu.h:70
size
int size
Definition: twinvq_data.h:10344
checkasm_check_diracdsp
void checkasm_check_diracdsp(void)
Definition: diracdsp.c:85
DEF_CHECKASM_CHECK_FUNC
#define DEF_CHECKASM_CHECK_FUNC(type, fmt)
Definition: checkasm.c:1186
printf
printf("static const uint8_t my_array[100] = {\n")
sysfd
int sysfd
Definition: checkasm.c:403
cmp
static av_always_inline int cmp(MPVEncContext *const s, const int x, const int y, const int subx, const int suby, const int size, const int h, int ref_index, int src_index, me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags)
compares a block (either a full macroblock or a partition thereof) against a proposed motion-compensa...
Definition: motion_est.c:263
have_neon
#define have_neon(flags)
Definition: cpu.h:26
CheckasmFuncVersion::func
void * func
Definition: checkasm.c:376
checkasm_check_h264pred
void checkasm_check_h264pred(void)
Definition: h264pred.c:233
av_isdigit
static av_const int av_isdigit(int c)
Locale-independent conversion of ASCII isdigit.
Definition: avstring.h:202
AV_CPU_FLAG_FMA3
#define AV_CPU_FLAG_FMA3
Haswell FMA3 functions.
Definition: cpu.h:54
a
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:41
ff_kperf_init
void ff_kperf_init(void)
Definition: macos_kperf.c:102
bench_runs
uint64_t bench_runs
Definition: checkasm.c:111
checkasm_check_huffyuvdsp
void checkasm_check_huffyuvdsp(void)
Definition: huffyuvdsp.c:95
line
Definition: graph2dot.c:48
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: checkasm.c:481
CheckasmPerf::cycles
uint64_t cycles
Definition: checkasm.h:318
checkasm_get_perf_context
CheckasmPerf * checkasm_get_perf_context(void)
Definition: checkasm.c:1127
checkasm_check_fixed_dsp
void checkasm_check_fixed_dsp(void)
Definition: fixed_dsp.c:133
checkasm_check_colorspace
void checkasm_check_colorspace(void)
Definition: vf_colorspace.c:309
checkasm_check_utvideodsp
void checkasm_check_utvideodsp(void)
Definition: utvideodsp.c:90
is_negative
static int is_negative(union av_intfloat32 u)
Definition: checkasm.c:418
checkasm_check_audiodsp
void checkasm_check_audiodsp(void)
Definition: audiodsp.c:52
checkasm_check_sw_range_convert
void checkasm_check_sw_range_convert(void)
Definition: sw_range_convert.c:224
AV_CPU_FLAG_RV_MISALIGNED
#define AV_CPU_FLAG_RV_MISALIGNED
Fast misaligned accesses.
Definition: cpu.h:101
checkasm_check_mpegvideoencdsp
void checkasm_check_mpegvideoencdsp(void)
Definition: mpegvideoencdsp.c:132
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
AV_CPU_FLAG_SIMD128
#define AV_CPU_FLAG_SIMD128
Definition: cpu.h:105
checkasm_check_flacdsp
void checkasm_check_flacdsp(void)
Definition: flacdsp.c:155
checkasm_check_func
void * checkasm_check_func(void *func, const char *name,...)
Definition: checkasm.c:1033
AV_CPU_FLAG_SSE42
#define AV_CPU_FLAG_SSE42
Nehalem SSE4.2 functions.
Definition: cpu.h:46
checkasm_check_idctdsp
void checkasm_check_idctdsp(void)
Definition: idctdsp.c:95
CheckasmFuncVersion::next
struct CheckasmFuncVersion * next
Definition: checkasm.c:375
vsnprintf
#define vsnprintf
Definition: snprintf.h:36
common.h
use_color
static int use_color
Definition: log.c:125
AV_CPU_FLAG_RVV_I32
#define AV_CPU_FLAG_RVV_I32
Vectors of 8/16/32-bit int's *‍/.
Definition: cpu.h:92
checkasm_check_synth_filter
void checkasm_check_synth_filter(void)
Definition: synth_filter.c:47
cmp_func_names
static int cmp_func_names(const char *a, const char *b)
Definition: checkasm.c:668
AV_CPU_FLAG_ARMV8
#define AV_CPU_FLAG_ARMV8
Definition: cpu.h:71
checkasm_check_lpc
void checkasm_check_lpc(void)
Definition: lpc.c:96
len
int len
Definition: vorbis_enc_data.h:426
checkasm_check_g722dsp
void checkasm_check_g722dsp(void)
Definition: g722dsp.c:53
checkasm_check_ac3dsp
void checkasm_check_ac3dsp(void)
Definition: ac3dsp.c:193
PERF_STOP
#define PERF_STOP(t)
Definition: checkasm.h:376
is_red
#define is_red(f)
Definition: checkasm.c:693
AV_CPU_FLAG_ATOM
#define AV_CPU_FLAG_ATOM
Atom processor, some SSSE3 instructions are slower.
Definition: cpu.h:44
have_vfp
#define have_vfp(flags)
Definition: cpu.h:27
checkasm_check_svq1enc
void checkasm_check_svq1enc(void)
Definition: svq1enc.c:63
checkasm_check_vf_hflip
void checkasm_check_vf_hflip(void)
Definition: vf_hflip.c:72
ret
ret
Definition: filter_design.txt:187
checkasm_check_lls
void checkasm_check_lls(void)
Definition: lls.c:84
checkasm_check_blend
void checkasm_check_blend(void)
Definition: vf_blend.c:89
verbose
int verbose
Definition: checkasm.c:408
AV_CPU_FLAG_VFPV3
#define AV_CPU_FLAG_VFPV3
Definition: cpu.h:69
checkasm_check_bswapdsp
void checkasm_check_bswapdsp(void)
Definition: bswapdsp.c:60
checkasm_context_buf
checkasm_context checkasm_context_buf
Definition: checkasm.c:736
U
#define U(x)
Definition: vpx_arith.h:37
AV_CPU_FLAG_ARMV5TE
#define AV_CPU_FLAG_ARMV5TE
Definition: cpu.h:65
AV_CPU_FLAG_MMX
#define AV_CPU_FLAG_MMX
standard MMX
Definition: cpu.h:30
suffix
const char * suffix
Definition: checkasm.c:311
checkasm_malloc
static void * checkasm_malloc(size_t size)
Definition: checkasm.c:573
cpus
static const struct @487 cpus[]
AV_CPU_FLAG_RVI
#define AV_CPU_FLAG_RVI
I (full GPR bank)
Definition: cpu.h:87
checkasm_check_h264qpel
void checkasm_check_h264qpel(void)
Definition: h264qpel.c:51
random_seed.h
signal_handler
static void signal_handler(int s)
Definition: checkasm.c:782
AV_CPU_FLAG_AESNI
#define AV_CPU_FLAG_AESNI
Advanced Encryption Standard functions.
Definition: cpu.h:47
checkasm_bench_func
int checkasm_bench_func(void)
Definition: checkasm.c:1080
tests
static const struct @486 tests[]
AV_CPU_FLAG_POWER8
#define AV_CPU_FLAG_POWER8
ISA 2.07.
Definition: cpu.h:63
cpu_flag_name
const char * cpu_flag_name
Definition: checkasm.c:406
checkasm_check_vf_sobel
void checkasm_check_vf_sobel(void)
Definition: vf_convolution.c:100
AV_CPU_FLAG_SSE
#define AV_CPU_FLAG_SSE
SSE functions.
Definition: cpu.h:34
ref
static int ref[MAX_W *MAX_W]
Definition: jpeg2000dwt.c:117
float_near_ulp_array
int float_near_ulp_array(const float *a, const float *b, unsigned max_ulp, unsigned len)
Definition: checkasm.c:441
signal_handler_act
static const struct sigaction signal_handler_act
Definition: checkasm.c:777
AV_CPU_FLAG_MMXEXT
#define AV_CPU_FLAG_MMXEXT
SSE integer functions or AMD MMX ext.
Definition: cpu.h:31
checkasm_check_av_tx
void checkasm_check_av_tx(void)
Definition: av_tx.c:102
av_intfloat32::f
float f
Definition: intfloat.h:29
flag
int flag
Definition: checkasm.c:312
checkasm_check_v210enc
void checkasm_check_v210enc(void)
Definition: v210enc.c:83
checkasm_check_sbrdsp
void checkasm_check_sbrdsp(void)
Definition: sbrdsp.c:257
checkasm_check_hevc_deblock
void checkasm_check_hevc_deblock(void)
Definition: hevc_deblock.c:264
test_pattern
const char * test_pattern
Definition: checkasm.c:407
usage
static int usage(const char *path)
Definition: checkasm.c:914
AV_CPU_FLAG_VFP_VM
#define AV_CPU_FLAG_VFP_VM
VFPv2 vector mode, deprecated in ARMv7-A and unavailable in various CPUs implementations.
Definition: cpu.h:72
AV_CPU_FLAG_MMI
#define AV_CPU_FLAG_MMI
Definition: cpu.h:79
checkasm_check_jpeg2000dsp
void checkasm_check_jpeg2000dsp(void)
Definition: jpeg2000dsp.c:92
checkasm_check_hevc_add_res
void checkasm_check_hevc_add_res(void)
Definition: hevc_add_res.c:87
int32_t
int32_t
Definition: audioconvert.c:56
float_near_ulp
int float_near_ulp(float a, float b, unsigned max_ulp)
Definition: checkasm.c:423
current_func_ver
CheckasmFuncVersion * current_func_ver
Definition: checkasm.c:394
check_cpu_flag
static void check_cpu_flag(const char *name, int flag)
Definition: checkasm.c:808
checkasm_context
sigjmp_buf checkasm_context
Definition: checkasm.h:75
bench_init_ffmpeg
static int bench_init_ffmpeg(void)
Definition: checkasm.c:870
checkasm_check_rv34dsp
void checkasm_check_rv34dsp(void)
Definition: rv34dsp.c:82
CheckasmFunc::versions
CheckasmFuncVersion versions
Definition: checkasm.c:385
isatty
#define isatty(fd)
Definition: checkasm.c:95
h
h
Definition: vp9dsp_template.c:2070
avg_cycles_per_call
static double avg_cycles_per_call(const CheckasmPerf *const p)
Definition: checkasm.c:622
AV_CPU_FLAG_RVV_I64
#define AV_CPU_FLAG_RVV_I64
Vectors of 64-bit int's *‍/.
Definition: cpu.h:94
check_err
static int check_err(const char *file, int line, const char *name, int w, int h, int *err)
Definition: checkasm.c:1173
cpu.h
CheckasmFunc::name
char name[1]
Definition: checkasm.c:387
checkasm_check_vvc_alf
void checkasm_check_vvc_alf(void)
Definition: vvc_alf.c:178
snprintf
#define snprintf
Definition: snprintf.h:34
av_log2
int av_log2(unsigned v)
Definition: intmath.c:26
checkasm_check_exrdsp
void checkasm_check_exrdsp(void)
Definition: exrdsp.c:77
balance_tree
static void balance_tree(CheckasmFunc **root)
Definition: checkasm.c:696
AV_CPU_FLAG_ARMV6T2
#define AV_CPU_FLAG_ARMV6T2
Definition: cpu.h:67
tsv
int tsv
Definition: checkasm.c:410
funcs
CheckasmFunc * funcs
Definition: checkasm.c:392
checkasm_check_opusdsp
void checkasm_check_opusdsp(void)
Definition: opusdsp.c:86