diff options
author | Thorvald Natvig <slicer@users.sourceforge.net> | 2008-04-26 22:31:48 +0400 |
---|---|---|
committer | Thorvald Natvig <slicer@users.sourceforge.net> | 2008-04-26 22:31:48 +0400 |
commit | 3a2518610861507c2fd5fb8bbe0e68ed698e5e8f (patch) | |
tree | f72f0e2c31256b21303e506d205aede0deccfef9 /speexbuild | |
parent | 83e782f2bd9aff62929833a6ec55fbbe50ba1899 (diff) |
Update to resampler test
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@1117 05730e5d-ab1b-0410-a4ac-84af385074fa
Diffstat (limited to 'speexbuild')
-rw-r--r-- | speexbuild/ResampMark.cpp | 27 | ||||
-rw-r--r-- | speexbuild/config.h | 4 |
2 files changed, 29 insertions, 2 deletions
diff --git a/speexbuild/ResampMark.cpp b/speexbuild/ResampMark.cpp index d4921de82..c86453451 100644 --- a/speexbuild/ResampMark.cpp +++ b/speexbuild/ResampMark.cpp @@ -3,6 +3,7 @@ static const float tfreq1 = 48000.f; static const float tfreq2 = 44100.f; static const int qual = 3; +static const int loops = 100 / qual; #define SM_VERIFY // #define EXACT @@ -14,12 +15,16 @@ static const int qual = 3; #define CALLGRIND_STOP_INSTRUMENTATION #define CALLGRIND_ZERO_STATS #else +#include <sched.h> +#include <sys/mman.h> #include <valgrind/callgrind.h> #endif #include <math.h> #include <speex/speex_resampler.h> + + #include "Timer.h" template<class T> @@ -143,8 +148,26 @@ int main(int argc, char **argv) { quint64 e; if (! RUNNING_ON_VALGRIND) { +#ifndef Q_OS_WIN + struct sched_param sp; + sp.sched_priority = sched_get_priority_max(SCHED_FIFO); + + cpu_set_t cpuset; + CPU_ZERO(&cpuset); + CPU_SET(0, &cpuset); + + if (sched_setscheduler(getpid(), SCHED_FIFO, &sp) != 0) + qWarning("No realtime."); + if (mlockall(MCL_CURRENT | MCL_FUTURE) != 0) + qWarning("No mlock."); + if (sched_setaffinity(0, sizeof(cpuset), &cpuset) != 0) + qWarning("No affinity"); + + sched_yield(); +#endif + t.restart(); - for(int j=0;j<10;j++) { + for(int j=0;j<loops;j++) { for(int i=0;i<nframes;i++) { inlen = iFrameSize; outlen = iOutSize1; @@ -155,7 +178,7 @@ int main(int argc, char **argv) { qWarning("Direct: %10llu usec", e); t.restart(); - for(int j=0;j<10;j++) { + for(int j=0;j<loops;j++) { for(int i=0;i<nframes;i++) { inlen = iFrameSize; outlen = iOutSize2; diff --git a/speexbuild/config.h b/speexbuild/config.h index a8986a865..0143a5eeb 100644 --- a/speexbuild/config.h +++ b/speexbuild/config.h @@ -130,6 +130,10 @@ #define _USE_SSE #endif +#ifdef __SSE2__ +#define _USE_SSE2 +#endif + #define EXPORT /* Define to empty if `const' does not conform to ANSI C. */ |