52 #define CPUFLAG_MMXEXT (AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT | AV_CPU_FLAG_CMOV) 53 #define CPUFLAG_3DNOW (AV_CPU_FLAG_3DNOW | AV_CPU_FLAG_MMX) 54 #define CPUFLAG_3DNOWEXT (AV_CPU_FLAG_3DNOWEXT | CPUFLAG_3DNOW) 55 #define CPUFLAG_SSE (AV_CPU_FLAG_SSE | CPUFLAG_MMXEXT) 56 #define CPUFLAG_SSE2 (AV_CPU_FLAG_SSE2 | CPUFLAG_SSE) 57 #define CPUFLAG_SSE2SLOW (AV_CPU_FLAG_SSE2SLOW | CPUFLAG_SSE2) 58 #define CPUFLAG_SSE3 (AV_CPU_FLAG_SSE3 | CPUFLAG_SSE2) 59 #define CPUFLAG_SSE3SLOW (AV_CPU_FLAG_SSE3SLOW | CPUFLAG_SSE3) 60 #define CPUFLAG_SSSE3 (AV_CPU_FLAG_SSSE3 | CPUFLAG_SSE3) 61 #define CPUFLAG_SSE4 (AV_CPU_FLAG_SSE4 | CPUFLAG_SSSE3) 62 #define CPUFLAG_SSE42 (AV_CPU_FLAG_SSE42 | CPUFLAG_SSE4) 63 #define CPUFLAG_AVX (AV_CPU_FLAG_AVX | CPUFLAG_SSE42) 64 #define CPUFLAG_XOP (AV_CPU_FLAG_XOP | CPUFLAG_AVX) 65 #define CPUFLAG_FMA4 (AV_CPU_FLAG_FMA4 | CPUFLAG_AVX) 66 static const AVOption cpuflags_opts[] = {
101 .option = cpuflags_opts,
106 const AVClass *pclass = &
class;
111 return flags & INT_MAX;
116 static const AVOption cpuflags_opts[] = {
140 #define CPU_FLAG_P2 AV_CPU_FLAG_CMOV | AV_CPU_FLAG_MMX 141 #define CPU_FLAG_P3 CPU_FLAG_P2 | AV_CPU_FLAG_MMX2 | AV_CPU_FLAG_SSE 142 #define CPU_FLAG_P4 CPU_FLAG_P3| AV_CPU_FLAG_SSE2 147 #define CPU_FLAG_K62 AV_CPU_FLAG_MMX | AV_CPU_FLAG_3DNOW 148 #define CPU_FLAG_ATHLON CPU_FLAG_K62 | AV_CPU_FLAG_CMOV | AV_CPU_FLAG_3DNOWEXT | AV_CPU_FLAG_MMX2 149 #define CPU_FLAG_ATHLONXP CPU_FLAG_ATHLON | AV_CPU_FLAG_SSE 150 #define CPU_FLAG_K8 CPU_FLAG_ATHLONXP | AV_CPU_FLAG_SSE2 169 .option = cpuflags_opts,
172 const AVClass *pclass = &
class;
180 static const struct {
220 printf(
"cpu_flags = 0x%08X\n", cpu_flags);
222 for (i = 0; cpu_flag_tab[
i].flag; i++)
223 if (cpu_flags & cpu_flag_tab[i].flag)
#define AV_CPU_FLAG_AVX
AVX functions: requires OS support even if YMM registers aren't used.
#define AV_CPU_FLAG_ALTIVEC
standard
#define AV_CPU_FLAG_SSE
SSE functions.
void av_set_cpu_flags_mask(int mask)
Set a mask on flags returned by av_get_cpu_flags().
#define AV_CPU_FLAG_MMX2
SSE integer functions or AMD MMX ext.
#define AV_CPU_FLAG_CMOV
supports cmov instruction
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
#define AV_CPU_FLAG_MMXEXT
SSE integer functions or AMD MMX ext.
int av_parse_cpu_flags(const char *s)
Parse CPU flags from a string.
#define AV_CPU_FLAG_ATOM
Atom processor, some SSSE3 instructions are slower.
#define AV_CPU_FLAG_SSE2SLOW
SSE2 supported, but usually not faster.
#define AV_CPU_FLAG_XOP
Bulldozer XOP functions.
#define AV_CPU_FLAG_SSE42
Nehalem SSE4.2 functions.
#define AV_CPU_FLAG_SSSE3
Conroe SSSE3 functions.
static const uint16_t mask[17]
int av_opt_eval_flags(void *obj, const AVOption *o, const char *val, int *flags_out)
#define AV_CPU_FLAG_ARMV6T2
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.
#define AV_CPU_FLAG_ARMV5TE
#define AV_CPU_FLAG_SSE3
Prescott SSE3 functions.
#define AV_CPU_FLAG_VFPV3
int ff_get_cpu_flags_x86(void)
#define AV_CPU_FLAG_3DNOW
AMD 3DNOW.
#define AV_CPU_FLAG_ARMV6
#define AV_CPU_FLAG_SSE3SLOW
SSE3 supported, but usually not faster.
#define AV_CPU_FLAG_MMX
standard MMX
Describe the class of an AVClass context structure.
synthesis window for stochastic i
#define AV_CPU_FLAG_FMA4
Bulldozer FMA4 functions.
#define AV_CPU_FLAG_SSE4
Penryn SSE4.1 functions.
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
#define AV_CPU_FLAG_3DNOWEXT
AMD 3DNowExt.
printf("static const uint8_t my_array[100] = {\n")
int ff_get_cpu_flags_ppc(void)
This function MAY rely on signal() or fork() in order to make sure AltiVec is present.
int ff_get_cpu_flags_arm(void)
#define AV_CPU_FLAG_SSE2
PIV SSE2 functions.
void av_force_cpu_flags(int arg)
Disables cpu detection and forces the specified flags.
int main(int argc, char **argv)