[FFmpeg-devel] [PATCH] Factorize dither string logging in sws_getContext()

Michael Niedermayer michaelni
Sat Jan 16 19:43:44 CET 2010


On Sat, Jan 16, 2010 at 05:16:36PM +0100, Stefano Sabatini wrote:
> On date Saturday 2010-01-16 17:03:59 +0100, Reimar D?ffinger encoded:
> > On Sat, Jan 16, 2010 at 04:45:50PM +0100, Stefano Sabatini wrote:
> > > Hi, another very minor minor factorization.
> > > -- 
> > > FFmpeg = Freak and Faithful Magic Portable Elaborated Gadget
> > 
> > > Index: ffmpeg/libswscale/swscale.c
> > > ===================================================================
> > > --- ffmpeg.orig/libswscale/swscale.c	2010-01-16 16:39:19.000000000 +0100
> > > +++ ffmpeg/libswscale/swscale.c	2010-01-16 16:43:08.000000000 +0100
> > > @@ -2827,11 +2827,6 @@
> > >      assert(c->chrDstH <= dstH);
> > >  
> > >      if (flags&SWS_PRINT_INFO) {
> > > -#ifdef DITHER1XBPP
> > > -        const char *dither= " dithered";
> > > -#else
> > > -        const char *dither= "";
> > > -#endif
> > >          for (i = 0; i < FF_ARRAY_ELEMS(scaler_algos); i++)
> > >              if (flags & scaler_algos[i].flag) {
> > >                  av_log(c, AV_LOG_INFO, "%s scaler, ", scaler_algos[i].description);
> > > @@ -2842,7 +2837,13 @@
> > >  
> > >          av_log(c, AV_LOG_INFO, "from %s to%s %s ",
> > >                 sws_format_name(srcFormat),
> > > -               dstFormat == PIX_FMT_BGR555 || dstFormat == PIX_FMT_BGR565 ? dither : "",
> > > +               dstFormat == PIX_FMT_BGR555 || dstFormat == PIX_FMT_BGR565 ?
> > > +#ifdef DITHER1XBPP
> > > +               " dithered"
> > > +#else
> > > +               ""
> > > +#endif
> > > +               : "",
> > 
> > What? A bit much obfuscated.
> > 
> > #ifdef DITHER1XBPP
> > dstFormat == PIX_FMT_BGR555 || dstFormat == PIX_FMT_BGR565 ? " dithered" : "",
> > #else
> > "",
> > #endif
> 
> Yes that's better.
>  
> > Or make DITHER1XBPP 0/1 and do
> > DITHER1XBPP && (dstFormat == PIX_FMT_BGR555 || dstFormat == PIX_FMT_BGR565) ? " dithered" : "",
> 
> Regards.
> -- 
> FFmpeg = Forgiving & Friendly Muttering Patchable Encoding/decoding Gorilla

>  swscale.c |   11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 6d232b559a36505bf2159ca6e35c2c7737ce63b5  lsws-factorize-dither-str.patch

ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No great genius has ever existed without some touch of madness. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100116/08d05585/attachment.pgp>



More information about the ffmpeg-devel mailing list