diff options
Diffstat (limited to 'fitz')
-rw-r--r-- | fitz/filt_dctd.c | 8 | ||||
-rw-r--r-- | fitz/fitz-internal.h | 4 | ||||
-rw-r--r-- | fitz/stm_comp_buf.c | 22 |
3 files changed, 17 insertions, 17 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) { diff --git a/fitz/fitz-internal.h b/fitz/fitz-internal.h index 043449db..528fb50a 100644 --- a/fitz/fitz-internal.h +++ b/fitz/fitz-internal.h @@ -753,7 +753,7 @@ fz_stream *fz_open_a85d(fz_stream *chain); fz_stream *fz_open_ahxd(fz_stream *chain); fz_stream *fz_open_rld(fz_stream *chain); fz_stream *fz_open_dctd(fz_stream *chain, int color_transform); -fz_stream *fz_open_resized_dctd(fz_stream *chain, int color_transform, int factor); +fz_stream *fz_open_resized_dctd(fz_stream *chain, int color_transform, int l2factor); fz_stream *fz_open_faxd(fz_stream *chain, int k, int end_of_line, int encoded_byte_align, int columns, int rows, int end_of_block, int black_is_1); @@ -845,7 +845,7 @@ typedef struct fz_compressed_buffer_s fz_compressed_buffer; unsigned int fz_compressed_buffer_size(fz_compressed_buffer *buffer); fz_stream *fz_open_compressed_buffer(fz_context *ctx, fz_compressed_buffer *); -fz_stream *fz_open_image_decomp_stream(fz_context *ctx, fz_compressed_buffer *, int *factor); +fz_stream *fz_open_image_decomp_stream(fz_context *ctx, fz_compressed_buffer *, int *l2factor); enum { diff --git a/fitz/stm_comp_buf.c b/fitz/stm_comp_buf.c index 54653536..7fa48cb0 100644 --- a/fitz/stm_comp_buf.c +++ b/fitz/stm_comp_buf.c @@ -15,7 +15,7 @@ fz_free_compressed_buffer(fz_context *ctx, fz_compressed_buffer *buf) fz_stream * -fz_open_image_decomp_stream(fz_context *ctx, fz_compressed_buffer *buffer, int *factor) +fz_open_image_decomp_stream(fz_context *ctx, fz_compressed_buffer *buffer, int *l2factor) { fz_stream *chain = fz_open_buffer(ctx, buffer->buffer); fz_compression_params *params = &buffer->params; @@ -23,7 +23,7 @@ fz_open_image_decomp_stream(fz_context *ctx, fz_compressed_buffer *buffer, int * switch (params->type) { case FZ_IMAGE_FAX: - *factor = 1; + *l2factor = 0; return fz_open_faxd(chain, params->u.fax.k, params->u.fax.end_of_line, @@ -33,26 +33,26 @@ fz_open_image_decomp_stream(fz_context *ctx, fz_compressed_buffer *buffer, int * params->u.fax.end_of_block, params->u.fax.black_is_1); case FZ_IMAGE_JPEG: - if (*factor > 8) - *factor = 8; - return fz_open_resized_dctd(chain, params->u.jpeg.color_transform, *factor); + if (*l2factor > 8) + *l2factor = 8; + return fz_open_resized_dctd(chain, params->u.jpeg.color_transform, *l2factor); case FZ_IMAGE_RLD: - *factor = 1; + *l2factor = 0; return fz_open_rld(chain); case FZ_IMAGE_FLATE: - *factor = 1; + *l2factor = 0; chain = fz_open_flated(chain); if (params->u.flate.predictor > 1) chain = fz_open_predict(chain, params->u.flate.predictor, params->u.flate.columns, params->u.flate.colors, params->u.flate.bpc); return chain; case FZ_IMAGE_LZW: - *factor = 1; + *l2factor = 0; chain = fz_open_lzwd(chain, params->u.lzw.early_change); if (params->u.lzw.predictor > 1) chain = fz_open_predict(chain, params->u.lzw.predictor, params->u.lzw.columns, params->u.lzw.colors, params->u.lzw.bpc); return chain; default: - *factor = 1; + *l2factor = 0; break; } @@ -62,9 +62,9 @@ fz_open_image_decomp_stream(fz_context *ctx, fz_compressed_buffer *buffer, int * fz_stream * fz_open_compressed_buffer(fz_context *ctx, fz_compressed_buffer *buffer) { - int factor = 1; + int l2factor = 0; - return fz_open_image_decomp_stream(ctx, buffer, &factor); + return fz_open_image_decomp_stream(ctx, buffer, &l2factor); } unsigned int |