summaryrefslogtreecommitdiff
path: root/libavcodec/tiff.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2014-12-10 18:16:09 +0000
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-12-18 23:22:59 +0100
commit3a3790b8f8b56ee6abc93ccac280eb693675e294 (patch)
tree9935233c6d148f87dc241a8138deb4485760c85e /libavcodec/tiff.c
parent59f0275dd0a42a7f90271a83a78e9ca5e69ff5b0 (diff)
tiff: support encoding and decoding 64bit images
Diffstat (limited to 'libavcodec/tiff.c')
-rw-r--r--libavcodec/tiff.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 3b2fc7d900..a5ccab2ce8 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -273,6 +273,9 @@ static int init_image(TiffContext *s, AVFrame *frame)
case 483:
s->avctx->pix_fmt = s->le ? AV_PIX_FMT_RGB48LE : AV_PIX_FMT_RGB48BE;
break;
+ case 644:
+ s->avctx->pix_fmt = s->le ? AV_PIX_FMT_RGBA64LE : AV_PIX_FMT_RGBA64BE;
+ break;
default:
av_log(s->avctx, AV_LOG_ERROR,
"This format is not supported (bpp=%d, bppcount=%d)\n",
@@ -636,13 +639,15 @@ static int decode_frame(AVCodecContext *avctx,
dst = p->data[0];
soff = s->bpp >> 3;
ssize = s->width * soff;
- if (s->avctx->pix_fmt == AV_PIX_FMT_RGB48LE) {
+ if (s->avctx->pix_fmt == AV_PIX_FMT_RGB48LE ||
+ s->avctx->pix_fmt == AV_PIX_FMT_RGBA64LE) {
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 == AV_PIX_FMT_RGB48BE) {
+ } else if (s->avctx->pix_fmt == AV_PIX_FMT_RGB48BE ||
+ s->avctx->pix_fmt == AV_PIX_FMT_RGBA64BE) {
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));