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

Ronald S. Bultje rsbultje
Thu May 13 17:07:33 CEST 2010


Hi,

On Thu, May 13, 2010 at 10:40 AM, Sebastian Vater
<cdgs.basty at googlemail.com> wrote:
> So here is an updated version of grayscale support which fixes:
>
> 1. Removal of unneeded parenthesis.
> 2. Changed 'if (count > 0)' to 'if (count)'.
> 3. Changed '? (extradata_size == 0) : GRAY8 ? PAL8' to '? extradata_size
> : PAL8 ? GRAY8.
[.]
> +    } else { // PIX_FMT_GRAY8 has no color palette, create one
> +        uint8_t *gray_pal = (uint8_t *) pal;
> +        count = 1 << avctx->bits_per_coded_sample;
> +
> +        for (i=0; i < count; i++) {
> +            gray_pal[i] = (i * 255) >> avctx->bits_per_coded_sample;
> +        }
> +    }

Is the palette actually used for GRAY8? I don't think so.

Ronald



More information about the ffmpeg-devel mailing list