diff options
Diffstat (limited to 'media/ffvpx/libavutil/cpu.c')
-rw-r--r-- | media/ffvpx/libavutil/cpu.c | 57 |
1 files changed, 30 insertions, 27 deletions
diff --git a/media/ffvpx/libavutil/cpu.c b/media/ffvpx/libavutil/cpu.c index 6548cc3042..2cf1a38297 100644 --- a/media/ffvpx/libavutil/cpu.c +++ b/media/ffvpx/libavutil/cpu.c @@ -51,41 +51,43 @@ static atomic_int cpu_flags = ATOMIC_VAR_INIT(-1); static int get_cpu_flags(void) { - if (ARCH_AARCH64) + #if ARCH_AARCH64 == 1 return ff_get_cpu_flags_aarch64(); - if (ARCH_ARM) + #elif ARCH_ARM == 1 return ff_get_cpu_flags_arm(); - if (ARCH_PPC) + #elif ARCH_PPC == 1 return ff_get_cpu_flags_ppc(); - if (ARCH_X86) + #elif ARCH_X86 == 1 return ff_get_cpu_flags_x86(); + #endif return 0; } void av_force_cpu_flags(int arg){ - if (ARCH_X86 && - (arg & ( AV_CPU_FLAG_3DNOW | - AV_CPU_FLAG_3DNOWEXT | - AV_CPU_FLAG_MMXEXT | - AV_CPU_FLAG_SSE | - AV_CPU_FLAG_SSE2 | - AV_CPU_FLAG_SSE2SLOW | - AV_CPU_FLAG_SSE3 | - AV_CPU_FLAG_SSE3SLOW | - AV_CPU_FLAG_SSSE3 | - AV_CPU_FLAG_SSE4 | - AV_CPU_FLAG_SSE42 | - AV_CPU_FLAG_AVX | - AV_CPU_FLAG_AVXSLOW | - AV_CPU_FLAG_XOP | - AV_CPU_FLAG_FMA3 | - AV_CPU_FLAG_FMA4 | - AV_CPU_FLAG_AVX2 | - AV_CPU_FLAG_AVX512 )) + #if ARCH_X86 == 1 + if ((arg & (AV_CPU_FLAG_3DNOW | + AV_CPU_FLAG_3DNOWEXT | + AV_CPU_FLAG_MMXEXT | + AV_CPU_FLAG_SSE | + AV_CPU_FLAG_SSE2 | + AV_CPU_FLAG_SSE2SLOW | + AV_CPU_FLAG_SSE3 | + AV_CPU_FLAG_SSE3SLOW | + AV_CPU_FLAG_SSSE3 | + AV_CPU_FLAG_SSE4 | + AV_CPU_FLAG_SSE42 | + AV_CPU_FLAG_AVX | + AV_CPU_FLAG_AVXSLOW | + AV_CPU_FLAG_XOP | + AV_CPU_FLAG_FMA3 | + AV_CPU_FLAG_FMA4 | + AV_CPU_FLAG_AVX2 | + AV_CPU_FLAG_AVX512 )) && !(arg & AV_CPU_FLAG_MMX)) { av_log(NULL, AV_LOG_WARNING, "MMX implied by specified flags\n"); arg |= AV_CPU_FLAG_MMX; } + #endif atomic_store_explicit(&cpu_flags, arg, memory_order_relaxed); } @@ -308,14 +310,15 @@ int av_cpu_count(void) size_t av_cpu_max_align(void) { - if (ARCH_AARCH64) + #if ARCH_AARCH64 == 1 return ff_get_cpu_max_align_aarch64(); - if (ARCH_ARM) + #elif ARCH_ARM == 1 return ff_get_cpu_max_align_arm(); - if (ARCH_PPC) + #elif ARCH_PPC == 1 return ff_get_cpu_max_align_ppc(); - if (ARCH_X86) + #elif ARCH_X86 == 1 return ff_get_cpu_max_align_x86(); + #endif return 8; } |