[FFmpeg-devel] [PATCH] IFF: Add grayscale support to decoder

Sebastian Vater cdgs.basty
Mon May 10 19:25:07 CEST 2010


Ronald S. Bultje a ?crit :
> Hi,
>
> On Mon, May 10, 2010 at 12:07 PM, Sebastian Vater
> <cdgs.basty at googlemail.com> wrote:
>   
>> Ronald S. Bultje a ?crit :
>>     
>>> On Mon, May 10, 2010 at 12:00 PM, Sebastian Vater
>>> <cdgs.basty at googlemail.com> wrote:
>>>       
>>>> Ronald S. Bultje a ?crit :
>>>>         
>>>>> On Mon, May 10, 2010 at 11:32 AM, Sebastian Vater
>>>>> <cdgs.basty at googlemail.com> wrote:
>>>>>           
>>>>>> +    if (count > 0) { // PIX_FMT_RGB8
>>>>>>
>>>>>>             
>>>>> if (count) { //...
>>>>>
>>>>>           
>>>> It should really check for just > 0 (is signed)...if we start to play
>>>> later with extradata stuff and have to subtract, it might be get < 0.
>>>>         
>>> Isn't count < 0 a bug?
>>>       
>> In both cases, the for loop which converts CMAP to lavc isn't executed,
>> so it will create in both cases a grayscale palette.
>>     
>
> I get that, but it doesn't answer the question: is count < 0 a bug, or
> is that expected behaviour which we could reasonably expect to get in
> the decoder?
>   

Yes it may become expected behaviour, with custom extradata!

> But can it get < 0? And should it get < 0? And if so, what does that mean?
>   

It means that there's no actual palette data itself attached from an old
demuxer, the new decoder will then subtract the custom extra data size
and this will < 0, of course this should be handled as no palette and
therefore use grayscale palette ;)

-- 

Best regards,
                   :-) Basty/CDGS (-:




More information about the ffmpeg-devel mailing list