Module: libav
Branch: master
Commit: 6eca84bad8b0692eeede7ae363b7bdd580d6407d

Author:    Mans Rullgard <[email protected]>
Committer: Mans Rullgard <[email protected]>
Date:      Wed Apr 25 18:11:33 2012 +0100

cpu: recognise only cpu flag names pertinent to the architecture

Signed-off-by: Mans Rullgard <[email protected]>

---

 libavutil/cpu.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index d11ff40..6532744 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -63,7 +63,9 @@ int av_parse_cpu_flags(const char *s)
 #define CPUFLAG_FMA4     (AV_CPU_FLAG_FMA4     | CPUFLAG_AVX)
     static const AVOption cpuflags_opts[] = {
         { "flags"   , NULL, 0, AV_OPT_TYPE_FLAGS, { 0 }, INT64_MIN, INT64_MAX, 
.unit = "flags" },
+#if   ARCH_PPC
         { "altivec" , NULL, 0, AV_OPT_TYPE_CONST, { AV_CPU_FLAG_ALTIVEC  },    
.unit = "flags" },
+#elif ARCH_X86
         { "mmx"     , NULL, 0, AV_OPT_TYPE_CONST, { AV_CPU_FLAG_MMX      },    
.unit = "flags" },
         { "mmx2"    , NULL, 0, AV_OPT_TYPE_CONST, { CPUFLAG_MMX2         },    
.unit = "flags" },
         { "sse"     , NULL, 0, AV_OPT_TYPE_CONST, { CPUFLAG_SSE          },    
.unit = "flags" },
@@ -80,14 +82,14 @@ int av_parse_cpu_flags(const char *s)
         { "fma4"    , NULL, 0, AV_OPT_TYPE_CONST, { CPUFLAG_FMA4         },    
.unit = "flags" },
         { "3dnow"   , NULL, 0, AV_OPT_TYPE_CONST, { CPUFLAG_3DNOW        },    
.unit = "flags" },
         { "3dnowext", NULL, 0, AV_OPT_TYPE_CONST, { CPUFLAG_3DNOWEXT     },    
.unit = "flags" },
-
+#elif ARCH_ARM
         { "armv5te",  NULL, 0, AV_OPT_TYPE_CONST, { AV_CPU_FLAG_ARMV5TE  },    
.unit = "flags" },
         { "armv6",    NULL, 0, AV_OPT_TYPE_CONST, { AV_CPU_FLAG_ARMV6    },    
.unit = "flags" },
         { "armv6t2",  NULL, 0, AV_OPT_TYPE_CONST, { AV_CPU_FLAG_ARMV6T2  },    
.unit = "flags" },
         { "vfp",      NULL, 0, AV_OPT_TYPE_CONST, { AV_CPU_FLAG_VFP      },    
.unit = "flags" },
         { "vfpv3",    NULL, 0, AV_OPT_TYPE_CONST, { AV_CPU_FLAG_VFPV3    },    
.unit = "flags" },
         { "neon",     NULL, 0, AV_OPT_TYPE_CONST, { AV_CPU_FLAG_NEON     },    
.unit = "flags" },
-
+#endif
         { NULL },
     };
     static const AVClass class = {

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to