[Ffmpeg-devel] [PATCH] add support for indexed 8bpp BMP files

Michael Niedermayer michaelni
Fri Apr 6 19:03:11 CEST 2007


Hi

On Fri, Apr 06, 2007 at 04:54:28PM +0200, lode leroy wrote:
> This patch adds 8bpp support to libavcodec's bmp.c
> both gray and indexed (using a palette)
> 
> There was a typo in the patch I previously sent...
> (I tested it with -rc1 and didn't retest fully with the svn-export 
> version...)
[...]
> @@ -143,6 +147,16 @@
>          if(comp == BMP_RGB)
>              avctx->pix_fmt = PIX_FMT_RGB555;
>          break;
> +    case 8:
> +	buf += 12;
> +	clrused = bytestream_get_le32(&buf);
> +	clrimportant = bytestream_get_le32(&buf);
> +	avctx->pix_fmt = PIX_FMT_GRAY8;
> +	if (clrused > 0) {
> +	    avctx->pix_fmt = PIX_FMT_PAL8;
> +	    pal = buf0+14+ihsize;
> +	}

tabs and trailing whitespace are forbidden in svn


[...]
> +	if (avctx->pix_fmt == PIX_FMT_PAL8) {
> +        av_log(avctx, AV_LOG_ERROR, "copying palette with %d colors\n", clrimportant);

whats this? 

> +	    
> +	    memcpy(p->data[1], pal, clrimportant*sizeof(uint32_t));

likely wrong on big endian


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070406/7920730a/attachment.pgp>



More information about the ffmpeg-devel mailing list