Traverse-Research / ispc-downsampler

Image downsampler using a Lanczos filter implemented in ISPC
Other
11 stars 1 forks source link

lanczos3: Actually sample 7x7 instead of 6x6 #27

Closed MarijnS95 closed 1 year ago

MarijnS95 commented 1 year ago

< should have been <=, otherwise we only sample [-3, -2, -1, 0, 1, 2] biasing us towards the top-left of the pixels.

MarijnS95 commented 1 year ago

warning This change has no effect on the output. I'm making this more clear in another PR, but the tl;dr is that offset = - 0.5 implying we always call lanczos3_filter(xy + 0.5), hence with values [-2.5, -1.5, ..., 3.5]. So, for all pixels in the filter where x=3 or y=3, lanczos3_filter(3.5) = 0.0 because 3.5 > 3.0.

MarijnS95 commented 1 year ago

I am not actually sure if it is intended that we sample a 6x6 grid from [-2.5, ..., 2.5] instead (and should revert this), @KYovchevski? Haven't checked if the source pixel positions match this, but they probably do?