summaryrefslogtreecommitdiff
path: root/gst/audioresample
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2009-05-22 17:31:14 -0700
committerDavid Schleef <ds@schleef.org>2009-05-22 17:34:56 -0700
commit1dae15d762a7d27201e5390acf2f157d4a0984d2 (patch)
tree0ce58334911c7f0648a25082c0e117f156ff6f6f /gst/audioresample
parent528cdedc2b9851ee7f0471ff075b7e28d2763eaa (diff)
Run liboil benchmark multiple times
The statistics function requires multiple runs, otherwise it causes a divide by zero error.
Diffstat (limited to 'gst/audioresample')
-rw-r--r--gst/audioresample/gstaudioresample.c33
1 files changed, 13 insertions, 20 deletions
diff --git a/gst/audioresample/gstaudioresample.c b/gst/audioresample/gstaudioresample.c
index 8fa04577e..99b1d8629 100644
--- a/gst/audioresample/gstaudioresample.c
+++ b/gst/audioresample/gstaudioresample.c
@@ -1355,6 +1355,7 @@ _benchmark_integer_resampling (void)
OilProfile a, b;
gdouble av, bv;
SpeexResamplerState *sta, *stb;
+ int i;
oil_profile_init (&a);
oil_profile_init (&b);
@@ -1372,29 +1373,21 @@ _benchmark_integer_resampling (void)
return FALSE;
}
- /* Warm up cache */
- if (!_benchmark_int_float (sta))
- goto error;
- if (!_benchmark_int_float (sta))
- goto error;
-
/* Benchmark */
- oil_profile_start (&a);
- if (!_benchmark_int_float (sta))
- goto error;
- oil_profile_stop (&a);
-
- /* Warm up cache */
- if (!_benchmark_int_int (stb))
- goto error;
- if (!_benchmark_int_int (stb))
- goto error;
+ for (i = 0; i < 10; i++) {
+ oil_profile_start (&a);
+ if (!_benchmark_int_float (sta))
+ goto error;
+ oil_profile_stop (&a);
+ }
/* Benchmark */
- oil_profile_start (&b);
- if (!_benchmark_int_int (stb))
- goto error;
- oil_profile_stop (&b);
+ for (i = 0; i < 10; i++) {
+ oil_profile_start (&b);
+ if (!_benchmark_int_int (stb))
+ goto error;
+ oil_profile_stop (&b);
+ }
/* Handle results */
oil_profile_get_ave_std (&a, &av, NULL);