diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-08-20 12:30:48 +0200 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-08-20 12:30:48 +0200 |
commit | f8ffe0dabcedf56437c00feb895d7d7229971ba0 (patch) | |
tree | c2c48a63c6eeb893e02df70d982c7446b27574e8 /src/pulsecore/svolume_sse.c | |
parent | f09b51198f43d79b22cb92b5223d01a7ab339d9f (diff) |
svolume: cleanups
Use PA_MAX
Use pa_rtclock_now() for benchmarks
Diffstat (limited to 'src/pulsecore/svolume_sse.c')
-rw-r--r-- | src/pulsecore/svolume_sse.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/pulsecore/svolume_sse.c b/src/pulsecore/svolume_sse.c index b5e3687f..54af4a57 100644 --- a/src/pulsecore/svolume_sse.c +++ b/src/pulsecore/svolume_sse.c @@ -81,7 +81,7 @@ pa_volume_s16ne_sse (int16_t *samples, int32_t *volumes, unsigned channels, unsi /* the max number of samples we process at a time, this is also the max amount * we overread the volume array, which should have enough padding. */ - channels = MAX (8, channels); + channels = PA_MAX (8U, channels); __asm__ __volatile__ ( " xor %3, %3 \n\t" @@ -161,7 +161,7 @@ pa_volume_s16re_sse (int16_t *samples, int32_t *volumes, unsigned channels, unsi /* the max number of samples we process at a time, this is also the max amount * we overread the volume array, which should have enough padding. */ - channels = MAX (8, channels); + channels = PA_MAX (8U, channels); __asm__ __volatile__ ( " xor %3, %3 \n\t" @@ -257,7 +257,7 @@ static void run_test (void) { int32_t volumes[CHANNELS + PADDING]; int i, j, padding; pa_do_volume_func_t func; - struct timeval start, stop; + pa_usec_t start, stop; func = pa_get_volume_func (PA_SAMPLE_S16NE); @@ -281,21 +281,21 @@ static void run_test (void) { } } - pa_gettimeofday(&start); + start = pa_rtclock_now(); for (j = 0; j < TIMES; j++) { memcpy (samples, samples_orig, sizeof (samples)); pa_volume_s16ne_sse (samples, volumes, CHANNELS, sizeof (samples)); } - pa_gettimeofday(&stop); - pa_log_info("SSE: %llu usec.", (long long unsigned int)pa_timeval_diff (&stop, &start)); + stop = pa_rtclock_now(); + pa_log_info("SSE: %llu usec.", (long long unsigned int)(stop - start)); - pa_gettimeofday(&start); + start = pa_rtclock_now(); for (j = 0; j < TIMES; j++) { memcpy (samples_ref, samples_orig, sizeof (samples)); func (samples_ref, volumes, CHANNELS, sizeof (samples)); } - pa_gettimeofday(&stop); - pa_log_info("ref: %llu usec.", (long long unsigned int)pa_timeval_diff (&stop, &start)); + stop = pa_rtclock_now(); + pa_log_info("ref: %llu usec.", (long long unsigned int)(stop - start)); } #endif #endif /* defined (__i386__) || defined (__amd64__) */ |