tiffdec: add RGB48 (16bit) support

This commit is contained in:
Jean First 2011-09-25 16:00:04 +02:00 committed by Michael Niedermayer
parent 035320a52f
commit 72381b2b47

View File

@ -601,12 +601,26 @@ 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){
uint8_t *src;