[FFmpeg-devel] [PATCH] Is gray8 a paletted format?

Stefano Sabatini stefano.sabatini-lala
Mon Feb 1 21:41:21 CET 2010


On date Monday 2010-02-01 19:54:06 +0000, M?ns Rullg?rd encoded:
> Stefano Sabatini <stefano.sabatini-lala at poste.it> writes:
> 
> > On date Monday 2010-02-01 02:28:17 +0100, Michael Niedermayer encoded:
> >> On Sun, Jan 31, 2010 at 06:04:16PM +0100, Stefano Sabatini wrote:
> >> > On date Monday 2009-11-16 01:07:09 +0100, Michael Niedermayer encoded:
> >> > > On Sun, Nov 15, 2009 at 11:36:03PM +0100, Stefano Sabatini wrote:
> >> > > > Hi all,
> >> > > > 
> >> > > > I see that in imgconvert.c gray8 is treated like a paletted format:
> >> > > > check for example ff_set_systematic_pal() and ff_fill_pointer(), where
> >> > > > it is allocated space for its palette.
> >> > > > 
> >> > > > If gray8 can be considered a paletted format, then I suggest to apply
> >> > > > the attached patch, updating both the pixdesc array and the lsws
> >> > > > macro.
> >> > > > 
> >> > > > Regards.
> >> > > > -- 
> >> > > > FFmpeg = Fundamental and Fantastic Most Porno Erudite Gadget
> >> > > 
> >> > > >  libavutil/pixdesc.c  |    1 +
> >> > > >  libswscale/swscale.c |    1 +
> >> > > >  2 files changed, 2 insertions(+)
> >> > > > d4e555c7f6b51930b736b49221f546314265ec41  gray-is-pal.patch
> >> > > 
> >> > > This is ok in principle but it has some potential to uncover bugs
> >> > > id like you to make sure that this works before comiting.
> >> > > Also please make sure by benchmark that this causes no slowdown
> >> > 
> >> > Can you suggest what I should benchmark?
> >> 
> >> id put some START/STOP_TIMER in swscale-test and look at the gray8 cases
> >> and see if one changes by a large amount
> >
> > I used my lite version swscale-test and an ad-hoc script, the results
> > are in attachment.
> >
> > Conversion in some cases is ~10% slower.
> >
> > An alternative solution would be to make gray *non*-paletted, and
> > eventually add a gray8-pal variant.
> 
> Why *would* gray8 be a paletted?

------------------------------------------------------------------------
r17018 | michael | 2009-02-06 13:59:50 +0100 (Fri, 06 Feb 2009) | 3 lines

Ensure that the palette is set in data[1] for all 8bit formats.
Also document it.

------------------------------------------------------------------------

And no to be honest I cannot understand that patch.

Also why and how should PIX_FMT_RGB8, PIX_FMT_BGR8, PIX_FMT_RGB4_BYTE,
PIX_FMT_BGR4_BYTE be considered paletted formats?

Regards.
-- 
FFmpeg = Fantastic & Foolish Mystic Porno Ecumenical Geek



More information about the ffmpeg-devel mailing list