[gegl] tests: update sampling buffer tests for bilinear rather than boxfilter
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] tests: update sampling buffer tests for bilinear rather than boxfilter
- Date: Sun, 28 Jan 2018 20:59:27 +0000 (UTC)
commit 870f01f912c12c072d0a82284dc90b3dc9209ffa
Author: Øyvind Kolås <pippin gimp org>
Date: Sun Jan 28 14:28:37 2018 +0100
tests: update sampling buffer tests for bilinear rather than boxfilter
perf/test-common.h | 4 +-
perf/test-gegl-buffer-access.c | 60 ++++++++--
tests/buffer/reference/get_buffer_scaled.buf | 144 ++++++++++++------------
tests/buffer/reference/get_buffer_scaled2.buf | 14 ++--
4 files changed, 129 insertions(+), 93 deletions(-)
---
diff --git a/perf/test-common.h b/perf/test-common.h
index 8f1eff8..12cf97c 100644
--- a/perf/test-common.h
+++ b/perf/test-common.h
@@ -8,8 +8,8 @@
more noise, increase this number towards 1.0,
like 0.8 */
#define BAIL_THRESHOLD 0.001
-#define BAIL_COUNT 250
-#define MIN_ITER 500
+#define BAIL_COUNT 75
+#define MIN_ITER 100
static long ticks_start;
diff --git a/perf/test-gegl-buffer-access.c b/perf/test-gegl-buffer-access.c
index 60e764b..6d220c5 100644
--- a/perf/test-gegl-buffer-access.c
+++ b/perf/test-gegl-buffer-access.c
@@ -8,22 +8,25 @@ main (gint argc,
{
GeglBuffer *buffer;
GeglRectangle bound = {0, 0, 1024, 1024};
+ GeglRectangle bound2 = {0, 0, 300, 300};
const Babl *format;
+ guchar *sbuf;
guchar *buf;
gint i;
gegl_init (NULL, NULL);
format = babl_format ("RGBA float");
+ sbuf = g_malloc0 (bound.width * bound.height * BPP);
buf = g_malloc0 (bound.width * bound.height * BPP);
for (i = 0; i < bound.width * bound.height * BPP;i++)
- buf[i] = rand() & 0xff;
+ sbuf[i] = rand() & 0xff;
buffer = gegl_buffer_new (&bound, format);
/* pre-initialize */
- gegl_buffer_set (buffer, &bound, 0, NULL, buf, GEGL_AUTO_ROWSTRIDE);
-#if 0
+ gegl_buffer_set (buffer, &bound, 0, NULL, sbuf, GEGL_AUTO_ROWSTRIDE);
+#if 1
test_start ();
for (i=0;i<ITERATIONS && converged < BAIL_COUNT;i++)
{
@@ -38,7 +41,7 @@ main (gint argc,
{
GeglBuffer *buffer = gegl_buffer_new (&bound, format);
/* pre-initialize */
- gegl_buffer_set (buffer, &bound, 0, NULL, buf, GEGL_AUTO_ROWSTRIDE);
+ gegl_buffer_set (buffer, &bound, 0, NULL, sbuf, GEGL_AUTO_ROWSTRIDE);
test_start_iter ();
gegl_buffer_get (buffer, &bound, 0.333, NULL, buf, GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_NONE);
test_end_iter ();
@@ -53,40 +56,73 @@ main (gint argc,
{
const Babl *format = babl_format ("R'G'B'A u8");
GeglBuffer *buffer = gegl_buffer_new (&bound, format);
- gegl_buffer_set (buffer, &bound, 0, NULL, buf, GEGL_AUTO_ROWSTRIDE);
+ gegl_buffer_set (buffer, &bound, 0, NULL, sbuf, GEGL_AUTO_ROWSTRIDE);
/* pre-initialize */
test_start_iter ();
- gegl_buffer_get (buffer, &bound, 0.333, NULL, buf, GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_NONE);
+ gegl_buffer_get (buffer, &bound2, 0.333, NULL, buf, GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_NONE);
test_end_iter ();
g_object_unref (buffer);
}
}
- test_end ("gegl_buffer_get 8bit 0.333", 1.0 * bound.width * bound.height * ITERATIONS * 4);
+ test_end ("buffer_get 8bit 0.333", 1.0 * bound2.width * bound2.height * ITERATIONS * 4);
{
const Babl *format = babl_format ("R'G'B'A u8");
GeglBuffer *buffer = gegl_buffer_new (&bound, format);
- gegl_buffer_set (buffer, &bound, 0, NULL, buf, GEGL_AUTO_ROWSTRIDE);
+ gegl_buffer_set (buffer, &bound, 0, NULL, sbuf, GEGL_AUTO_ROWSTRIDE);
test_start ();
for (i=0;i<ITERATIONS && converged < BAIL_COUNT;i++)
{
/* pre-initialize */
test_start_iter ();
- gegl_buffer_get (buffer, &bound, 0.333, NULL, buf, GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_NONE);
+ gegl_buffer_get (buffer, &bound2, 0.333, NULL, buf, GEGL_AUTO_ROWSTRIDE,
GEGL_ABYSS_NONE|GEGL_BUFFER_BOXFILTER);
+ test_end_iter ();
+ }
+ g_object_unref (buffer);
+ }
+ test_end ("boxfilter 0.333", 1.0 * bound2.width * bound2.height * ITERATIONS * 4);
+
+
+ {
+ const Babl *format = babl_format ("R'G'B'A u8");
+ GeglBuffer *buffer = gegl_buffer_new (&bound, format);
+ gegl_buffer_set (buffer, &bound, 0, NULL, sbuf, GEGL_AUTO_ROWSTRIDE);
+ test_start ();
+ for (i=0;i<ITERATIONS && converged < BAIL_COUNT;i++)
+ {
+ /* pre-initialize */
+ test_start_iter ();
+ gegl_buffer_get (buffer, &bound2, 0.333, NULL, buf, GEGL_AUTO_ROWSTRIDE,
GEGL_ABYSS_NONE|GEGL_BUFFER_NEAREST);
test_end_iter ();
}
g_object_unref (buffer);
}
- test_end ("gegl_buffer_getC8bit 0.333", 1.0 * bound.width * bound.height * ITERATIONS * 4);
+ test_end ("nearest 0.333", 1.0 * bound2.width * bound2.height * ITERATIONS * 4);
+
- exit(0);
+
+ {
+ const Babl *format = babl_format ("R'G'B'A u8");
+ GeglBuffer *buffer = gegl_buffer_new (&bound, format);
+ gegl_buffer_set (buffer, &bound, 0, NULL, sbuf, GEGL_AUTO_ROWSTRIDE);
+ test_start ();
+ for (i=0;i<ITERATIONS && converged < BAIL_COUNT;i++)
+ {
+ /* pre-initialize */
+ test_start_iter ();
+ gegl_buffer_get (buffer, &bound2, 0.333, NULL, buf, GEGL_AUTO_ROWSTRIDE,
GEGL_ABYSS_NONE|GEGL_BUFFER_BILINEAR);
+ test_end_iter ();
+ }
+ g_object_unref (buffer);
+ }
+ test_end ("bilinear 0.333", 1.0 * bound2.width * bound2.height * ITERATIONS * 4);
test_start ();
for (i=0;i<ITERATIONS && converged < BAIL_COUNT;i++)
{
test_start_iter ();
- gegl_buffer_set (buffer, &bound, 0, NULL, buf, GEGL_AUTO_ROWSTRIDE);
+ gegl_buffer_set (buffer, &bound, 0, NULL, sbuf, GEGL_AUTO_ROWSTRIDE);
test_end_iter ();
}
test_end ("gegl_buffer_set", 1.0 * bound.width * bound.height * ITERATIONS * BPP);
diff --git a/tests/buffer/reference/get_buffer_scaled.buf b/tests/buffer/reference/get_buffer_scaled.buf
index 157833b..6377350 100644
--- a/tests/buffer/reference/get_buffer_scaled.buf
+++ b/tests/buffer/reference/get_buffer_scaled.buf
@@ -1,101 +1,101 @@
Test: get_buffer_scaled
▛▀▀▀▀▀▀▀▀▀▀▀▀▜
-▌██▒ ░██░ ▒██▐
-▌██▒ ░██░ ▒██▐
-▌▒▒▒▒▒▒▒▒▒▒▒▒▐
-▌ ▒█▓ ▓█▒ ▐
-▌░░▒▓▓░░▓▓▒░░▐
-▌██▒ ░██░ ▒██▐
-▌██▒ ░██░ ▒██▐
-▌░░▒▓▓░░▓▓▒░░▐
-▙▄▄▄▄▄▄▄▄▄▄▄▄▟
-▛▀▀▀▀▀▀▀▀▀▀▀▀▜
-▌█▒ ░██░ ▒██ ▐
-▌█▒ ░██░ ▒██ ▐
-▌▒▒▒▒▒▒▒▒▒▒▒▒▐
-▌ ▒█▓ ▓█▒ █▐
-▌░▒▓▓░░▓▓▒░░▓▐
-▌█▒ ░██░ ▒██ ▐
-▌█▒ ░██░ ▒██ ▐
-▌░▒▓▓░░▓▓▒░░▓▐
-▙▄▄▄▄▄▄▄▄▄▄▄▄▟
-▛▀▀▀▀▀▀▀▀▀▀▀▀▜
-▌▒ ░██░ ▒██ ▐
-▌▒ ░██░ ▒██ ▐
-▌▒▒▒▒▒▒▒▒▒▒▒▒▐
-▌▒█▓ ▓█▒ ██▐
-▌▒▓▓░░▓▓▒░░▓▓▐
-▌▒ ░██░ ▒██ ▐
-▌▒ ░██░ ▒██ ▐
-▌▒▓▓░░▓▓▒░░▓▓▐
-▙▄▄▄▄▄▄▄▄▄▄▄▄▟
-▛▀▀▀▀▀▀▀▀▀▀▀▀▜
-▌ ░██░ ▒██ ▒▐
-▌ ░██░ ▒██ ▒▐
-▌▒▒▒▒▒▒▒▒▒▒▒▒▐
▌█▓ ▓█▒ ██▒▐
-▌▓▓░░▓▓▒░░▓▓▒▐
-▌ ░██░ ▒██ ▒▐
+▌█▓ ▓█▒ ██▒▐
+▌░▒▓▓▒░▒▓▓░░▒▐
▌ ░██░ ▒██ ▒▐
-▌▓▓░░▓▓▒░░▓▓▒▐
+▌░▒▓▓▒░▒▓▓░░▒▐
+▌█▓ ▓█▒ ██▒▐
+▌█▓ ▓█▒ ██▒▐
+▌░░▓▓░░▒▓▓░░▒▐
▙▄▄▄▄▄▄▄▄▄▄▄▄▟
▛▀▀▀▀▀▀▀▀▀▀▀▀▜
-▌░██░ ▒██ ▒█▐
-▌░██░ ▒██ ▒█▐
-▌▒▒▒▒▒▒▒▒▒▒▒▒▐
▌▓ ▓█▒ ██▒ ▐
-▌▓░░▓▓▒░░▓▓▒░▐
-▌░██░ ▒██ ▒█▐
+▌▓ ▓█▒ ██▒ ▐
+▌▒▓▓▒░▒▓▓░░▒▓▐
▌░██░ ▒██ ▒█▐
-▌▓░░▓▓▒░░▓▓▒░▐
+▌▒▓▓▒░▒▓▓░░▒▓▐
+▌▓ ▓█▒ ██▒ ▐
+▌▓ ▓█▒ ██▒ ▐
+▌░▓▓░░▒▓▓░░▒▓▐
▙▄▄▄▄▄▄▄▄▄▄▄▄▟
▛▀▀▀▀▀▀▀▀▀▀▀▀▜
-▌██░ ▒██ ▒█▓▐
-▌██░ ▒██ ▒█▓▐
-▌▒▒▒▒▒▒▒▒▒▒▒▒▐
▌ ▓█▒ ██▒ ░▐
-▌░░▓▓▒░░▓▓▒░░▐
-▌██░ ▒██ ▒█▓▐
+▌ ▓█▒ ██▒ ░▐
+▌▓▓▒░▒▓▓░░▒▓▒▐
▌██░ ▒██ ▒█▓▐
-▌░░▓▓▒░░▓▓▒░░▐
+▌▓▓▒░▒▓▓░░▒▓▒▐
+▌ ▓█▒ ██▒ ░▐
+▌ ▓█▒ ██▒ ░▐
+▌▓▓░░▒▓▓░░▒▓▓▐
▙▄▄▄▄▄▄▄▄▄▄▄▄▟
▛▀▀▀▀▀▀▀▀▀▀▀▀▜
-▌█░ ▒██ ▒█▓ ▐
-▌█░ ▒██ ▒█▓ ▐
-▌▒▒▒▒▒▒▒▒▒▒▒▒▐
▌ ▓█▒ ██▒ ░█▐
-▌░▓▓▒░░▓▓▒░░▓▐
-▌█░ ▒██ ▒█▓ ▐
+▌ ▓█▒ ██▒ ░█▐
+▌▓▒░▒▓▓░░▒▓▒░▐
▌█░ ▒██ ▒█▓ ▐
-▌░▓▓▒░░▓▓▒░░▓▐
+▌▓▒░▒▓▓░░▒▓▒░▐
+▌ ▓█▒ ██▒ ░█▐
+▌ ▓█▒ ██▒ ░█▐
+▌▓░░▒▓▓░░▒▓▓░▐
▙▄▄▄▄▄▄▄▄▄▄▄▄▟
▛▀▀▀▀▀▀▀▀▀▀▀▀▜
-▌░ ▒██ ▒█▓ ▐
-▌░ ▒██ ▒█▓ ▐
-▌▒▒▒▒▒▒▒▒▒▒▒▒▐
▌▓█▒ ██▒ ░██▐
-▌▓▓▒░░▓▓▒░░▓▓▐
-▌░ ▒██ ▒█▓ ▐
+▌▓█▒ ██▒ ░██▐
+▌▒░▒▓▓░░▒▓▒░░▐
▌░ ▒██ ▒█▓ ▐
-▌▓▓▒░░▓▓▒░░▓▓▐
+▌▒░▒▓▓░░▒▓▒░░▐
+▌▓█▒ ██▒ ░██▐
+▌▓█▒ ██▒ ░██▐
+▌░░▒▓▓░░▒▓▓░░▐
▙▄▄▄▄▄▄▄▄▄▄▄▄▟
▛▀▀▀▀▀▀▀▀▀▀▀▀▜
-▌ ▒██ ▒█▓ ▓▐
-▌ ▒██ ▒█▓ ▓▐
-▌▒▒▒▒▒▒▒▒▒▒▒▒▐
▌█▒ ██▒ ░██░▐
-▌▓▒░░▓▓▒░░▓▓░▐
-▌ ▒██ ▒█▓ ▓▐
+▌█▒ ██▒ ░██░▐
+▌░▒▓▓░░▒▓▒░░▒▐
▌ ▒██ ▒█▓ ▓▐
-▌▓▒░░▓▓▒░░▓▓░▐
+▌░▒▓▓░░▒▓▒░░▒▐
+▌█▒ ██▒ ░██░▐
+▌█▒ ██▒ ░██░▐
+▌░▒▓▓░░▒▓▓░░▓▐
▙▄▄▄▄▄▄▄▄▄▄▄▄▟
▛▀▀▀▀▀▀▀▀▀▀▀▀▜
-▌▒██ ▒█▓ ▓█▐
-▌▒██ ▒█▓ ▓█▐
-▌▒▒▒▒▒▒▒▒▒▒▒▒▐
▌▒ ██▒ ░██░ ▐
-▌▒░░▓▓▒░░▓▓░░▐
-▌▒██ ▒█▓ ▓█▐
+▌▒ ██▒ ░██░ ▐
+▌▒▓▓░░▒▓▒░░▒▓▐
▌▒██ ▒█▓ ▓█▐
-▌▒░░▓▓▒░░▓▓░░▐
+▌▒▓▓░░▒▓▒░░▒▓▐
+▌▒ ██▒ ░██░ ▐
+▌▒ ██▒ ░██░ ▐
+▌▒▓▓░░▒▓▓░░▓▓▐
+▙▄▄▄▄▄▄▄▄▄▄▄▄▟
+▛▀▀▀▀▀▀▀▀▀▀▀▀▜
+▌ ██▒ ░██░ ▒▐
+▌ ██▒ ░██░ ▒▐
+▌▓▓░░▒▓▒░░▒▓▒▐
+▌██ ▒█▓ ▓█▒▐
+▌▓▓░░▒▓▒░░▒▓▒▐
+▌ ██▒ ░██░ ▒▐
+▌ ██▒ ░██░ ▒▐
+▌▓▓░░▒▓▓░░▓▓▒▐
+▙▄▄▄▄▄▄▄▄▄▄▄▄▟
+▛▀▀▀▀▀▀▀▀▀▀▀▀▜
+▌ ██▒ ░██░ ▒█▐
+▌ ██▒ ░██░ ▒█▐
+▌▓░░▒▓▒░░▒▓▒░▐
+▌█ ▒█▓ ▓█▒ ▐
+▌▓░░▒▓▒░░▒▓▒░▐
+▌ ██▒ ░██░ ▒█▐
+▌ ██▒ ░██░ ▒█▐
+▌▓░░▒▓▓░░▓▓▒░▐
+▙▄▄▄▄▄▄▄▄▄▄▄▄▟
+▛▀▀▀▀▀▀▀▀▀▀▀▀▜
+▌██▒ ░██░ ▒██▐
+▌██▒ ░██░ ▒██▐
+▌░░▒▓▒░░▒▓▒░░▐
+▌ ▒█▓ ▓█▒ ▐
+▌░░▒▓▒░░▒▓▒░░▐
+▌██▒ ░██░ ▒██▐
+▌██▒ ░██░ ▒██▐
+▌░░▒▓▓░░▓▓▒░░▐
▙▄▄▄▄▄▄▄▄▄▄▄▄▟
diff --git a/tests/buffer/reference/get_buffer_scaled2.buf b/tests/buffer/reference/get_buffer_scaled2.buf
index d13f066..02d952c 100644
--- a/tests/buffer/reference/get_buffer_scaled2.buf
+++ b/tests/buffer/reference/get_buffer_scaled2.buf
@@ -2,12 +2,12 @@ Test: get_buffer_scaled2
▛▀▀▀▀▀▀▀▀▀▀▜
▌ ▐
▌ ▐
-▌ █░░█ ▓▒ ▐
-▌ ░▒▒░▓▒░ ▐
-▌ ░▒▒░▓▒░ ▐
-▌ █░░█ ▓▒ ▐
-▌ ▓▓ █░ ▐
-▌ ▓▒▒▓░▒▒ ▐
-▌ ▒░░▒ ▒░ ▐
+▌ ░█ ▓▓ █░ ▐
+▌ ▒▒▒▒▒▒ ▐
+▌ █░░█ ▐
+▌ ░█ ▓▓ █░ ▐
+▌ █░░█ ▐
+▌ ░▒▒▒▒▒▒ ▐
+▌ ░█ ▓▓ █░ ▐
▌ ▐
▙▄▄▄▄▄▄▄▄▄▄▟
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]