[FFmpeg-cvslog] tiff: support inverted fill_order for packbits compression

Paul B Mahol git at videolan.org
Wed May 29 15:51:14 CEST 2013


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue May 28 17:20:29 2013 +0000| [7984ed87c13df89030c85a531047e6514d9fcdc6] | committer: Paul B Mahol

tiff: support inverted fill_order for packbits compression

Fixes #1995.

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

 libavcodec/tiff.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 839209b..42cead7 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -549,7 +549,7 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t *dst, int stride,
                     av_log(s->avctx, AV_LOG_ERROR, "Read went out of bounds\n");
                     return AVERROR_INVALIDDATA;
                 }
-                code = (int8_t) * src++;
+                code = s->fill_order ? (int8_t) ff_reverse[*src++]: (int8_t) *src++;
                 if (code >= 0) {
                     code++;
                     if (pixels + code > width) {
@@ -578,6 +578,11 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t *dst, int stride,
                     pixels += code;
                 }
             }
+            if (s->fill_order) {
+                int i;
+                for (i = 0; i < width; i++)
+                    dst[i] = ff_reverse[dst[i]];
+            }
             break;
         case TIFF_LZW:
             pixels = ff_lzw_decode(s->lzw, dst, width);



More information about the ffmpeg-cvslog mailing list