Commit 72381b2b authored by Jean First's avatar Jean First Committed by Michael Niedermayer

tiffdec: add RGB48 (16bit) support

parent 035320a5
...@@ -601,11 +601,25 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -601,11 +601,25 @@ static int decode_frame(AVCodecContext *avctx,
dst = p->data[0]; dst = p->data[0];
soff = s->bpp >> 3; soff = s->bpp >> 3;
ssize = s->width * soff; 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(i = 0; i < s->height; i++) {
for(j = soff; j < ssize; j++) for(j = soff; j < ssize; j++)
dst[j] += dst[j - soff]; dst[j] += dst[j - soff];
dst += stride; dst += stride;
} }
}
} }
if(s->invert){ if(s->invert){
......
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