[FFmpeg-devel] [PATCH] HAM6/HAM8 support for IFF demuxer/decoder
Peter Ross
pross
Thu Apr 29 11:09:41 CEST 2010
On Wed, Apr 28, 2010 at 11:17:12PM +0200, Sebastian Vater wrote:
> Sebastian Vater a ?crit :
> > So here is it!
> >
> > The long awaited HAM6/8 decoding support for IFF-ILBM.
Yep, glad somebody took the time.
> +#define CAMG_EHB 0x80 // Extra HalfBrite
Macro isn't used.
> @@ -152,6 +157,12 @@ static int iff_read_header(AVFormatContext *s,
> st->codec->channels = (get_be32(pb) < 6) ? 1 : 2;
> break;
>
> + case ID_CAMG:
> + if (data_size < 4)
> + return AVERROR_INVALIDDATA;
Is this really neccessary. We dont check data_size for any of the other tags.
> + if (iff->camg_display_mode & CAMG_HAM) {
> + switch (st->codec->bits_per_coded_sample) {
> + case 6: // HAM6
> + st->codec->bits_per_coded_sample = 12; // 4096 color HAM6 image
> + break;
> +
> + case 8: // HAM8
> + st->codec->bits_per_coded_sample = 18; // 262144 color HAM8 image
> + break;
My only concern here is that 'bits_per_coded_sample' is being abused to
indicate both bpp *and* whether HAM coding is used. If somebody out there
encodes 12-bit RGB into IFF then we will have a problem.
-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100429/66969c5b/attachment.pgp>
More information about the ffmpeg-devel
mailing list