diff options
author | Jean First <jeanfirst@gmail.com> | 2011-09-25 16:00:04 +0200 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2014-04-12 14:52:10 -0400 |
commit | e75ef2b7f48b96a9b6c8646058713899d5ea5731 (patch) | |
tree | 243eb4ea9784811e96ec609ddd8393700e5acfd3 /libavcodec | |
parent | 345a96c327e8f2a8077189af9f5e8d2b3f4ad5fe (diff) | |
download | ffmpeg-e75ef2b7f48b96a9b6c8646058713899d5ea5731.tar.gz |
tiffdec: support predictor type 2 with RGB48 pixel format
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/tiff.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index d801302704..6c72dc8293 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -635,10 +635,24 @@ static int decode_frame(AVCodecContext *avctx, dst = p->data[0]; soff = s->bpp >> 3; ssize = s->width * soff; - for (i = 0; i < s->height; i++) { - for (j = soff; j < ssize; j++) - dst[j] += dst[j - soff]; - dst += stride; + if (s->avctx->pix_fmt == PIX_FMT_RGB48LE) { + for (i = 0; i < s->height; i++) { + for (j = soff; j < ssize; j += 2) + AV_WL16(dst + j, AV_RL16(dst + j) + AV_RL16(dst + j - soff)); + dst += stride; + } + } else if (s->avctx->pix_fmt == PIX_FMT_RGB48BE) { + for (i = 0; i < s->height; i++) { + for (j = soff; j < ssize; j += 2) + AV_WB16(dst + j, AV_RB16(dst + j) + AV_RB16(dst + j - soff)); + dst += stride; + } + } else { + for (i = 0; i < s->height; i++) { + for (j = soff; j < ssize; j++) + dst[j] += dst[j - soff]; + dst += stride; + } } } |