[FFmpeg-cvslog] r23112 - in trunk: libavcodec/iff.c libavformat/iff.c

rbultje subversion
Thu May 13 17:39:40 CEST 2010


Author: rbultje
Date: Thu May 13 17:39:40 2010
New Revision: 23112

Log:
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>.

Modified:
   trunk/libavcodec/iff.c
   trunk/libavformat/iff.c

Modified: trunk/libavcodec/iff.c
==============================================================================
--- trunk/libavcodec/iff.c	Thu May 13 17:33:36 2010	(r23111)
+++ trunk/libavcodec/iff.c	Thu May 13 17:39:40 2010	(r23112)
@@ -218,6 +218,7 @@ static int decode_frame_ilbm(AVCodecCont
         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 @@ static int decode_frame_ilbm(AVCodecCont
             }
         }
     }
+    } 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;

Modified: trunk/libavformat/iff.c
==============================================================================
--- trunk/libavformat/iff.c	Thu May 13 17:33:36 2010	(r23111)
+++ trunk/libavformat/iff.c	Thu May 13 17:39:40 2010	(r23112)
@@ -256,13 +256,7 @@ static int iff_read_header(AVFormatConte
     case AVMEDIA_TYPE_VIDEO:
         switch (compression) {
         case BITMAP_RAW:
-            if (st->codec->codec_tag == ID_ILBM) {
                 st->codec->codec_id = CODEC_ID_IFF_ILBM;
-            } else {
-                st->codec->codec_id = CODEC_ID_RAWVIDEO;
-                st->codec->pix_fmt  = PIX_FMT_PAL8;
-                st->codec->codec_tag = 0;
-            }
             break;
         case BITMAP_BYTERUN1:
             st->codec->codec_id = CODEC_ID_IFF_BYTERUN1;
@@ -299,18 +293,6 @@ static int iff_read_packet(AVFormatConte
             return AVERROR(ENOMEM);
         }
         interleave_stereo(sample_buffer, pkt->data, PACKET_SIZE);
-    } else if (st->codec->codec_id == CODEC_ID_RAWVIDEO) {
-        if(av_new_packet(pkt, iff->body_size + AVPALETTE_SIZE) < 0) {
-            return AVERROR(ENOMEM);
-        }
-
-        ret = ff_cmap_read_palette(st->codec, (uint32_t*)(pkt->data + iff->body_size));
-        if (ret < 0)
-            return ret;
-        av_freep(&st->codec->extradata);
-        st->codec->extradata_size = 0;
-
-        ret = get_buffer(pb, pkt->data, iff->body_size);
     } else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
         ret = av_get_packet(pb, pkt, iff->body_size);
     } else {



More information about the ffmpeg-cvslog mailing list