[Poppler-bugs] [Bug 68360] Add option to manually disable bilinear filtering

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Aug 29 04:03:03 PDT 2013


https://bugs.freedesktop.org/show_bug.cgi?id=68360

--- Comment #23 from Charles Hyder <dr.hyder at gmail.com> ---
I'm going to start with rewriting a pair of functions (both defined in
Splash.cc) that implement bilinear interpolation:

static void expandRow(Guchar *srcBuf, Guchar *dstBuf, int srcWidth, int
scaledWidth, int nComps)

void Splash::scaleImageYuXuBilinear(SplashImageSource src, void *srcData,
                                    SplashColorMode srcMode, int nComps,
                                    GBool srcAlpha, int srcWidth, int
srcHeight,
                                    int scaledWidth, int scaledHeight,
                                    SplashBitmap *dest)


The first one interpolates along x, the second one interpolates along y using
results of calling the first one on adjacent rows.

There are two problems that I'm going to address:

1) both functions use floating point math, I'm going to replace that with
integer point math, fully preserving accuracy and hugely improving the speed;

2) when scaledWidth == srcWidth, scaledHeight == srcHeight, the nodes of the
source and destination grids are coinciding, and the interpolation should
(mathematically speaking) produce an identical image. So, I suspect, there is
indeed a bug after all. I'm going to find it.

Once I solve both problems the status of the bug will be as follows:

1) the original issue (bug) of fuzzy rendering at scale = 1 will be resolved;

2) For scale > 1 the rendering of images will be done as before, but at
improved speed. In particular, at 1 < scale < 4 (4 is an AD HOC number
introduced previously by someone else) the rendering will be done using
interpolation REGARDLESS of whether the "interpolate" flag is set.

I consider the last point a (minor) bug as well, but the one that doesn't
bother me personally. I'm not going to address it.

In summary: I'm going to 1) improve speed of image rendering at scale > 1,
while not altering what is produced - images produced will be interpolated for
1 < scale < 4, as before; 2) I'm going to fix interpolation at scale = 1: the
image should just be copied 1-to-1 in this case, obviously.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler-bugs/attachments/20130829/47230d2b/attachment.html>


More information about the Poppler-bugs mailing list