tiffdec: support predictor type 2 with RGB48 pixel format

This commit is contained in:
Jean First 2011-09-25 16:00:04 +02:00 committed by Justin Ruggles
parent 345a96c327
commit e75ef2b7f4
1 changed files with 18 additions and 4 deletions

View File

@ -635,12 +635,26 @@ 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->photometric == TIFF_PHOTOMETRIC_WHITE_IS_ZERO) { if (s->photometric == TIFF_PHOTOMETRIC_WHITE_IS_ZERO) {
dst = p->data[0]; dst = p->data[0];