[x265] [PATCH] motion: lowres mvc[] are measured in slicetype no need to measure again in ME

Steve Borho steve at borho.org
Wed Apr 22 17:16:57 CEST 2015


On 04/22, gopu at multicorewareinc.com wrote:
> # HG changeset patch
> # User Gopu Govindaswamy <gopu at multicorewareinc.com>
> # Date 1429683763 -19800
> #      Wed Apr 22 11:52:43 2015 +0530
> # Node ID 6d34a490302ee75f2ddc6ef7d841fb900dce1bb7
> # Parent  c135c117ffb083a00d4353279ea669e8f3f7a8ee
> motion: lowres mvc[] are measured in slicetype no need to measure again in ME

I can't follow from the commit message to what the patch is doing. it is
just removing the if (ref->isLowres) check.

> diff -r c135c117ffb0 -r 6d34a490302e source/encoder/motion.cpp
> --- a/source/encoder/motion.cpp	Tue Apr 21 13:42:36 2015 -0500
> +++ b/source/encoder/motion.cpp	Wed Apr 22 11:52:43 2015 +0530
> @@ -621,36 +621,16 @@
>          }
>      }
>  
> -    // measure SAD cost at each QPEL motion vector candidate
> -    if (ref->isLowres)
> +    for (int i = 0; i < numCandidates; i++)
>      {
> -        for (int i = 0; i < numCandidates; i++)
> +        MV m = mvc[i].clipped(qmvmin, qmvmax);
> +        if (m.notZero() && m != pmv && m != bestpre) // check already measured
>          {
> -            MV m = mvc[i].clipped(qmvmin, qmvmax);
> -            if (m.notZero() && m != pmv && m != bestpre) // check already measured
> +            int cost = subpelCompare(ref, m, sad) + mvcost(m);
> +            if (cost < bprecost)
>              {
> -                int cost = ref->lowresQPelCost(fenc, blockOffset, m, sad) + mvcost(m);
> -                if (cost < bprecost)
> -                {
> -                    bprecost = cost;
> -                    bestpre = m;
> -                }
> -            }
> -        }
> -    }

if you're going to remove the special case code for lowres here, you
should add an X265_CHECK() in case somoene in the future passes lowres
MVC into this function.

> -    else
> -    {
> -        for (int i = 0; i < numCandidates; i++)
> -        {
> -            MV m = mvc[i].clipped(qmvmin, qmvmax);
> -            if (m.notZero() && m != pmv && m != bestpre) // check already measured
> -            {
> -                int cost = subpelCompare(ref, m, sad) + mvcost(m);
> -                if (cost < bprecost)
> -                {
> -                    bprecost = cost;
> -                    bestpre = m;
> -                }
> +                bprecost = cost;
> +                bestpre = m;
>              }
>          }
>      }
> _______________________________________________
> 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