[x265] [PATCH] frameencoder: increase refLagRows by one when subme has multiple hpel iteration steps

Steve Borho steve at borho.org
Wed Apr 1 16:04:38 CEST 2015


On 04/01, santhoshini at multicorewareinc.com wrote:
> # HG changeset patch
> # User Santhoshini Sekar<santhoshini at multicorewareinc.com>
> # Date 1427869853 -19800
> #      Wed Apr 01 12:00:53 2015 +0530
> # Node ID 721439fe1542acc7cbe846fbf353eaa818fd209d
> # Parent  ac85c775620f1dcb0df056874633cbf916098bd2
> frameencoder: increase refLagRows by one when subme has multiple hpel iteration steps

the commit message should describe what this is fixing.  In this case,
when --subme used 2 hpel steps there was a possibility for subpel refine
to walk past the end of valid pixels in the reference frame and end up
with decoder hash mistakes. This was caught by a new regression test.

queued for stable with some minor tweaks

> diff -r ac85c775620f -r 721439fe1542 source/encoder/frameencoder.cpp
> --- a/source/encoder/frameencoder.cpp	Tue Mar 31 20:04:28 2015 -0500
> +++ b/source/encoder/frameencoder.cpp	Wed Apr 01 12:00:53 2015 +0530
> @@ -112,9 +112,10 @@
>      bool ok = !!m_numRows;
>  
>      int range  = m_param->searchRange; /* fpel search */
> -        range += 1;                    /* diamond search range check lag */
> -        range += 2;                    /* subpel refine */
> -        range += NTAPS_LUMA / 2;       /* subpel filter half-length */
> +    range += 1;                    /* diamond search range check lag */
> +    range += 2;                    /* subpel refine */
> +    range += NTAPS_LUMA / 2;       /* subpel filter half-length */
> +    range += !!(MotionEstimate::hpelIterationCount(m_param->subpelRefine) > 1);
>      m_refLagRows = 1 + ((range + g_maxCUSize - 1) / g_maxCUSize);
>  
>      // NOTE: 2 times of numRows because both Encoder and Filter in same queue
> diff -r ac85c775620f -r 721439fe1542 source/encoder/motion.cpp
> --- a/source/encoder/motion.cpp	Tue Mar 31 20:04:28 2015 -0500
> +++ b/source/encoder/motion.cpp	Wed Apr 01 12:00:53 2015 +0530
> @@ -149,6 +149,11 @@
>  #undef SETUP_SCALE
>  }
>  
> +int MotionEstimate::hpelIterationCount(int subpelRefine)
> +{
> +    return workload[subpelRefine].hpel_iters;
> +}
> +
>  MotionEstimate::~MotionEstimate()
>  {
>      fencPUYuv.destroy();
> diff -r ac85c775620f -r 721439fe1542 source/encoder/motion.h
> --- a/source/encoder/motion.h	Tue Mar 31 20:04:28 2015 -0500
> +++ b/source/encoder/motion.h	Wed Apr 01 12:00:53 2015 +0530
> @@ -68,6 +68,7 @@
>      ~MotionEstimate();
>  
>      static void initScales();
> +    static int hpelIterationCount(int subpelRefine);
>      void init(int method, int refine, int csp);
>  
>      /* Methods called at slice setup */
> _______________________________________________
> 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