diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2014-12-10 18:16:09 +0000 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-12-18 23:22:59 +0100 |
commit | 3a3790b8f8b56ee6abc93ccac280eb693675e294 (patch) | |
tree | 9935233c6d148f87dc241a8138deb4485760c85e /libavcodec | |
parent | 59f0275dd0a42a7f90271a83a78e9ca5e69ff5b0 (diff) | |
download | ffmpeg-3a3790b8f8b56ee6abc93ccac280eb693675e294.tar.gz |
tiff: support encoding and decoding 64bit images
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/tiff.c | 9 | ||||
-rw-r--r-- | libavcodec/tiffenc.c | 3 | ||||
-rw-r--r-- | libavcodec/version.h | 2 |
3 files changed, 10 insertions, 4 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)); diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index f2734922f2..169360fdff 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -246,6 +246,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, s->subsampling[1] = 1; switch (avctx->pix_fmt) { + case AV_PIX_FMT_RGBA64LE: case AV_PIX_FMT_RGB48LE: case AV_PIX_FMT_GRAY16LE: case AV_PIX_FMT_RGBA: @@ -535,7 +536,7 @@ AVCodec ff_tiff_encoder = { .encode2 = encode_frame, .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB48LE, AV_PIX_FMT_PAL8, - AV_PIX_FMT_RGBA, + AV_PIX_FMT_RGBA, AV_PIX_FMT_RGBA64LE, AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16LE, AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_MONOWHITE, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, diff --git a/libavcodec/version.h b/libavcodec/version.h index fd774a71f3..d9589c223c 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -30,7 +30,7 @@ #define LIBAVCODEC_VERSION_MAJOR 56 #define LIBAVCODEC_VERSION_MINOR 6 -#define LIBAVCODEC_VERSION_MICRO 0 +#define LIBAVCODEC_VERSION_MICRO 1 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ |