[FFmpeg-cvslog] lavc/tiff: add support for YUV deflate

James Almer git at videolan.org
Tue Aug 19 23:52:17 CEST 2014


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Tue Aug 19 17:33:40 2014 -0300| [201a511bb9dd3c988e5c5ebd69811a6509909e8f] | committer: James Almer

lavc/tiff: add support for YUV deflate

Signed-off-by: James Almer <jamrial at gmail.com>

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

 libavcodec/tiff.c |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 980aaf1..2bb7c90 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -333,9 +333,9 @@ static int tiff_uncompress(uint8_t *dst, unsigned long *len, const uint8_t *src,
     return zret == Z_STREAM_END ? Z_OK : zret;
 }
 
-static int tiff_unpack_zlib(TiffContext *s, uint8_t *dst, int stride,
-                            const uint8_t *src, int size,
-                            int width, int lines)
+static int tiff_unpack_zlib(TiffContext *s, AVFrame *p, uint8_t *dst, int stride,
+                            const uint8_t *src, int size, int width, int lines,
+                            int strip_start, int is_yuv)
 {
     uint8_t *zbuf;
     unsigned long outlen;
@@ -366,6 +366,10 @@ static int tiff_unpack_zlib(TiffContext *s, uint8_t *dst, int stride,
         } else {
             memcpy(dst, src, width);
         }
+        if (is_yuv) {
+            unpack_yuv(s, p, dst, strip_start + line);
+            line += s->subsampling[1] - 1;
+        }
         dst += stride;
         src += width;
     }
@@ -443,12 +447,9 @@ static int tiff_unpack_strip(TiffContext *s, AVFrame *p, uint8_t *dst, int strid
     }
 
     if (s->compr == TIFF_DEFLATE || s->compr == TIFF_ADOBE_DEFLATE) {
-        if (is_yuv) {
-            av_log(s->avctx, AV_LOG_ERROR, "YUV deflate is unsupported");
-            return AVERROR_PATCHWELCOME;
-        }
 #if CONFIG_ZLIB
-        return tiff_unpack_zlib(s, dst, stride, src, size, width, lines);
+        return tiff_unpack_zlib(s, p, dst, stride, src, size, width, lines,
+                                strip_start, is_yuv);
 #else
         av_log(s->avctx, AV_LOG_ERROR,
                "zlib support not enabled, "



More information about the ffmpeg-cvslog mailing list