summaryrefslogtreecommitdiff
path: root/libavcodec/tiff.c
diff options
context:
space:
mode:
authorJean First <jeanfirst@gmail.com>2011-09-25 16:00:04 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-25 16:00:04 +0200
commit72381b2b479d99962092ce458ac8e98f00528f86 (patch)
treedcc1964013f9d8cefa1a6a65b9fa8d7ab6edc9e8 /libavcodec/tiff.c
parent035320a52f44645da573a9f50b207c126ceab5c3 (diff)
tiffdec: add RGB48 (16bit) support
Diffstat (limited to 'libavcodec/tiff.c')
-rw-r--r--libavcodec/tiff.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index e2c80eff82..06b5b8ea78 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -601,11 +601,25 @@ static int decode_frame(AVCodecContext *avctx,
dst = p->data[0];
soff = s->bpp >> 3;
ssize = s->width * soff;
+ 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;
}
+ }
}
if(s->invert){