summaryrefslogtreecommitdiffstats
path: root/libavutil
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2016-01-02 11:01:29 +0100
committerHendrik Leppkes <h.leppkes@gmail.com>2016-01-02 11:01:29 +0100
commite754c8e8caa78d75efff5cb2d979635477c20378 (patch)
tree15d6289f14563c8db638f565dd0e8f75e18cbd71 /libavutil
parent00e91d06767a5a28524cbfc271141970f744db23 (diff)
parente2710e790c09e49e86baa58c6063af0097cc8cb0 (diff)
downloadffmpeg-streaming-e754c8e8caa78d75efff5cb2d979635477c20378.zip
ffmpeg-streaming-e754c8e8caa78d75efff5cb2d979635477c20378.tar.gz
Merge commit 'e2710e790c09e49e86baa58c6063af0097cc8cb0'
* commit 'e2710e790c09e49e86baa58c6063af0097cc8cb0': arm: add a cpu flag for the VFPv2 vector mode Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/arm/cpu.c4
-rw-r--r--libavutil/arm/cpu.h5
-rw-r--r--libavutil/cpu.c2
-rw-r--r--libavutil/cpu.h1
-rw-r--r--libavutil/version.h2
5 files changed, 13 insertions, 1 deletions
diff --git a/libavutil/arm/cpu.c b/libavutil/arm/cpu.c
index 02def0b..3889ef0 100644
--- a/libavutil/arm/cpu.c
+++ b/libavutil/arm/cpu.c
@@ -137,6 +137,10 @@ int ff_get_cpu_flags_arm(void)
if (flags & AV_CPU_FLAG_ARMV6T2)
flags |= AV_CPU_FLAG_ARMV6;
+ /* set the virtual VFPv2 vector mode flag */
+ if ((flags & AV_CPU_FLAG_VFP) && !(flags & (AV_CPU_FLAG_VFPV3 | AV_CPU_FLAG_NEON)))
+ flags |= AV_CPU_FLAG_VFP_VM;
+
return flags;
}
diff --git a/libavutil/arm/cpu.h b/libavutil/arm/cpu.h
index 9b3b6ff..27a2eda 100644
--- a/libavutil/arm/cpu.h
+++ b/libavutil/arm/cpu.h
@@ -31,4 +31,9 @@
#define have_neon(flags) CPUEXT(flags, NEON)
#define have_setend(flags) CPUEXT(flags, SETEND)
+/* some functions use the VFPv2 vector mode which is deprecated in ARMv7-A
+ * and might trap on such CPU depending on the OS configuration */
+#define have_vfp_vm(flags) \
+ (have_armv6(flags) && ((flags) & AV_CPU_FLAG_VFP_VM))
+
#endif /* AVUTIL_ARM_CPU_H */
diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 1acae01..89066d8 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -152,6 +152,7 @@ int av_parse_cpu_flags(const char *s)
{ "armv6", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_ARMV6 }, .unit = "flags" },
{ "armv6t2", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_ARMV6T2 }, .unit = "flags" },
{ "vfp", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VFP }, .unit = "flags" },
+ { "vfp_vm", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VFP_VM }, .unit = "flags" },
{ "vfpv3", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VFPV3 }, .unit = "flags" },
{ "neon", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_NEON }, .unit = "flags" },
#elif ARCH_AARCH64
@@ -315,6 +316,7 @@ static const struct {
{ AV_CPU_FLAG_ARMV6, "armv6" },
{ AV_CPU_FLAG_ARMV6T2, "armv6t2" },
{ AV_CPU_FLAG_VFP, "vfp" },
+ { AV_CPU_FLAG_VFP_VM, "vfp_vm" },
{ AV_CPU_FLAG_VFPV3, "vfpv3" },
{ AV_CPU_FLAG_NEON, "neon" },
{ AV_CPU_FLAG_SETEND, "setend" },
diff --git a/libavutil/cpu.h b/libavutil/cpu.h
index bff8518..cc4e30c 100644
--- a/libavutil/cpu.h
+++ b/libavutil/cpu.h
@@ -64,6 +64,7 @@
#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_SETEND (1 <<16)
/**
diff --git a/libavutil/version.h b/libavutil/version.h
index 22cd66b..9ffa7a8 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -64,7 +64,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 55
-#define LIBAVUTIL_VERSION_MINOR 11
+#define LIBAVUTIL_VERSION_MINOR 12
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
OpenPOWER on IntegriCloud