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

Måns Rullgård mans
Thu May 13 21:06:17 CEST 2010


"Ronald S. Bultje" <rsbultje at gmail.com> writes:

> Hi,
>
> On Thu, May 13, 2010 at 2:55 PM, Sebastian Vater
> <cdgs.basty at googlemail.com> wrote:
>> Ronald S. Bultje a ?crit :
>>> On Thu, May 13, 2010 at 1:25 PM, Sebastian Vater
>>> <cdgs.basty at googlemail.com> wrote:
>>>> So this patch fixes this issue by setting PIX_FMT_GRAY8 only if bpp == 8
>>>> and initializes a custom RGB color palette for bpp < 8 simulating
>>>> correct behaviour (pictures are way too dark otherwise).
>>>>
>>>> Please note that the GRAY2RGB macro will later be used by HAM, too.
>>>
>>>> +#define GRAY2RGB(x) (((x) << 16) | ((x) << ?8) | (x))
>>>
>>> So, this is OK in principle, but you're calculating x 3 times here.
>>> Just look at the disasembly. A static inline function might be better.
>>
>> Fixed.
> [..]
>> +    return ((x) << 16) | ((x) <<  8) | (x);
>
> Too many brackets again... :-).

Yes, all of them can be removed.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list