diff options
author | Jean First <jeanfirst@gmail.com> | 2011-09-25 18:03:21 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-09-25 18:14:33 +0400 |
commit | 1a0770f3f71ac285a314273ead5f08a9c3966c20 (patch) | |
tree | 3a646d3c8f9d6896057d693663dd6b8d83b5976c /libavcodec/tiffenc.c | |
parent | 72381b2b479d99962092ce458ac8e98f00528f86 (diff) |
tiffenc: Enable RGB48LE (16-bit) encoding support
Diffstat (limited to 'libavcodec/tiffenc.c')
-rw-r--r-- | libavcodec/tiffenc.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index d8df77c641..722d78fc8b 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -247,6 +247,14 @@ static int encode_frame(AVCodecContext * avctx, unsigned char *buf, s->subsampling[1] = 1; switch (avctx->pix_fmt) { + case PIX_FMT_RGB48LE: + s->bpp = 48; + s->photometric_interpretation = 2; + bpp_tab[0] = 16; + bpp_tab[1] = 16; + bpp_tab[2] = 16; + bpp_tab[3] = 16; + break; case PIX_FMT_RGB24: s->bpp = 24; s->photometric_interpretation = 2; @@ -285,7 +293,7 @@ static int encode_frame(AVCodecContext * avctx, unsigned char *buf, return -1; } if (!is_yuv) - s->bpp_tab_size = ((s->bpp + 7) >> 3); + s->bpp_tab_size = (s->bpp >= 48) ? ((s->bpp + 7) >> 4):((s->bpp + 7) >> 3); if (s->compr == TIFF_DEFLATE || s->compr == TIFF_ADOBE_DEFLATE || s->compr == TIFF_LZW) //best choose for DEFLATE @@ -462,7 +470,7 @@ AVCodec ff_tiff_encoder = { PIX_FMT_MONOBLACK, PIX_FMT_MONOWHITE, PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_YUV410P, - PIX_FMT_YUV411P, + PIX_FMT_YUV411P, PIX_FMT_RGB48LE, PIX_FMT_NONE}, .long_name = NULL_IF_CONFIG_SMALL("TIFF image"), .priv_class= &class, |