diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2014-05-23 15:13:39 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2014-05-23 15:13:39 +0200 |
commit | 5aa2e01f585075cea6854897503f72fcb6f6a8a0 (patch) | |
tree | 99dade4845a7f141464d3103e3e55792ead86d22 | |
parent | 30dcebf32f5ac4df97ef477c6a5b4a8c8d247527 (diff) | |
download | mupdf-5aa2e01f585075cea6854897503f72fcb6f6a8a0.tar.xz |
Fix 695041: add special fast case for 8bpp TIFF predictor.
-rw-r--r-- | source/fitz/filter-predict.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/fitz/filter-predict.c b/source/fitz/filter-predict.c index 6862f8c9..3aaa6ee9 100644 --- a/source/fitz/filter-predict.c +++ b/source/fitz/filter-predict.c @@ -67,7 +67,19 @@ fz_predict_tiff(fz_predict *state, unsigned char *out, unsigned char *in, int le for (k = 0; k < state->colors; k++) left[k] = 0; - memset(out, 0, state->stride); + + /* special fast case */ + if (state->bpc == 8) + { + for (i = 0; i < state->columns; i++) + for (k = 0; k < state->colors; k++) + *out++ = left[k] = (*in++ + left[k]) & 0xFF; + return; + } + + /* putcomponent assumes zeroed memory for bpc < 8 */ + if (state->bpc < 8) + memset(out, 0, state->stride); for (i = 0; i < state->columns; i++) { |