[FFmpeg-devel] [PATCH]Fix tiff grayscale palette

Michael Niedermayer michaelni at gmx.at
Mon Aug 29 15:34:24 CEST 2011


On Mon, Aug 29, 2011 at 09:42:37AM +0200, Carl Eugen Hoyos wrote:
> Hi!
> 
> Fixes ticket 417.
> 
> Please comment, Carl Eugen

>  tiff.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 3d09f19188fa8a7d9391e046953ad70385106749  patchtiffgray.diff
> diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
> index 1997e54..ab67ea5 100644
> --- a/libavcodec/tiff.c
> +++ b/libavcodec/tiff.c
> @@ -294,8 +294,8 @@ static int init_image(TiffContext *s)
>          } else {
>              /* make default grayscale pal */
>              pal = (uint32_t *) s->picture.data[1];
> -            for (i = 0; i < 256; i++)
> -                pal[i] = i * 0x010101;
> +            for (i = 0; i < 1<<s->bpp; i++)
> +                pal[256 - (1<<s->bpp) + i] = i * 255 / ((1<<s->bpp) - 1) * 0x010101;

filling the top only looks a bit strange why is it not
pal[0..(1<<bpp)] ?


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Avoid a single point of failure, be that a person or equipment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110829/d0e36618/attachment.asc>


More information about the ffmpeg-devel mailing list