Loading...
Searching...
No Matches
cpu.h File Reference
`#include <stddef.h>`
`#include "version.h"`

Go to the source code of this file.

## Macros

#define | AV_CPU_FLAG_MMX 0x0001
| standard MMX
#define | AV_CPU_FLAG_MMXEXT 0x0002
| SSE integer functions or AMD MMX ext.
#define | AV_CPU_FLAG_MMX2 0x0002
| SSE integer functions or AMD MMX ext.
#define | AV_CPU_FLAG_3DNOW 0x0004
| AMD 3DNOW.
#define | AV_CPU_FLAG_SSE 0x0008
| SSE functions.
#define | AV_CPU_FLAG_SSE2 0x0010
| PIV SSE2 functions.
#define | AV_CPU_FLAG_SSE2SLOW 0x40000000
| SSE2 supported, but usually not faster than regular MMX/SSE (e.g.
#define | AV_CPU_FLAG_3DNOWEXT 0x0020
| AMD 3DNowExt.
#define | AV_CPU_FLAG_SSE3 0x0040
| Prescott SSE3 functions.
#define | AV_CPU_FLAG_SSE3SLOW 0x20000000
| SSE3 supported, but usually not faster than regular MMX/SSE (e.g.
#define | AV_CPU_FLAG_SSSE3 0x0080
| Conroe SSSE3 functions.
#define | AV_CPU_FLAG_SSSE3SLOW 0x4000000
| SSSE3 supported, but usually not faster.
#define | AV_CPU_FLAG_ATOM 0x10000000
| Atom processor, some SSSE3 instructions are slower.
#define | AV_CPU_FLAG_SSE4 0x0100
| Penryn SSE4.1 functions.
#define | AV_CPU_FLAG_SSE42 0x0200
| Nehalem SSE4.2 functions.
#define | AV_CPU_FLAG_AESNI 0x80000
| Advanced Encryption Standard functions.
#define | AV_CPU_FLAG_CLMUL 0x400000
| Carry-less Multiplication instruction.
#define | AV_CPU_FLAG_AVX 0x4000
| AVX functions: requires OS support even if YMM registers aren't used.
#define | AV_CPU_FLAG_AVXSLOW 0x8000000
| AVX supported, but slow when using YMM registers (e.g. Bulldozer).
#define | AV_CPU_FLAG_XOP 0x0400
| Bulldozer XOP functions.
#define | AV_CPU_FLAG_FMA4 0x0800
| Bulldozer FMA4 functions.
#define | AV_CPU_FLAG_CMOV 0x1000
| supports cmov instruction
#define | AV_CPU_FLAG_AVX2 0x8000
| AVX2 functions: requires OS support even if YMM registers aren't used.
#define | AV_CPU_FLAG_FMA3 0x10000
| Haswell FMA3 functions.
#define | AV_CPU_FLAG_BMI1 0x20000
| Bit Manipulation Instruction Set 1.
#define | AV_CPU_FLAG_BMI2 0x40000
| Bit Manipulation Instruction Set 2.
#define | AV_CPU_FLAG_AVX512 0x100000
| AVX-512 functions: requires OS support even if YMM/ZMM registers aren't used.
#define | AV_CPU_FLAG_AVX512ICL 0x200000
| F/CD/BW/DQ/VL/VNNI/IFMA/VBMI/VBMI2/VPOPCNTDQ/BITALG/GFNI/VAES/VPCLMULQDQ.
#define | AV_CPU_FLAG_SLOW_GATHER 0x2000000
| CPU has slow gathers.
#define | AV_CPU_FLAG_ALTIVEC 0x0001
| standard
#define | AV_CPU_FLAG_VSX 0x0002
| ISA 2.06.
#define | AV_CPU_FLAG_POWER8 0x0004
| ISA 2.07.
#define | AV_CPU_FLAG_ARMV5TE (1 << 0)
#define | AV_CPU_FLAG_ARMV6 (1 << 1)
#define | AV_CPU_FLAG_ARMV6T2 (1 << 2)
#define | AV_CPU_FLAG_VFP (1 << 3)
#define | AV_CPU_FLAG_VFPV3 (1 << 4)
#define | AV_CPU_FLAG_NEON (1 << 5)
#define | AV_CPU_FLAG_ARMV8 (1 << 6)
#define | AV_CPU_FLAG_VFP_VM (1 << 7)
| VFPv2 vector mode, deprecated in ARMv7-A and unavailable in various CPUs implementations.
#define | AV_CPU_FLAG_DOTPROD (1 << 8)
#define | AV_CPU_FLAG_I8MM (1 << 9)
#define | AV_CPU_FLAG_SVE (1 <<10)
#define | AV_CPU_FLAG_SVE2 (1 <<11)
#define | AV_CPU_FLAG_SME (1 <<12)
#define | AV_CPU_FLAG_ARM_CRC (1 <<13)
#define | AV_CPU_FLAG_SME2 (1 <<14)
#define | AV_CPU_FLAG_SME_I16I64 (1 <<15)
#define | AV_CPU_FLAG_SETEND (1 <<16)
#define | AV_CPU_FLAG_MMI (1 << 0)
#define | AV_CPU_FLAG_MSA (1 << 1)
#define | AV_CPU_FLAG_LSX (1 << 0)
#define | AV_CPU_FLAG_LASX (1 << 1)
#define | AV_CPU_FLAG_RVI (1 << 0)
| I (full GPR bank).
#define | AV_CPU_FLAG_RVV_I32 (1 << 3)
| Vectors of 8/16/32-bit int's *‍/.
#define | AV_CPU_FLAG_RVV_F32 (1 << 4)
| Vectors of float's *‍/.
#define | AV_CPU_FLAG_RVV_I64 (1 << 5)
| Vectors of 64-bit int's *‍/.
#define | AV_CPU_FLAG_RVV_F64 (1 << 6)
| Vectors of double's.
#define | AV_CPU_FLAG_RVB_BASIC (1 << 7)
| Basic bit-manipulations.
#define | AV_CPU_FLAG_RV_ZVBB (1 << 9)
| Vector basic bit-manipulations.
#define | AV_CPU_FLAG_RV_MISALIGNED (1 <<10)
| Fast misaligned accesses.
#define | AV_CPU_FLAG_RVB (1 <<11)
| B (bit manipulations).
#define | AV_CPU_FLAG_SIMD128 (1 << 0)

## Functions

int | av_get_cpu_flags (void)
| Return the flags which specify extensions supported by the CPU.
void | av_force_cpu_flags (int flags)
| Disables cpu detection and forces the specified flags.
int | av_parse_cpu_caps (unsigned *flags, const char *s)
| Parse CPU caps from a string and update the given AV_CPU_* flags based on that.
int | av_cpu_count (void)
void | av_cpu_force_count (int count)
| Overrides cpu count detection and forces the specified count.
size_t | av_cpu_max_align (void)
| Get the maximum data alignment that may be required by FFmpeg.

## Macro Definition Documentation

## AV_CPU_FLAG_MMX

#define AV_CPU_FLAG_MMX 0x0001

standard MMX

Definition at line 32 of file cpu.h.

## AV_CPU_FLAG_MMXEXT

#define AV_CPU_FLAG_MMXEXT 0x0002

SSE integer functions or AMD MMX ext.

Definition at line 33 of file cpu.h.

## AV_CPU_FLAG_MMX2

#define AV_CPU_FLAG_MMX2 0x0002

SSE integer functions or AMD MMX ext.

Definition at line 34 of file cpu.h.

## AV_CPU_FLAG_3DNOW

#define AV_CPU_FLAG_3DNOW 0x0004

AMD 3DNOW.

Definition at line 35 of file cpu.h.

## AV_CPU_FLAG_SSE

#define AV_CPU_FLAG_SSE 0x0008

SSE functions.

Definition at line 36 of file cpu.h.

## AV_CPU_FLAG_SSE2

#define AV_CPU_FLAG_SSE2 0x0010

PIV SSE2 functions.

Definition at line 37 of file cpu.h.

## AV_CPU_FLAG_SSE2SLOW

#define AV_CPU_FLAG_SSE2SLOW 0x40000000

SSE2 supported, but usually not faster than regular MMX/SSE (e.g.

Core1)

Definition at line 38 of file cpu.h.

## AV_CPU_FLAG_3DNOWEXT

#define AV_CPU_FLAG_3DNOWEXT 0x0020

AMD 3DNowExt.

Definition at line 40 of file cpu.h.

## AV_CPU_FLAG_SSE3

#define AV_CPU_FLAG_SSE3 0x0040

Prescott SSE3 functions.

Definition at line 41 of file cpu.h.

## AV_CPU_FLAG_SSE3SLOW

#define AV_CPU_FLAG_SSE3SLOW 0x20000000

SSE3 supported, but usually not faster than regular MMX/SSE (e.g.

Core1)

Definition at line 42 of file cpu.h.

## AV_CPU_FLAG_SSSE3

#define AV_CPU_FLAG_SSSE3 0x0080

Conroe SSSE3 functions.

Definition at line 44 of file cpu.h.

## AV_CPU_FLAG_SSSE3SLOW

#define AV_CPU_FLAG_SSSE3SLOW 0x4000000

SSSE3 supported, but usually not faster.

Definition at line 45 of file cpu.h.

## AV_CPU_FLAG_ATOM

#define AV_CPU_FLAG_ATOM 0x10000000

Atom processor, some SSSE3 instructions are slower.

Definition at line 46 of file cpu.h.

## AV_CPU_FLAG_SSE4

#define AV_CPU_FLAG_SSE4 0x0100

Penryn SSE4.1 functions.

Definition at line 47 of file cpu.h.

## AV_CPU_FLAG_SSE42

#define AV_CPU_FLAG_SSE42 0x0200

Nehalem SSE4.2 functions.

Definition at line 48 of file cpu.h.

## AV_CPU_FLAG_AESNI

#define AV_CPU_FLAG_AESNI 0x80000

Advanced Encryption Standard functions.

Definition at line 49 of file cpu.h.

## AV_CPU_FLAG_CLMUL

#define AV_CPU_FLAG_CLMUL 0x400000

Carry-less Multiplication instruction.

Definition at line 50 of file cpu.h.

## AV_CPU_FLAG_AVX

#define AV_CPU_FLAG_AVX 0x4000

AVX functions: requires OS support even if YMM registers aren't used.

Definition at line 51 of file cpu.h.

## AV_CPU_FLAG_AVXSLOW

#define AV_CPU_FLAG_AVXSLOW 0x8000000

AVX supported, but slow when using YMM registers (e.g. Bulldozer).

Definition at line 52 of file cpu.h.

## AV_CPU_FLAG_XOP

#define AV_CPU_FLAG_XOP 0x0400

Bulldozer XOP functions.

Definition at line 53 of file cpu.h.

## AV_CPU_FLAG_FMA4

#define AV_CPU_FLAG_FMA4 0x0800

Bulldozer FMA4 functions.

Definition at line 54 of file cpu.h.

## AV_CPU_FLAG_CMOV

#define AV_CPU_FLAG_CMOV 0x1000

supports cmov instruction

Definition at line 55 of file cpu.h.

## AV_CPU_FLAG_AVX2

#define AV_CPU_FLAG_AVX2 0x8000

AVX2 functions: requires OS support even if YMM registers aren't used.

Definition at line 56 of file cpu.h.

## AV_CPU_FLAG_FMA3

#define AV_CPU_FLAG_FMA3 0x10000

Haswell FMA3 functions.

Definition at line 57 of file cpu.h.

## AV_CPU_FLAG_BMI1

#define AV_CPU_FLAG_BMI1 0x20000

Bit Manipulation Instruction Set 1.

Definition at line 58 of file cpu.h.

## AV_CPU_FLAG_BMI2

#define AV_CPU_FLAG_BMI2 0x40000

Bit Manipulation Instruction Set 2.

Definition at line 59 of file cpu.h.

## AV_CPU_FLAG_AVX512

#define AV_CPU_FLAG_AVX512 0x100000

AVX-512 functions: requires OS support even if YMM/ZMM registers aren't used.

Definition at line 60 of file cpu.h.

## AV_CPU_FLAG_AVX512ICL

#define AV_CPU_FLAG_AVX512ICL 0x200000

F/CD/BW/DQ/VL/VNNI/IFMA/VBMI/VBMI2/VPOPCNTDQ/BITALG/GFNI/VAES/VPCLMULQDQ.

Definition at line 61 of file cpu.h.

## AV_CPU_FLAG_SLOW_GATHER

#define AV_CPU_FLAG_SLOW_GATHER 0x2000000

CPU has slow gathers.

Definition at line 62 of file cpu.h.

## AV_CPU_FLAG_ALTIVEC

#define AV_CPU_FLAG_ALTIVEC 0x0001

standard

Definition at line 64 of file cpu.h.

## AV_CPU_FLAG_VSX

#define AV_CPU_FLAG_VSX 0x0002

ISA 2.06.

Definition at line 65 of file cpu.h.

## AV_CPU_FLAG_POWER8

#define AV_CPU_FLAG_POWER8 0x0004

ISA 2.07.

Definition at line 66 of file cpu.h.

## AV_CPU_FLAG_ARMV5TE

#define AV_CPU_FLAG_ARMV5TE (1 << 0)

Definition at line 68 of file cpu.h.

## AV_CPU_FLAG_ARMV6

#define AV_CPU_FLAG_ARMV6 (1 << 1)

Definition at line 69 of file cpu.h.

## AV_CPU_FLAG_ARMV6T2

#define AV_CPU_FLAG_ARMV6T2 (1 << 2)

Definition at line 70 of file cpu.h.

## AV_CPU_FLAG_VFP

#define AV_CPU_FLAG_VFP (1 << 3)

Definition at line 71 of file cpu.h.

## AV_CPU_FLAG_VFPV3

#define AV_CPU_FLAG_VFPV3 (1 << 4)

Definition at line 72 of file cpu.h.

## AV_CPU_FLAG_NEON

#define AV_CPU_FLAG_NEON (1 << 5)

Definition at line 73 of file cpu.h.

## AV_CPU_FLAG_ARMV8

#define AV_CPU_FLAG_ARMV8 (1 << 6)

Definition at line 74 of file cpu.h.

## AV_CPU_FLAG_VFP_VM

#define AV_CPU_FLAG_VFP_VM (1 << 7)

VFPv2 vector mode, deprecated in ARMv7-A and unavailable in various CPUs implementations.

Definition at line 75 of file cpu.h.

## AV_CPU_FLAG_DOTPROD

#define AV_CPU_FLAG_DOTPROD (1 << 8)

Definition at line 76 of file cpu.h.

## AV_CPU_FLAG_I8MM

#define AV_CPU_FLAG_I8MM (1 << 9)

Definition at line 77 of file cpu.h.

## AV_CPU_FLAG_SVE

#define AV_CPU_FLAG_SVE (1 <<10)

Definition at line 78 of file cpu.h.

## AV_CPU_FLAG_SVE2

#define AV_CPU_FLAG_SVE2 (1 <<11)

Definition at line 79 of file cpu.h.

## AV_CPU_FLAG_SME

#define AV_CPU_FLAG_SME (1 <<12)

Definition at line 80 of file cpu.h.

## AV_CPU_FLAG_ARM_CRC

#define AV_CPU_FLAG_ARM_CRC (1 <<13)

Definition at line 81 of file cpu.h.

## AV_CPU_FLAG_SME2

#define AV_CPU_FLAG_SME2 (1 <<14)

Definition at line 82 of file cpu.h.

## AV_CPU_FLAG_SME_I16I64

#define AV_CPU_FLAG_SME_I16I64 (1 <<15)

Definition at line 83 of file cpu.h.

## AV_CPU_FLAG_SETEND

#define AV_CPU_FLAG_SETEND (1 <<16)

Definition at line 84 of file cpu.h.

## AV_CPU_FLAG_MMI

#define AV_CPU_FLAG_MMI (1 << 0)

Definition at line 86 of file cpu.h.

## AV_CPU_FLAG_MSA

#define AV_CPU_FLAG_MSA (1 << 1)

Definition at line 87 of file cpu.h.

## AV_CPU_FLAG_LSX

#define AV_CPU_FLAG_LSX (1 << 0)

Definition at line 90 of file cpu.h.

## AV_CPU_FLAG_LASX

#define AV_CPU_FLAG_LASX (1 << 1)

Definition at line 91 of file cpu.h.

## AV_CPU_FLAG_RVI

#define AV_CPU_FLAG_RVI (1 << 0)

I (full GPR bank).

Definition at line 94 of file cpu.h.

## AV_CPU_FLAG_RVV_I32

#define AV_CPU_FLAG_RVV_I32 (1 << 3)

Vectors of 8/16/32-bit int's *‍/.

Definition at line 99 of file cpu.h.

## AV_CPU_FLAG_RVV_F32

#define AV_CPU_FLAG_RVV_F32 (1 << 4)

Vectors of float's *‍/.

Definition at line 100 of file cpu.h.

## AV_CPU_FLAG_RVV_I64

#define AV_CPU_FLAG_RVV_I64 (1 << 5)

Vectors of 64-bit int's *‍/.

Definition at line 101 of file cpu.h.

## AV_CPU_FLAG_RVV_F64

#define AV_CPU_FLAG_RVV_F64 (1 << 6)

Vectors of double's.

Definition at line 102 of file cpu.h.

## AV_CPU_FLAG_RVB_BASIC

#define AV_CPU_FLAG_RVB_BASIC (1 << 7)

Basic bit-manipulations.

Definition at line 103 of file cpu.h.

## AV_CPU_FLAG_RV_ZVBB

#define AV_CPU_FLAG_RV_ZVBB (1 << 9)

Vector basic bit-manipulations.

Definition at line 107 of file cpu.h.

## AV_CPU_FLAG_RV_MISALIGNED

#define AV_CPU_FLAG_RV_MISALIGNED (1 <<10)

Fast misaligned accesses.

Definition at line 108 of file cpu.h.

## AV_CPU_FLAG_RVB

#define AV_CPU_FLAG_RVB (1 <<11)

B (bit manipulations).

Definition at line 109 of file cpu.h.

## AV_CPU_FLAG_SIMD128

#define AV_CPU_FLAG_SIMD128 (1 << 0)

Definition at line 112 of file cpu.h.

## Function Documentation

## av_get_cpu_flags()

int av_get_cpu_flags | ( | void |  | ) |

Return the flags which specify extensions supported by the CPU.

The returned value is affected by av_force_cpu_flags() if that was used before. So av_get_cpu_flags() can easily be used in an application to detect the enabled cpu flags.

## av_force_cpu_flags()

void av_force_cpu_flags | ( | int | flags | ) |

Disables cpu detection and forces the specified flags.

-1 is a special case that disables forcing of specific flags.

## av_parse_cpu_caps()

int av_parse_cpu_caps | ( | unsigned * | flags,
|  | const char * | s )

Parse CPU caps from a string and update the given AV_CPU_* flags based on that.

Returns
  negative on error.

## av_cpu_count()

int av_cpu_count | ( | void |  | ) |

Returns
  the number of logical CPU cores present.

## av_cpu_force_count()

void av_cpu_force_count | ( | int | count | ) |

Overrides cpu count detection and forces the specified count.

Count < 1 disables forcing of specific count.

## av_cpu_max_align()

size_t av_cpu_max_align | ( | void |  | ) |

Get the maximum data alignment that may be required by FFmpeg.

Note that this is affected by the build configuration and the CPU flags mask, so e.g. if the CPU supports AVX, but libavutil has been built with –disable-avx or the AV_CPU_FLAG_AVX flag has been disabled through av_set_cpu_flags_mask(), then this function will behave as if AVX is not present.