[x265] [PATCH] level: allow 8.5, param_parse detects obviously wrong levels for both float/int

Steve Borho steve at borho.org
Wed Nov 4 17:26:23 CET 2015


On 11/04, Deepthi Nandakumar wrote:
> On Wed, Nov 4, 2015 at 8:36 PM, Steve Borho <steve at borho.org> wrote:
> 
> > On 11/04, deepthi at multicorewareinc.com wrote:
> > > # HG changeset patch
> > > # User Deepthi Nandakumar <deepthi at multicorewareinc.com>
> > > # Date 1446636993 -19800
> > > #      Wed Nov 04 17:06:33 2015 +0530
> > > # Node ID c11dd97a8b999414c60dceef8620d3d9055cf4c1
> > > # Parent  bd8237a5d78240b5e908f24727b4400f72cbfb0c
> > > level: allow 8.5, param_parse detects obviously wrong levels for both
> > float/int
> >
> > this breaks --level 51
> >
> 
> why? something to do with atof (int) ?

if atoi('51') < 10 else bError = true

> > > diff -r bd8237a5d782 -r c11dd97a8b99 source/common/param.cpp
> > > --- a/source/common/param.cpp Wed Nov 04 14:03:10 2015 +0530
> > > +++ b/source/common/param.cpp Wed Nov 04 17:06:33 2015 +0530
> > > @@ -570,10 +570,14 @@
> > >      OPT2("level-idc", "level")
> > >      {
> > >          /* allow "5.1" or "51", both converted to integer 51 */
> > > -        if (atof(value) < 7)
> > > +        /* if level-idc specifies an obviously wrong value in either
> > float or int,
> > > +        throw error consistently. Stronger level checking will be done
> > in encoder_open()*/
> >
> > nit
> >
> > > +        if (atof(value) < 10)
> > >              p->levelIdc = (int)(10 * atof(value) + .5);
> > > -        else
> > > +        else if (atoi(value) < 10)
> > >              p->levelIdc = atoi(value);
> > > +        else
> > > +            bError = true;
> > >      }
> > >      OPT("high-tier") p->bHighTier = atobool(value);
> > >      OPT("allow-non-conformance") p->bAllowNonConformance =
> > atobool(value);
> > > _______________________________________________
> > > x265-devel mailing list
> > > x265-devel at videolan.org
> > > https://mailman.videolan.org/listinfo/x265-devel
> >
> > --
> > Steve Borho
> > _______________________________________________
> > x265-devel mailing list
> > x265-devel at videolan.org
> > https://mailman.videolan.org/listinfo/x265-devel
> >
> 
> 
> 
> -- 
> Deepthi Nandakumar
> Engineering Manager, x265
> Multicoreware, Inc

> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel


-- 
Steve Borho


More information about the x265-devel mailing list