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

Satoshi Nakagawa nakagawa424 at oki.com
Fri Nov 14 01:54:36 CET 2014



> -----Original Message-----
> From: x265-devel [mailto:x265-devel-bounces at videolan.org] On Behalf Of
> Steve Borho
> Sent: Friday, November 14, 2014 2:39 AM
> To: Development for x265
> Subject: Re: [x265] analysis: don't add the cost of picture boundary CU
> to avgCost [CHANGES OUTPUT]
> 
> 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.


In non-partial case, it seems better to take into account the split cost
(sum of 4 sub-CU if better than 1 CU).
Also, inter check may be not needed, (intra is better than inter).

So, it would be better simply

if (mightNotSplit)
{
  ....
}






> 
> >      {
> >          /* 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
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel



More information about the x265-devel mailing list