[FFmpeg-devel] [PATCH] HAM6/HAM8 support for IFF demuxer/decoder
Michael Niedermayer
michaelni
Wed May 5 18:43:51 CEST 2010
On Wed, May 05, 2010 at 05:28:07PM +0200, Sebastian Vater wrote:
> Sebastian Vater a ?crit :
> > Because of backward compatibility I have changed it to append the
> > extradata struct after the palette (because in the original version, the
> > palette data was always at 0).
> >
>
> I just changed the minimum size of extradata to 256*3 (768 bytes). This
> will allow the new decoder to detect old libavformat/iff.c which doesn't
> set a large palette.
>
> The palette data from old demuxer was never larger than 256*3 bytes (8
> bit palette, RGB each).
>
[...]
> @@ -152,9 +157,15 @@ 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;
> + screenmode = get_be32(pb);
> + break;
can this value change from frame to frame or is it constant throghout a movie?
if it can change then it must be stored in AVPacket.data
> +
> case ID_CMAP:
> - st->codec->extradata_size = data_size;
> - st->codec->extradata = av_malloc(data_size);
> + st->codec->extradata_size = data_size + IFF_EXTRA_CONTEXT_SIZE;
> + st->codec->extradata = av_malloc(data_size + IFF_EXTRA_CONTEXT_SIZE);
> if (!st->codec->extradata)
> return AVERROR(ENOMEM);
> if (get_buffer(pb, st->codec->extradata, data_size) < 0)
> @@ -169,12 +180,15 @@ static int iff_read_header(AVFormatContext *s,
> st->codec->height = get_be16(pb);
> url_fskip(pb, 4); // x, y offset
> st->codec->bits_per_coded_sample = get_byte(pb);
> - if (data_size >= 11) {
> - url_fskip(pb, 1); // masking
> + if (data_size >= 10)
> + masking = get_byte(pb);
> + if (data_size >= 11)
> compression = get_byte(pb);
> + if (data_size >= 14) {
> + url_fskip(pb, 1); // padding
> + transparency = get_be16(pb);
> }
it appears to me that the whole above should be stored in extradata as is
or maybe even the whole BMHD
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.
-------------- 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/20100505/32dc2b13/attachment.pgp>
More information about the ffmpeg-devel
mailing list