diff --git a/source/Lib/EncoderLib/InterSearch.cpp b/source/Lib/EncoderLib/InterSearch.cpp index 0ff695df8dbe62f1daacb830b7f2abc71955df0c..e909fc9edf58ebf46045de58685918108aa2bcf7 100644 --- a/source/Lib/EncoderLib/InterSearch.cpp +++ b/source/Lib/EncoderLib/InterSearch.cpp @@ -1198,6 +1198,16 @@ void InterSearch::xCPREstimation(PredictionUnit& pu, PelUnitBuf& origBuf, ruiCost = p->second; buffered = true; } + else if (p->second == ruiCost) + { + // stabilise the search through the unordered list + if (bv.hor < rcMv.getHor() + || (bv.hor == rcMv.getHor() && bv.ver < rcMv.getVer())) + { + // update the vector. + rcMv = bv; + } + } } } }