[FFmpeg-devel] [PATCH] HAM6/HAM8 support for IFF demuxer/decoder

Sebastian Vater cdgs.basty
Wed May 5 19:01:48 CEST 2010


Michael Niedermayer a ?crit :
> On Wed, May 05, 2010 at 05:28:07PM +0200, Sebastian Vater wrote:
>   
>
>> @@ -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
>   

Screenmode is constant, of course. Have you ever seen any video format
which opens a new screen (i.e. changes video mode)?

Even if the amiga supports multiple screenmodes at once (even
overlapping), opening a new screen (and even changing current one) would
cause enormous flicker.

>   
> [...]
>   
>>              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
>   

They're transfered to extradata at the end, anyway but for now we really
don't need more.

BTW, I did a fatal mistake during my last patch. It caused a segfault on
any truecolor images (i.e. non-HAM).

But now I tested all IFF images I have before submitting the patch here.
So this one won't have such faults!

Apart from this, I also added a more nice documentation to the new
extradata structure in iff.h.

-- 

Best regards,
                   :-) Basty/CDGS (-

-------------- next part --------------
A non-text attachment was scrubbed...
Name: iff-ham-support.patch
Type: text/x-patch
Size: 15162 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100505/f8ac0758/attachment.bin>



More information about the ffmpeg-devel mailing list