[x265] [PATCH] WeightPrediction: Do not use lowres MV/MVcost for invalid MVs/MVcosts

Steve Borho steve at borho.org
Wed Jan 22 19:42:23 CET 2014


On Jan 22, 2014, at 3:04 AM, kavitha at multicorewareinc.com wrote:

> # HG changeset patch
> # User Kavitha Sampath <kavitha at multicorewareinc.com>
> # Date 1390381383 -19800
> #      Wed Jan 22 14:33:03 2014 +0530
> # Node ID 54a500764f64cad82e43c79b9313276344be8300
> # Parent  0f0ad4c094bd840b5a3183425670bee51434cdf7
> WeightPrediction: Do not use lowres MV/MVcost for invalid MVs/MVcosts
> 
> diff -r 0f0ad4c094bd -r 54a500764f64 source/encoder/weightPrediction.cpp
> --- a/source/encoder/weightPrediction.cpp	Tue Jan 21 16:39:44 2014 -0600
> +++ b/source/encoder/weightPrediction.cpp	Wed Jan 22 14:33:03 2014 +0530
> @@ -196,7 +196,13 @@
>             refPoc = m_slice->getRefPic(list, refIdxTemp)->getPOC();
>             difPoc = abs(curPoc - refPoc);
>             m_mvs = fenc->lowresMvs[list][difPoc - 1];
> -            if (m_mvs) m_mvCost = fenc->lowresMvCosts[0][difPoc - 1];

this fixes the bug of trying to use MVs never calculated by the lookahead, but this check for NULL is still wrong.

Instead, it should check whether difPoc is less than or equal to param.bframes.  If not, it should not try to index into any lowres structures at all.  Please fix this instance and then remove all the NULL checks

> +            if (m_mvs)
> +            {
> +                if (m_mvs[0].x == 0x7FFF)
> +                    continue;
> +                else
> +                    m_mvCost = fenc->lowresMvCosts[0][difPoc - 1];
> +            }
>             const float epsilon = 1.f / 128.f;
>             float guessScale[3], fencMean[3], refMean[3];
> 
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel



More information about the x265-devel mailing list