[x265] [PATCH 2 of 2] fix output non-determination bug

Min Chen chenm003 at 163.com
Wed Jul 30 03:56:59 CEST 2014


# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1406685408 25200
# Node ID 12447b84490ca4f5c3dd106599d535edd09a963c
# Parent  9fbda07104f6e7c03c608320a6b88ed877074e25
fix output non-determination bug

diff -r 9fbda07104f6 -r 12447b84490c source/Lib/TLibEncoder/TEncSearch.cpp
--- a/source/Lib/TLibEncoder/TEncSearch.cpp	Tue Jul 29 18:55:33 2014 -0700
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp	Tue Jul 29 18:56:48 2014 -0700
@@ -1970,12 +1970,17 @@
                 // Pick the best possible MVP from AMVP candidates based on least residual
                 uint32_t bestCost = MAX_INT;
                 int mvpIdx = 0;
+                int merange = m_param->searchRange;
 
                 for (int i = 0; i < amvpInfo[l][ref].m_num; i++)
                 {
                     MV mvCand = amvpInfo[l][ref].m_mvCand[i];
 
-                    // TODO: skip mvCand if Y is > merange and -FN>1
+                    // NOTE: skip mvCand if Y is > merange and -FN>1
+                    if (m_bFrameParallel && (mvCand.y >= (merange + 1) * 4))
+                    {
+                        continue;
+                    }
                     cu->clipMv(mvCand);
 
                     xPredInterLumaBlk(cu->m_slice->m_refPicList[l][ref]->getPicYuvRec(), cu->getAddr(), cu->getZorderIdxInCU(), &mvCand, &m_predTempYuv);
@@ -1991,7 +1996,6 @@
 
                 MV mvmin, mvmax, outmv, mvp = amvpInfo[l][ref].m_mvCand[mvpIdx];
 
-                int merange = m_param->searchRange;
                 xSetSearchRange(cu, mvp, merange, mvmin, mvmax);
                 int satdCost = m_me.motionEstimate(&m_mref[l][ref], mvmin, mvmax, mvp, numMvc, mvc, merange, outmv);
 



More information about the x265-devel mailing list