diff iff.c @ 11719:30356abc8604 libavcodec

Move handling of paletted data to the IFF demuxer. This allows future handling of things such as masking/EHB/HAM for this type of data. Patch by Sebastian Vater <cdgs basty googlemail com>.
author rbultje
date Thu, 13 May 2010 15:39:40 +0000
parents f2beca0bbf98
children 92f4ca7a4002
line wrap: on
line diff
--- a/iff.c	Thu May 13 15:33:36 2010 +0000
+++ b/iff.c	Thu May 13 15:39:40 2010 +0000
@@ -218,6 +218,7 @@
         return -1;
     }
 
+    if (avctx->codec_tag == MKTAG('I','L','B','M')) { // interleaved
     if (avctx->pix_fmt == PIX_FMT_PAL8) {
         for(y = 0; y < avctx->height; y++ ) {
             uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ];
@@ -237,6 +238,13 @@
             }
         }
     }
+    } else if (avctx->pix_fmt == PIX_FMT_PAL8) { // IFF-PBM
+        for(y = 0; y < avctx->height; y++ ) {
+            uint8_t *row = &s->frame.data[0][y * s->frame.linesize[0]];
+            memcpy(row, buf, FFMIN(avctx->width, buf_end - buf));
+            buf += avctx->width;
+        }
+    }
 
     *data_size = sizeof(AVFrame);
     *(AVFrame*)data = s->frame;