[Pixman] [PATCH v9 11/15] pixman-filter: Turn off subsampling for width=1 filters

spitzak at gmail.com spitzak at gmail.com
Fri Jan 22 01:42:09 PST 2016


From: Bill Spitzak <spitzak at gmail.com>

Due to normalization these filters must all be identical (a single 1.0).

Also make IMPULSE.IMPULSE produce a width=1 filter, rather than zero
(which did not work).

v7: Replaced earlier tests for BOX.IMPULSE

Signed-off-by: Bill Spitzak <spitzak at gmail.com>
---
 pixman/pixman-filter.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c
index 20d0fcb..6137f08 100644
--- a/pixman/pixman-filter.c
+++ b/pixman/pixman-filter.c
@@ -356,11 +356,21 @@ pixman_filter_create_separable_convolution (int             *n_values,
     int subsample_x, subsample_y;
     int width, height;
 
+    width = ceil (filters[reconstruct_x].width + sx * filters[sample_x].width);
+    if (width <= 1)
+    {
+	width = 1;
+	subsample_bits_x = 0;
+    }
     subsample_x = (1 << subsample_bits_x);
-    subsample_y = (1 << subsample_bits_y);
 
-    width = ceil (filters[reconstruct_x].width + sx * filters[sample_x].width);
     height = ceil (filters[reconstruct_y].width + sy * filters[sample_y].width);
+    if (height <= 1)
+    {
+	height = 1;
+	subsample_bits_y = 0;
+    }
+    subsample_y = (1 << subsample_bits_y);
 
     *n_values = 4 + width * subsample_x + height * subsample_y;
 
-- 
1.9.1



More information about the Pixman mailing list