#include #include #include #include #include "config.h" #ifdef HAVE_GETOPT_H #include #endif #include "fec.h" #if HAVE_GETOPT_LONG struct option Options[] = { {"frame-length",1,NULL,'l'}, {"frame-count",1,NULL,'n'}, {"verbose",0,NULL,'v'}, {"force-altivec",0,NULL,'a'}, {"force-port",0,NULL,'p'}, {"force-mmx",0,NULL,'m'}, {"force-sse",0,NULL,'s'}, {"force-sse2",0,NULL,'t'}, {NULL}, }; #endif int Verbose = 0; int main(int argc,char *argv[]){ signed short *buf; int i,d,trial,trials=10000; int bufsize = 2048; long long port_sum,simd_sum; time_t t; int timetrials=0; find_cpu_mode(); time(&t); srandom(t); #if HAVE_GETOPT_LONG while((d = getopt_long(argc,argv,"vapmstl:n:T",Options,NULL)) != EOF){ #else while((d = getopt(argc,argv,"vapmstl:n:T")) != EOF){ #endif switch(d){ case 'a': Cpu_mode = ALTIVEC; break; case 'p': Cpu_mode = PORT; break; case 'm': Cpu_mode = MMX; break; case 's': Cpu_mode = SSE; break; case 't': Cpu_mode = SSE2; break; case 'l': bufsize = atoi(optarg); break; case 'n': trials = atoi(optarg); break; case 'v': Verbose++; break; case 'T': timetrials++; break; } } buf = (signed short *)calloc(bufsize,sizeof(signed short)); if(timetrials){ for(trial=0;trial