summaryrefslogtreecommitdiffstats
path: root/libavutil/cpu.h
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-09-27 22:56:53 -0300
committerJames Almer <jamrial@gmail.com>2017-09-27 23:03:57 -0300
commit522f87708653af3badcdc33be983bcc6009de49b (patch)
tree40b863b9f71e5f0eff288377c300e02988427f8c /libavutil/cpu.h
parent5256a86da067a324ece20bb9584880f5a63744ce (diff)
parente6bff23f1e11aefb16a2b5d6ee72bf7469c5a66e (diff)
downloadffmpeg-streaming-522f87708653af3badcdc33be983bcc6009de49b.zip
ffmpeg-streaming-522f87708653af3badcdc33be983bcc6009de49b.tar.gz
Merge commit 'e6bff23f1e11aefb16a2b5d6ee72bf7469c5a66e'
* commit 'e6bff23f1e11aefb16a2b5d6ee72bf7469c5a66e': cpu: add a function for querying maximum required data alignment Adapted to work with the arbitrary runtime cpuflag changes av_force_cpu_flags() can generate. Merged-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavutil/cpu.h')
-rw-r--r--libavutil/cpu.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavutil/cpu.h b/libavutil/cpu.h
index de05593..9e5d40a 100644
--- a/libavutil/cpu.h
+++ b/libavutil/cpu.h
@@ -21,6 +21,8 @@
#ifndef AVUTIL_CPU_H
#define AVUTIL_CPU_H
+#include <stddef.h>
+
#include "attributes.h"
#define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */
@@ -113,4 +115,15 @@ int av_parse_cpu_caps(unsigned *flags, const char *s);
*/
int av_cpu_count(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.
+ */
+size_t av_cpu_max_align(void);
+
#endif /* AVUTIL_CPU_H */
OpenPOWER on IntegriCloud