[SCM] libav/experimental: tiffdec: support predictor type 2 with RGB48 pixel format

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Aug 10 16:02:48 UTC 2014


The following commit has been merged in the experimental branch:
commit e75ef2b7f48b96a9b6c8646058713899d5ea5731
Author: Jean First <jeanfirst at gmail.com>
Date:   Sun Sep 25 16:00:04 2011 +0200

    tiffdec: support predictor type 2 with RGB48 pixel format

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index d801302..6c72dc8 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -635,10 +635,24 @@ static int decode_frame(AVCodecContext *avctx,
         dst   = p->data[0];
         soff  = s->bpp >> 3;
         ssize = s->width * soff;
-        for (i = 0; i < s->height; i++) {
-            for (j = soff; j < ssize; j++)
-                dst[j] += dst[j - soff];
-            dst += stride;
+        if (s->avctx->pix_fmt == PIX_FMT_RGB48LE) {
+            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 == PIX_FMT_RGB48BE) {
+            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));
+                dst += stride;
+            }
+        } else {
+            for (i = 0; i < s->height; i++) {
+                for (j = soff; j < ssize; j++)
+                    dst[j] += dst[j - soff];
+                dst += stride;
+            }
         }
     }
 

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list