+/*
+ * Copyright (C) 2000 Red Hat, Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#include "config.h"
#include <glib.h>
#include <string.h>
#include <stdlib.h>
static GTimeVal start_time;
-void start_timing (void)
+static void
+start_timing (void)
{
g_get_current_time (&start_time);
}
-double
+static double
stop_timing (const char *test, int iterations, int bytes)
{
GTimeVal stop_time;
return ((double)bytes * iterations) / (1000*msecs);
}
-void
+static void
init_array (double times[3][3][4])
{
int i, j, k;
times[i][j][k] = -1;
}
-void
+static void
dump_array (double times[3][3][4])
{
int i, j;
int main (int argc, char **argv)
{
int src_width, src_height, dest_width, dest_height;
- char *src_buf, *dest_buf;
+ unsigned char *src_buf, *dest_buf;
int src_index, dest_index;
int i;
double scale_times[3][3][4];
start_timing ();
for (i = 0; i < ITERS; i++)
{
- pixops_scale (dest_buf, 0, 0, dest_width, dest_height, dest_rowstride, dest_channels, dest_has_alpha,
- src_buf, src_width, src_height, src_rowstride, src_channels, src_has_alpha,
- (double)dest_width / src_width, (double)dest_height / src_height,
- filter_level);
+ _pixops_scale (dest_buf, dest_width, dest_height,
+ dest_rowstride, dest_channels,
+ dest_has_alpha, src_buf, src_width,
+ src_height, src_rowstride, src_channels,
+ src_has_alpha, 0, 0, 0, 0, 0, 0,
+ (double)dest_width / src_width,
+ (double)dest_height / src_height,
+ filter_level);
}
scale_times[src_index][dest_index][filter_level] =
stop_timing (" scale\t\t", ITERS, dest_height * dest_width);
start_timing ();
for (i = 0; i < ITERS; i++)
{
- pixops_composite (dest_buf, 0, 0, dest_width, dest_height, dest_rowstride, dest_channels, dest_has_alpha,
- src_buf, src_width, src_height, src_rowstride, src_channels, src_has_alpha,
- (double)dest_width / src_width, (double)dest_height / src_height,
- filter_level, 255);
+ _pixops_composite (dest_buf, dest_width, dest_height,
+ dest_rowstride, dest_channels,
+ dest_has_alpha, src_buf, src_width,
+ src_height, src_rowstride, src_channels,
+ src_has_alpha, 0, 0, 0, 0, 0, 0,
+ (double)dest_width / src_width,
+ (double)dest_height / src_height,
+ filter_level, 255);
}
composite_times[src_index][dest_index][filter_level] =
- stop_timing (" composite\t\t", ITERS, dest_height * dest_width);
+ stop_timing (" composite\t\t", ITERS,
+ dest_height * dest_width);
start_timing ();
for (i = 0; i < ITERS; i++)
{
- pixops_composite_color (dest_buf, 0, 0, dest_width, dest_height, dest_rowstride, dest_channels, dest_has_alpha,
- src_buf, src_width, src_height, src_rowstride, src_channels, src_has_alpha,
- (double)dest_width / src_width, (double)dest_height / src_height,
- filter_level, 255, 0, 0, 16, 0xaaaaaa, 0x555555);
+ _pixops_composite_color (dest_buf, dest_width, dest_height,
+ dest_rowstride, dest_channels,
+ dest_has_alpha, src_buf, src_width,
+ src_height, src_rowstride,
+ src_channels, src_has_alpha, 0, 0,
+ 0, 0, 0, 0,
+ (double)dest_width / src_width,
+ (double)dest_height / src_height,
+ filter_level, 255, 0, 0, 16,
+ 0xaaaaaa, 0x555555);
}
composite_color_times[src_index][dest_index][filter_level] =
stop_timing (" composite color\t", ITERS, dest_height * dest_width);