diff options
author | Glenn Kennard <glenn.kennard@gmail.com> | 2005-10-30 11:45:23 +0100 |
---|---|---|
committer | Glenn Kennard <glenn.kennard@gmail.com> | 2005-10-30 11:45:23 +0100 |
commit | 7e8759495855ce97f0422051af3e650f89d33ad4 (patch) | |
tree | c45507380561a5311d71a7ed1f32c42a4fbef44d | |
parent | 8f67d942be03024bdcdd956e72cd41b10cbc1e2a (diff) | |
download | mupdf-7e8759495855ce97f0422051af3e650f89d33ad4.tar.xz |
Optimize loadtile.
Drops rendering time for first page of wildcatvpds.pdf from 3 to 2 seconds.
-rw-r--r-- | raster/imageunpack.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/raster/imageunpack.c b/raster/imageunpack.c index a3642d3d..451967c8 100644 --- a/raster/imageunpack.c +++ b/raster/imageunpack.c @@ -154,19 +154,24 @@ static void loadtile1(byte *src, int sw, byte *dst, int dw, int w, int h, int pa src += sw; \ dst += dw; \ } \ - else \ + else { \ + int tpad; \ while (h--) \ { \ byte *dp = dst; \ + tpad = 0; \ for (x = 0; x < w; x++) \ { \ - if ((x % pad) == 0) \ - *dp++ = 255; \ + if (!tpad--) { \ + tpad = pad-1; \ + *dp++ = 255; \ + } \ *dp++ = getf(src, x); \ } \ src += sw; \ dst += dw; \ } \ + } \ } static void loadtile2(byte * restrict src, int sw, byte * restrict dst, int dw, int w, int h, int pad) |