xref: /aosp_15_r20/external/libyuv/docs/environment_variables.md (revision 4e366538070a3a6c5c163c31b791eab742e1657a)
1# Introduction
2
3For test purposes, environment variables can be set to control libyuv behavior.  These should only be used for testing, to narrow down bugs or to test performance.
4
5# CPU
6
7By default the cpu is detected and the most advanced form of SIMD is used.  But you can disable instruction sets selectively, or completely, falling back on C code.  Set the variable to 1 to disable the specified instruction set.
8
9## All CPUs
10    LIBYUV_DISABLE_ASM
11
12## Intel CPUs
13    LIBYUV_DISABLE_X86
14    LIBYUV_DISABLE_SSE2
15    LIBYUV_DISABLE_SSSE3
16    LIBYUV_DISABLE_SSE41
17    LIBYUV_DISABLE_SSE42
18    LIBYUV_DISABLE_AVX
19    LIBYUV_DISABLE_AVX2
20    LIBYUV_DISABLE_ERMS
21    LIBYUV_DISABLE_FMA3
22    LIBYUV_DISABLE_F16C
23    LIBYUV_DISABLE_AVX512BW
24    LIBYUV_DISABLE_AVX512VL
25    LIBYUV_DISABLE_AVX512VNNI
26    LIBYUV_DISABLE_AVX512VBMI
27    LIBYUV_DISABLE_AVX512VBMI2
28    LIBYUV_DISABLE_AVX512VBITALG
29    LIBYUV_DISABLE_AVX512VPOPCNTDQ
30    LIBYUV_DISABLE_GFNI
31
32## ARM CPUs
33
34    LIBYUV_DISABLE_NEON
35
36## MIPS CPUs
37    LIBYUV_DISABLE_MSA
38
39## LOONGARCH CPUs
40    LIBYUV_DISABLE_LSX
41    LIBYUV_DISABLE_LASX
42
43## RISCV CPUs
44    LIBYUV_DISABLE_RVV
45
46# Test Width/Height/Repeat
47
48The unittests default to a small image (128x72) to run fast.  This can be set by environment variable to test a specific resolutions.
49You can also repeat the test a specified number of iterations, allowing benchmarking and profiling.
50
51    set LIBYUV_WIDTH=1280
52    set LIBYUV_HEIGHT=720
53    set LIBYUV_REPEAT=999
54    set LIBYUV_FLAGS=-1
55    set LIBYUV_CPU_INFO=-1
56