[FFmpeg-cvslog] tiffenc: Enable RGB48LE (16-bit) encoding support

Jean First git at videolan.org
Sun Sep 25 16:56:01 CEST 2011


ffmpeg | branch: master | Jean First <jeanfirst at gmail.com> | Sun Sep 25 16:03:21 2011 +0200| [1a0770f3f71ac285a314273ead5f08a9c3966c20] | committer: Michael Niedermayer

tiffenc: Enable RGB48LE (16-bit) encoding support

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1a0770f3f71ac285a314273ead5f08a9c3966c20
---

 libavcodec/tiffenc.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c
index d8df77c..722d78f 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,



More information about the ffmpeg-cvslog mailing list