[FFmpeg-devel] [PATCH] XWD decoder and encoder

Paul B Mahol onemda at gmail.com
Fri Jan 20 00:24:50 CET 2012


On 1/19/12, Paul B Mahol <onemda at gmail.com> wrote:
> On 1/19/12, Reimar Doeffinger <Reimar.Doeffinger at gmx.de> wrote:
>> On Thu, Jan 19, 2012 at 05:43:25AM +0000, Paul B Mahol wrote:
>>> +    cmap = bytestream_get_be32(&buf);
>>> +    buf += hsize - 80;
>>
>> Supposedly the rest contains the window name.
>> Would make sense to export that as metadata IMO.
>
> AFAIK not supported by our API.
>>
>>> +            buf  += 4;
>>> +            red   = bytestream_get_be16(&buf) >> 8;
>>> +            green = bytestream_get_be16(&buf) >> 8;
>>> +            blue  = bytestream_get_be16(&buf) >> 8;
>>> +            buf  += 2;
>>
>> I guess you could just pick out the right bytes directly, like
>> red = buf[4];
>> red = buf[6];
>> red = buf[8];
>> buf += 10;
>> I am also completely unclear on whether the "flags" should be
>> respected, in which case it should be something along the lines of
>> red = buf[9] & 1 ? buf[4] : 0;
>> etc.
>
> Will explore.

There is one sample: brain.xwd, with corrupted color map,
xwud displays it ignoring flags.

If we do not ignore flags it will certainly looks wrong and different
from xwud output.

Gimp have extra checks to detect if colormap is valid (bad index and/or flag).
But unfortunately Gimp can not open this file.


More information about the ffmpeg-devel mailing list