[x265] analysis: don't add the cost of picture boundary CU to avgCost [CHANGES OUTPUT]

Steve Borho steve at borho.org
Thu Nov 13 18:38:51 CET 2014


On 11/13, Satoshi Nakagawa wrote:
> # HG changeset patch
> # User Satoshi Nakagawa <nakagawa424 at oki.com>
> # Date 1415871635 -32400
> #      Thu Nov 13 18:40:35 2014 +0900
> # Node ID cc70f51c5b6dd6009c5f2b9876c9fc8108c75c62
> # Parent  18aefbde72ab2dfaa0d4edeea7fd0ab4f9a09f9c
> analysis: don't add the cost of picture boundary CU to avgCost [CHANGES OUTPUT]

it took me a while to understand what you are doing here.

> diff -r 18aefbde72ab -r cc70f51c5b6d source/encoder/analysis.cpp
> --- a/source/encoder/analysis.cpp	Wed Nov 12 17:17:56 2014 -0600
> +++ b/source/encoder/analysis.cpp	Thu Nov 13 18:40:35 2014 +0900
> @@ -762,7 +762,7 @@
>          checkBestMode(*splitPred, depth);
>      }
>  
> -    if (!depth || md.bestMode->cu.isInter(0))
> +    if (mightNotSplit && (!depth || md.bestMode->cu.isInter(0)))

if mightNotSplit is false, then a split was forced by a picture edge
(the current depth CU is too large) and so this CU is never coded.

ok, it makes sense to not count the cost of this partially coded splitCU
against the average cost at this depth

Although looking at this code again it's not clear why depth 0 has a
special exemption. I wonder if it would be better as:

if (md.bestMode != &md.pred[PRED_SPLIT] && md.bestMode->cu.isInter(0))
{
  ..
}

So it only counts costs at the level they were CU coded, and this would
implicitly handle the forced splits at picture edges.

>      {
>          /* early-out statistics */
>          FrameData& curEncData = const_cast<FrameData&>(*m_frame->m_encData);
> @@ -1044,7 +1044,7 @@
>              md.bestMode = splitPred;
>      }
>  
> -    if (!depth || md.bestMode->cu.isInter(0))
> +    if (mightNotSplit && (!depth || md.bestMode->cu.isInter(0)))
>      {
>          /* early-out statistics */
>          FrameData& curEncData = const_cast<FrameData&>(*m_frame->m_encData);
> _______________________________________________
> 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