diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-11-19 16:37:56 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2012-11-19 16:49:28 +0000 |
commit | a8560c74b6b655386c4530383eebda4e7cc239c2 (patch) | |
tree | 64d4873c78a598fb8974f4cb3e3a778c60b9b6b1 /fitz/filt_dctd.c | |
parent | 019ec348606cf55616b478fda04fc214647e7881 (diff) | |
download | mupdf-a8560c74b6b655386c4530383eebda4e7cc239c2.tar.xz |
Tweak image decode downscale factor internals.
When calculating the factor to use for image downscales, calculate it
as a shift rather than a divisor.
Diffstat (limited to 'fitz/filt_dctd.c')
-rw-r--r-- | fitz/filt_dctd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fitz/filt_dctd.c b/fitz/filt_dctd.c index 76f82abe..3503370d 100644 --- a/fitz/filt_dctd.c +++ b/fitz/filt_dctd.c @@ -12,7 +12,7 @@ struct fz_dctd_s int color_transform; int init; int stride; - int factor; + int l2factor; unsigned char *scanline; unsigned char *rp, *wp; struct jpeg_decompress_struct cinfo; @@ -157,7 +157,7 @@ read_dctd(fz_stream *stm, unsigned char *buf, int len) break; } - cinfo->scale_num = 8/state->factor; + cinfo->scale_num = 8/(1<<state->l2factor); cinfo->scale_denom = 8; jpeg_start_decompress(cinfo); @@ -228,7 +228,7 @@ fz_open_dctd(fz_stream *chain, int color_transform) } fz_stream * -fz_open_resized_dctd(fz_stream *chain, int color_transform, int factor) +fz_open_resized_dctd(fz_stream *chain, int color_transform, int l2factor) { fz_context *ctx = chain->ctx; fz_dctd *state = NULL; @@ -242,7 +242,7 @@ fz_open_resized_dctd(fz_stream *chain, int color_transform, int factor) state->chain = chain; state->color_transform = color_transform; state->init = 0; - state->factor = factor; + state->l2factor = l2factor; } fz_catch(ctx) { |