Commit cd8e6274 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/tiff: Factor constant computation out of inner loop

Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 2b4cc8d1
......@@ -1362,10 +1362,11 @@ static int decode_frame(AVCodecContext *avctx,
}
if (s->photometric == TIFF_PHOTOMETRIC_WHITE_IS_ZERO) {
int c = (s->avctx->pix_fmt == AV_PIX_FMT_PAL8 ? (1<<s->bpp) - 1 : 255);
dst = p->data[plane];
for (i = 0; i < s->height; i++) {
for (j = 0; j < stride; j++)
dst[j] = (s->avctx->pix_fmt == AV_PIX_FMT_PAL8 ? (1<<s->bpp) - 1 : 255) - dst[j];
dst[j] = c - dst[j];
dst += stride;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment