<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
1-wide filters - looks triangular, but a 1-wide box would be more<br>
accurate<br></blockquote><div><br></div></span><div>Because you are not plotting the two dummy points at (0,±width/2), a 1-wide filter is actually just a single point.</div><div><br></div><div>You may be right that leaving the dummy points off the plot may make it easier to figure out what is going on.</div></div></div></div></blockquote><div><br></div><div>Okay, I will update the comment.<br><br></div><div>I don't like to make up fake data points, but maybe I should add [x=-width/2:width/2] to the gnuplot command line.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">diff --git a/pixman/rounding.txt b/pixman/rounding.txt<br><div><div class="h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
index b52b084..1c00019 100644<br>
--- a/pixman/rounding.txt<br>
+++ b/pixman/rounding.txt<br>
@@ -160,6 +160,7 @@ which means the contents of the matrix corresponding to (frac) should<br>
contain width samplings of the function, with the first sample at:<br>
<br>
floor (frac - (width - 1) / 2.0 - e) + 0.5 - frac<br>
+ = ceil (frac - width / 2.0 - 0.5) + 0.5 - frac<br></blockquote><div><br></div></div></div><div>Unfortunately this produces numbers that don't agree with the filter generator or filtering code.</div><div><br></div><div>For a width==4 filter with n_phases==1, the generator seems to produce values at -1, 0, 1, 2, so the first sample is at -1. It also appears the filtering sampler is using the same rule, otherwise these filters would produce an obvious shift in the image.</div></div></div></div></blockquote><br>If you add printf's on top of this series<br><div><br>diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c<br>index 176dfae..4a8743e 100644<br>--- a/pixman/pixman-filter.c<br>+++ b/pixman/pixman-filter.c<br>@@ -129,12 +129,15 @@ general_cubic (double x, double B, double C)<br> static double<br> cubic_kernel (double x)<br> {<br>+ double v = general_cubic (x, 1/3.0, 1/3.0);<br>+<br>+ printf ("cubic(%f) => %f\n", x, v);<br> /* This is the Mitchell-Netravali filter.<br> *<br> * (0.0, 0.5) would give us the Catmull-Rom spline,<br> * but that one seems to be indistinguishable from Lanczos2.<br> */<br>- return general_cubic (x, 1/3.0, 1/3.0);<br>+ return v;<br> }<br><br></div><div>and run scale with Reconstruction=Cubic, Sample=Impulse, and Subsample=0, it prints<br><br>cubic(-2.000000) => 0.000000<br>cubic(-1.000000) => 0.055556<br>cubic(0.000000) => 0.888889<br>cubic(1.000000) => 0.055556<br><br>so the filter generator *does* generate values at [ -2, -1, 0, 1 ]. And as mentioned, the sampling code, if given the value 17.5 will convolve with the pixels at 15.5, 16.5, 17.5, 18.5, so I'm pretty sure this matrix is correct.<br><br></div><div>(I suspect your changes to the integral() arguments caused it to generate different values, so you should check without them included.<br><br>This series is available as a git repository here:<br><br> <a href="https://cgit.freedesktop.org/~sandmann/pixman/log/?h=spitzak-for-master">https://cgit.freedesktop.org/~sandmann/pixman/log/?h=spitzak-for-master</a><br>)<br></div><div><br></div><br><div>Søren<br></div><div> </div></div></div></div>