[x265] [PATCH 3 of 4 x265] analysis-save/load: Validate cu-tree info only at reuse-level 10

Aruna Matheswaran aruna at multicorewareinc.com
Tue Apr 14 17:31:59 CEST 2020


On Tue, Apr 14, 2020 at 7:38 PM Kavitha Sampath <
kavitha at multicorewareinc.com> wrote:

>
>
> On Tue, Mar 31, 2020 at 11:25 AM Aruna Matheswaran <
> aruna at multicorewareinc.com> wrote:
>
>> # HG changeset patch
>> # User Aruna Matheswaran <aruna at multicorewareinc.com>
>> # Date 1582707110 -19800
>> #      Wed Feb 26 14:21:50 2020 +0530
>> # Node ID 7ae7c9767f14b7d093c2023235066b370aecc4ce
>> # Parent  74170d9678e1a7f5f57b20c8404f8601814254d8
>> analysis-save/load: Validate cu-tree info only at reuse-level 10
>>
>> diff -r 74170d9678e1 -r 7ae7c9767f14 source/encoder/encoder.cpp
>> --- a/source/encoder/encoder.cpp        Wed Feb 19 15:13:05 2020 +0530
>> +++ b/source/encoder/encoder.cpp        Wed Feb 26 14:21:50 2020 +0530
>> @@ -3694,20 +3694,6 @@
>>      if (p->analysisLoad && !p->analysisLoadReuseLevel)
>>          p->analysisLoadReuseLevel = 5;
>>
>> -    if ((p->bAnalysisType == DEFAULT) && p->rc.cuTree)
>> -    {
>> -        if (p->analysisSaveReuseLevel && p->analysisSaveReuseLevel < 10)
>> -        {
>> -            x265_log(p, X265_LOG_WARNING, "cu-tree works only with
>> analysis-save-reuse-level 10, Disabling cu-tree\n");
>> -            p->rc.cuTree = 0;
>> -        }
>> -        if (p->analysisLoadReuseLevel && p->analysisLoadReuseLevel < 10)
>> -        {
>> -            x265_log(p, X265_LOG_WARNING, "cu-tree works only with
>> analysis-load-reuse-level 10, Disabling cu-tree\n");
>> -            p->rc.cuTree = 0;
>> -        }
>> -    }
>> -
>>
> [KS] If reuse level is <10 we no longer throw warning/disable cutree. We
> neither reuse cutree offsets. I don't think that is expected.
>
[AM] Will enable the flow to reuse cu-tree offsets at reuse-levels > 1

> [KS] As you are enabling cutree for other reuse levels, ensure to add this
> test case to our regression
>
[AM] ok.

>
>      if ((p->analysisLoad || p->analysisSave) &&
>> (p->bDistributeModeAnalysis || p->bDistributeMotionEstimation))
>>      {
>>          x265_log(p, X265_LOG_WARNING, "Analysis load/save options
>> incompatible with pmode/pme, Disabling pmode/pme\n");
>> @@ -5039,13 +5025,13 @@
>>      X265_PARAM_VALIDATE(saveParam->lookaheadDepth, sizeof(int), 1,
>> &m_param->lookaheadDepth, rc - lookahead);
>>      X265_PARAM_VALIDATE(saveParam->chunkStart, sizeof(int), 1,
>> &m_param->chunkStart, chunk-start);
>>      X265_PARAM_VALIDATE(saveParam->chunkEnd, sizeof(int), 1,
>> &m_param->chunkEnd, chunk-end);
>> -
>> X265_PARAM_VALIDATE(saveParam->cuTree,sizeof(int),1,&m_param->rc.cuTree,
>> cutree - offset);
>>      X265_PARAM_VALIDATE(saveParam->ctuDistortionRefine, sizeof(int), 1,
>> &m_param->ctuDistortionRefine, ctu - distortion);
>>
>>      int sourceHeight, sourceWidth;
>>      if (writeFlag)
>>      {
>>          X265_PARAM_VALIDATE(saveParam->analysisReuseLevel, sizeof(int),
>> 1, &m_param->analysisSaveReuseLevel, analysis - save - reuse - level);
>> +        X265_PARAM_VALIDATE(saveParam->cuTree, sizeof(int), 1,
>> &m_param->rc.cuTree, cutree-offset);
>>          sourceHeight = m_param->sourceHeight -
>> m_conformanceWindow.bottomOffset;
>>          sourceWidth = m_param->sourceWidth -
>> m_conformanceWindow.rightOffset;
>>          X265_PARAM_VALIDATE(saveParam->sourceWidth, sizeof(int), 1,
>> &sourceWidth, res-width);
>> @@ -5080,6 +5066,15 @@
>>              return -1;
>>          }
>>
>> +        int bcutree;
>> +        X265_FREAD(&bcutree, sizeof(int), 1, m_analysisFileIn,
>> &(saveParam->cuTree));
>> +        if (loadLevel == 10 && m_param->rc.cuTree && (!bcutree ||
>> saveLevel < 2))
>> +        {
>> +            x265_log(NULL, X265_LOG_ERROR, "Error reading cu-tree info.
>> Disabling cutree offsets. \n");
>> +            m_param->rc.cuTree = 0;
>> +            return -1;
>> +        }
>> +
>>
> [KS] Isn't this applicable to all reuse levels? As I see that we write and
> read cutree offsets for all levels
>
[AM] Right now cu-tree reuse is allowed only at reuse-level 10, but sharing
is enabled at reuse-levels > 1.
I'll update this check while enabling the cu-tree reuse at reuse-levels >
1.

>
>
>>          bool error = false;
>>          int curSourceHeight = m_param->sourceHeight -
>> m_conformanceWindow.bottomOffset;
>>          int curSourceWidth = m_param->sourceWidth -
>> m_conformanceWindow.rightOffset;
>>
>  [KS] Have you tested this patch disabling lookahead?
>
[AM] No, I didn't check as it is a param only option.
Disabling lookahead in load will restrict reuse-level 1 from enabling
cu-tree. Should we extent cu-tree sharing to reuse-level 1 given that
cu-tree is part of lookahead info?

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


-- 
Regards,
*Aruna Matheswaran,*
Video Codec Engineer,
Media & AI analytics BU,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20200414/8dfdd083/attachment-0001.html>


More information about the x265-devel mailing list