[FFmpeg-devel] [PATCH]Fix some 1bpp tiff samples

Michael Niedermayer michaelni at gmx.at
Sat Dec 31 19:00:07 CET 2011


On Sat, Dec 31, 2011 at 04:52:35PM +0100, Carl Eugen Hoyos wrote:
> On Saturday 31 December 2011 04:09:51 pm Michael Niedermayer wrote:
> > On Sat, Dec 31, 2011 at 01:14:53PM +0000, Carl Eugen Hoyos wrote:
> > > I will commit the third patch with fate changes if nobody objects.
> 
> Sorry for this nonsense...
> 
> > changing mono to pal8 when unneeded seems like a bad idea
> > a 2000x1000 image changes from 250kb to 2mb
> 
> Of course, and thank you for the fix.
> 
> I believe attached (or similar) is still necessary for raw and packed, I only 
> tested with forcing s->palette_is_set to 0.
> 
> Please comment, Carl Eugen

>  tiff.c |    9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 0a74113a3ef787d8aa2b9c8ebb80841138050920  patchtif1bpppal82.diff
> diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
> index b353677..0ad8d97 100644
> --- a/libavcodec/tiff.c
> +++ b/libavcodec/tiff.c
> @@ -224,7 +224,8 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t* dst, int stride, const uin
>              if (ssrc + size - src < width)
>                  return AVERROR_INVALIDDATA;
>              if (!s->fill_order) {
> -                horizontal_fill(s->bpp, dst, 1, src, 0, width, 0);
> +                horizontal_fill(s->bpp * s->avctx->pix_fmt == PIX_FMT_PAL8,
> +                                dst, 1, src, 0, width, 0);


this looks odd, did you mean
s->bpp * (s->avctx->pix_fmt == PIX_FMT_PAL8)
?

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- 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/20111231/d482d45b/attachment.asc>


More information about the ffmpeg-devel mailing list