diff options
author | Michael Niedermayer | 2017-04-11 03:37:35 +0200 |
---|---|---|
committer | Michael Niedermayer | 2017-04-11 17:58:26 +0200 |
commit | cd8e62746fedd1f593a9d441bd3a4ea137c919bb (patch) | |
tree | 441a382a4268069fd24d0c0af9b56a2eedd67d8f /libavcodec/tiff.c | |
parent | 2b4cc8d1bbff0cc849cbda1fe37d74f9ea425394 (diff) |
avcodec/tiff: Factor constant computation out of inner loop
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/tiff.c')
-rw-r--r-- | libavcodec/tiff.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 3aaf63338d..cb1a34e73a 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -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; } } |