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

Kavitha Sampath kavitha at multicorewareinc.com
Tue Apr 14 16:07:10 CEST 2020


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.
[KS] As you are enabling cutree for other reuse levels, ensure to add this
test case to our regression

     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


>          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?


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


-- 
Regards,
Kavitha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20200414/2c58b35e/attachment.html>


More information about the x265-devel mailing list