Skip to content

Commit

Permalink
avcodec/tiff: Factor constant computation out of inner loop
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Apr 11, 2017
1 parent 2b4cc8d commit cd8e627
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libavcodec/tiff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit cd8e627

Please sign in to comment.