<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">
It does look like there is something really wrong. I compared and (except for the subsample_bits==0 case) my version produces the same output as the current git head.<br>
<br>
I think your intention is that there is a sample at offset=0 whether the filter width is even or odd. However (except when subsample_bits==0) the filter generator makes a symmetric filter for even sizes, with two equal samples around the maximum center value. If a sample was at offset==0 then it would be unique and larger than all the other samples.<br></blockquote><div><br></div><div>The root of this confusion is probably that when subsample_bits = k, the subpixel positions used are:<br><br></div><div> 0.5 / 2^k, 1.5 / 2^k, ..., (2^k-0.5)/2^k</div><div><br></div><div>For example, for subsample_bits = 2:<br><br> 0.125, 0.375, 0.625, 0.875<br></div><div><br></div><div>and for subsample_bits = 0:<br><br> 0.5<br></div><div><br></div><div>That is, they are regularly spaced, but centered within the pixel. When there is an even number of them, this means there will not be a filter position at 0.5, and therefore no sample at offset 0. And the only case where number of subpixel locations is odd, is when subsample_bits = 0.<br><br>I'm pretty sure that the existing code gets the filter generation right for these subpixel positions.<br><br><br>[ You can argue that it would be better to use the sampling positions<br><br> 0, 0.25, 0.5, 0.75<br></div></div><div class="gmail_quote"><br></div><div class="gmail_quote">for subsample_bits = 2, as Owen did here:<br><br> <a href="https://lists.cairographics.org/archives/cairo/2014-March/025105.html">https://lists.cairographics.org/archives/cairo/2014-March/025105.html</a><br><br></div><div class="gmail_quote">and I agree that that would have been better. ]<br> <br></div><div class="gmail_quote"><br></div><div class="gmail_quote">Søren<br></div></div></div>