fft-test: add option to set cpuflag mask

This can be useful for testing.

Signed-off-by: Mans Rullgard <mans@mansr.com>
This commit is contained in:
Mans Rullgard
2012-04-25 20:49:01 +01:00
parent 6eca84bad8
commit b6a6e90a7c
2 changed files with 23 additions and 13 deletions

View File

@@ -23,6 +23,7 @@
* FFT and MDCT tests.
*/
#include "libavutil/cpu.h"
#include "libavutil/mathematics.h"
#include "libavutil/lfg.h"
#include "libavutil/log.h"
@@ -240,6 +241,7 @@ int main(int argc, char **argv)
FFTComplex *tab, *tab1, *tab_ref;
FFTSample *tab2;
int it, i, c;
int cpuflags;
int do_speed = 0;
int err = 1;
enum tf_transform transform = TRANSFORM_FFT;
@@ -258,7 +260,7 @@ int main(int argc, char **argv)
fft_nbits = 9;
for(;;) {
c = getopt(argc, argv, "hsimrdn:f:");
c = getopt(argc, argv, "hsimrdn:f:c:");
if (c == -1)
break;
switch(c) {
@@ -286,6 +288,12 @@ int main(int argc, char **argv)
case 'f':
scale = atof(optarg);
break;
case 'c':
cpuflags = av_parse_cpu_flags(optarg);
if (cpuflags < 0)
return 1;
av_set_cpu_flags_mask(cpuflags);
break;
}
}