[FFmpeg-devel] [PATCH] sws: add dither enum

Michael Niedermayer michaelni at gmx.at
Thu Aug 15 03:27:09 CEST 2013


On Thu, Aug 15, 2013 at 01:53:55AM +0200, Clément Bœsch wrote:
> On Wed, Aug 14, 2013 at 05:33:53PM +0200, Michael Niedermayer wrote:
> > This allows specifying more dither algorithms without using up flags and
> > without ambiguities.
> > 
> > Also initialize the new field based on the flags and use it
> > 
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  libswscale/options.c          |    6 ++++++
> >  libswscale/output.c           |    6 +++---
> >  libswscale/swscale.c          |    2 +-
> >  libswscale/swscale_internal.h |    9 +++++++++
> >  libswscale/swscale_unscaled.c |    2 +-
> >  libswscale/utils.c            |   12 ++++++++----
> >  libswscale/version.h          |    2 +-
> >  7 files changed, 29 insertions(+), 10 deletions(-)
> > 
> > diff --git a/libswscale/options.c b/libswscale/options.c
> > index 81d8c28..f7edd21 100644
> > --- a/libswscale/options.c
> > +++ b/libswscale/options.c
> > @@ -69,6 +69,12 @@ static const AVOption swscale_options[] = {
> >      { "dst_v_chr_pos",   "destination vertical chroma position in luma grid/256"  , OFFSET(dst_v_chr_pos), AV_OPT_TYPE_INT, { .i64 = -1            }, -1,      512,             VE },
> >      { "dst_h_chr_pos",   "destination horizontal chroma position in luma grid/256", OFFSET(dst_h_chr_pos), AV_OPT_TYPE_INT, { .i64 = -1            }, -1,      512,             VE },
> >  
> > +    { "sws_dither",      "Dither algorithm",              OFFSET(dither),    AV_OPT_TYPE_INT,    { .i64  = SWS_DITHER_AUTO   }, 0,       1,              VE, "sws_dither" },
> 
> "set dithering algorithm"?
> 
> Also, the 0 → 1 range looks strange; 0, NB_SWS_DITHER looks more
> appropriate.
> 
> > +    { "auto",            "leave choice to sws",           0,                 AV_OPT_TYPE_CONST,  { .i64  = SWS_DITHER_AUTO   }, INT_MIN, INT_MAX,        VE, "sws_dither" },
> 
> > +    { "off",             "no dither",                     0,                 AV_OPT_TYPE_CONST,  { .i64  = SWS_DITHER_NONE   }, INT_MIN, INT_MAX,        VE, "sws_dither" },
> 
> IIRC there is a builtin in the parse op to automatically recognize "none"
> or similar.
> 
> Assuming that's not the case, I think it would be wise to use "none" here,
> for consistency (and potential factoring later).

all fixed

[...]

-- 
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/20130815/f26915f3/attachment.asc>


More information about the ffmpeg-devel mailing list