[FFmpeg-cvslog] r20927 - in trunk: libavcodec/interplayvideo.c libavformat/ipmovie.c

kostya subversion
Sun Dec 27 09:21:40 CET 2009


Author: kostya
Date: Sun Dec 27 09:21:40 2009
New Revision: 20927

Log:
Recognize 16-bit Interplay Video variant

Modified:
   trunk/libavcodec/interplayvideo.c
   trunk/libavformat/ipmovie.c

Modified: trunk/libavcodec/interplayvideo.c
==============================================================================
--- trunk/libavcodec/interplayvideo.c	Sun Dec 27 09:15:19 2009	(r20926)
+++ trunk/libavcodec/interplayvideo.c	Sun Dec 27 09:21:40 2009	(r20927)
@@ -67,6 +67,7 @@ typedef struct IpvideoContext {
     const unsigned char *buf;
     int size;
 
+    int is_16bpp;
     const unsigned char *stream_ptr;
     const unsigned char *stream_end;
     unsigned char *pixel_ptr;
@@ -620,7 +621,12 @@ static av_cold int ipvideo_decode_init(A
         return -1;
     }
 
-    avctx->pix_fmt = PIX_FMT_PAL8;
+    s->is_16bpp = avctx->bits_per_coded_sample == 16;
+    avctx->pix_fmt = s->is_16bpp ? PIX_FMT_RGB555 : PIX_FMT_PAL8;
+    if (s->is_16bpp) {
+        av_log(avctx, AV_LOG_ERROR, "16-bit Interplay video is not supported yet.\n");
+        return -1;
+    }
     dsputil_init(&s->dsp, avctx);
 
     /* decoding map contains 4 bits of information per 8x8 block */

Modified: trunk/libavformat/ipmovie.c
==============================================================================
--- trunk/libavformat/ipmovie.c	Sun Dec 27 09:15:19 2009	(r20926)
+++ trunk/libavformat/ipmovie.c	Sun Dec 27 09:21:40 2009	(r20927)
@@ -93,6 +93,7 @@ typedef struct IPMVEContext {
 
     uint64_t frame_pts_inc;
 
+    unsigned int video_bpp;
     unsigned int video_width;
     unsigned int video_height;
     int64_t video_pts;
@@ -375,6 +376,11 @@ static int process_ipmovie_chunk(IPMVECo
             }
             s->video_width = AV_RL16(&scratch[0]) * 8;
             s->video_height = AV_RL16(&scratch[2]) * 8;
+            if (opcode_version < 2 || !AV_RL16(&scratch[6])) {
+                s->video_bpp = 8;
+            } else {
+                s->video_bpp = 16;
+            }
             debug_ipmovie("video resolution: %d x %d\n",
                 s->video_width, s->video_height);
             break;
@@ -565,6 +571,7 @@ static int ipmovie_read_header(AVFormatC
     st->codec->codec_tag = 0;  /* no fourcc */
     st->codec->width = ipmovie->video_width;
     st->codec->height = ipmovie->video_height;
+    st->codec->bits_per_coded_sample = ipmovie->video_bpp;
 
     /* palette considerations */
     st->codec->palctrl = &ipmovie->palette_control;



More information about the ffmpeg-cvslog mailing list