[FFmpeg-cvslog] r21982 - trunk/libavcodec/bink.c

kostya subversion
Tue Feb 23 08:07:54 CET 2010


Author: kostya
Date: Tue Feb 23 08:07:54 2010
New Revision: 21982

Log:
Decode alpha plane in Bink video

Modified:
   trunk/libavcodec/bink.c

Modified: trunk/libavcodec/bink.c
==============================================================================
--- trunk/libavcodec/bink.c	Tue Feb 23 08:01:13 2010	(r21981)
+++ trunk/libavcodec/bink.c	Tue Feb 23 08:07:54 2010	(r21982)
@@ -911,12 +911,10 @@ static int decode_frame(AVCodecContext *
 
     init_get_bits(&gb, pkt->data, bits_count);
     if (c->has_alpha) {
-        int aplane_bits = get_bits_long(&gb, 32) << 3;
-        if (aplane_bits <= 32 || (aplane_bits & 0x1F)) {
-            av_log(avctx, AV_LOG_ERROR, "Incorrect alpha plane size %d\n", aplane_bits);
+        if (c->version >= 'i')
+            skip_bits_long(&gb, 32);
+        if (bink_decode_plane(c, &gb, 3, 0) < 0)
             return -1;
-        }
-        skip_bits_long(&gb, aplane_bits - 32);
     }
     if (c->version >= 'i')
         skip_bits_long(&gb, 32);
@@ -977,7 +975,7 @@ static av_cold int decode_init(AVCodecCo
         return 1;
     }
 
-    avctx->pix_fmt = PIX_FMT_YUV420P;
+    avctx->pix_fmt = c->has_alpha ? PIX_FMT_YUVA420P : PIX_FMT_YUV420P;
 
     avctx->idct_algo = FF_IDCT_BINK;
     dsputil_init(&c->dsp, avctx);



More information about the ffmpeg-cvslog mailing list