[x265] [PATCH] motion: remove mvc's sad cost calc for lowres, already measured in slicetype

Steve Borho steve at borho.org
Fri Jun 26 21:06:17 CEST 2015


On 06/26, gopu at multicorewareinc.com wrote:
> # HG changeset patch
> # User Gopu Govindaswamy <gopu at multicorewareinc.com>
> # Date 1435293989 -19800
> #      Fri Jun 26 10:16:29 2015 +0530
> # Node ID 09193c05af52b2024635037dbf9fa19d4b978e4b
> # Parent  1e5c4d155ab85e8e8dd199bb3515801766ea9e88
> motion: remove mvc's sad cost calc for lowres, already measured in slicetype

LGTM

> diff -r 1e5c4d155ab8 -r 09193c05af52 source/encoder/motion.cpp
> --- a/source/encoder/motion.cpp	Thu Jun 25 13:42:29 2015 +0530
> +++ b/source/encoder/motion.cpp	Fri Jun 26 10:16:29 2015 +0530
> @@ -639,36 +639,18 @@
>          }
>      }
>  
> +    X265_CHECK(!(ref->isLowres && numCandidates), "lowres motion candidates\n")
>      // 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;
> -                }
> -            }
> -        }
> -    }
> -    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