summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-07 02:57:53 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-03-07 03:22:49 +0100
commit6df42f98746be06c883ce683563e07c9a2af983f (patch)
tree6bb893aaf179526515cfb3b1cc933721317dcf6f /libavutil
parent57986c501e8c97d4bd2e1b7ce9e9037c4ae06245 (diff)
parentb5161908e06b4497bf663510fb495ba97a6fd2b5 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: SBR DSP: fix SSE code to not use SSE2 instructions. cpu: initialize mask to -1, so that by default, optimizations are used. error_resilience: initialize s->block_index[]. svq3: protect against negative quantizers. Don't use ff_cropTbl[] for IDCT. swscale: make filterPos 32bit. FATE: add CPUFLAGS variable, mapping to -cpuflags avconv option. avconv: add -cpuflags option for setting supported cpuflags. cpu: add av_set_cpu_flags_mask(). libx264: Allow overriding the sliced threads option avconv: fix counting encoded video size. Conflicts: doc/APIchanges doc/fate.texi doc/ffmpeg.texi ffmpeg.c libavcodec/h264idct_template.c libavcodec/svq3.c libavutil/avutil.h libavutil/cpu.c libavutil/cpu.h libswscale/swscale.c tests/Makefile tests/fate-run.sh tests/regression-funcs.sh Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/avutil.h2
-rw-r--r--libavutil/cpu.c9
-rw-r--r--libavutil/cpu.h11
3 files changed, 19 insertions, 3 deletions
diff --git a/libavutil/avutil.h b/libavutil/avutil.h
index 0f1fd0a6a6..2ec2f2e79c 100644
--- a/libavutil/avutil.h
+++ b/libavutil/avutil.h
@@ -153,7 +153,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 51
-#define LIBAVUTIL_VERSION_MINOR 41
+#define LIBAVUTIL_VERSION_MINOR 42
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index fa64a83cfa..fed6093316 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -23,7 +23,7 @@ static int flags, checked;
void av_force_cpu_flags(int arg){
flags = arg;
- checked = 1;
+ checked = arg != -1;
}
int av_get_cpu_flags(void)
@@ -39,6 +39,13 @@ int av_get_cpu_flags(void)
return flags;
}
+void av_set_cpu_flags_mask(int mask)
+{
+ checked = 0;
+ flags = av_get_cpu_flags() & mask;
+ checked = 1;
+}
+
#ifdef TEST
#undef printf
diff --git a/libavutil/cpu.h b/libavutil/cpu.h
index 691ee9c8c1..bb80c8d76a 100644
--- a/libavutil/cpu.h
+++ b/libavutil/cpu.h
@@ -21,6 +21,8 @@
#ifndef AVUTIL_CPU_H
#define AVUTIL_CPU_H
+#include "attributes.h"
+
#define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */
/* lower 16 bits - CPU features */
@@ -49,12 +51,19 @@
*/
int av_get_cpu_flags(void);
-
/**
* Disables cpu detection and forces the specified flags.
*/
void av_force_cpu_flags(int flags);
+/**
+ * Set a mask on flags returned by av_get_cpu_flags().
+ * This function is mainly useful for testing.
+ * Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible
+ *
+ * @warning this function is not thread safe.
+ */
+attribute_deprecated void av_set_cpu_flags_mask(int mask);
/* The following CPU-specific functions shall not be called directly. */
int ff_get_cpu_flags_arm(void);