[x265] [PATCH] Updated x265_param_parse to use parseName & a few nit fixes

Steve Borho steve at borho.org
Tue Feb 25 16:50:19 CET 2014


On Tue, Feb 25, 2014 at 9:02 AM, dave <dtyx265 at gmail.com> wrote:
> On 02/24/2014 09:41 PM, Steve Borho wrote:
>>
>> On Mon, Feb 24, 2014 at 11:19 PM,  <dtyx265 at gmail.com> wrote:
>>>
>>> # HG changeset patch
>>> # User David T Yuen <dtyx265 at gmail.com>
>>> # Date 1393305431 28800
>>> # Node ID 40a442a5c7facb5b80e743661ed34f5286cbb475
>>> # Parent  18894c99e1a71dc79e0ae55d4d4b8ed5d0c59c69
>>> Updated x265_param_parse to use parseName & a few nit fixes
>>>
>>> diff -r 18894c99e1a7 -r 40a442a5c7fa source/common/param.cpp
>>> --- a/source/common/param.cpp   Mon Feb 24 19:19:27 2014 -0600
>>> +++ b/source/common/param.cpp   Mon Feb 24 21:17:11 2014 -0800
>>> @@ -155,7 +155,7 @@
>>>       param->defDispWinRightOffset = 0;
>>>       param->defDispWinTopOffset = 0;
>>>       param->defDispWinBottomOffset = 0;
>>> -    param->bEnableVuiTimingInfoPresentFlag = 0;
>>> +    param->bEnableVuiTimingInfoPresentFlag = 1;
>>
>> I just sent a patch that enables timing info in the VPS header, so I
>> think I'll drop this change for the moment.
>>
>>>       param->bEnableVuiHrdParametersPresentFlag = 0;
>>>       param->bEnableBitstreamRestrictionFlag = 0;
>>>       param->bEnableSubPicHrdParamsPresentFlag = 0;
>>> @@ -551,15 +551,13 @@
>>>       OPT("sar")
>>>       {
>>>           p->bEnableVuiParametersPresentFlag = 1;
>>> -        p->bEnableAspectRatioIdc = atobool(value);
>>> -        p->aspectRatioIdc = atoi(value);
>>> -    }
>>> -    OPT("extended-sar")
>>> -    {
>>> -        p->bEnableVuiParametersPresentFlag = 1;
>>>           p->bEnableAspectRatioIdc = 1;
>>> -        p->aspectRatioIdc = X265_EXTENDED_SAR;
>>> -        bError |= sscanf(value, "%dx%d", &p->sarWidth, &p->sarHeight) !=
>>> 2;
>>> +        p->aspectRatioIdc = parseName(value, x265_sar_names, bError);
>>> +        if (bError)
>>> +        {
>>> +            p->aspectRatioIdc = X265_EXTENDED_SAR;
>>> +            bError = sscanf(value, "%d:%d", &p->sarWidth, &p->sarHeight)
>>> != 2;
>>> +        }
>>
>> Nice.  This conflicts with my input-file refactor; but I can fixup my
>> patch

I actually left the parseName() call here in place because the CLI
allows "--sar N" and my set function does not support direct setting
of one of the pre-defined ratios.  This combination seemed to be the
most robust against users randomly setting the param structure
themselves.

--
Steve


More information about the x265-devel mailing list