<div dir="ltr">LGTM. Pushed.<br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 7, 2017 at 1:52 PM, Ma0 <span dir="ltr"><<a href="mailto:mateuszb@poczta.onet.pl" target="_blank">mateuszb@poczta.onet.pl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Ma0 <<a href="mailto:mateuszb@poczta.onet.pl">mateuszb@poczta.onet.pl</a>><br>
# Date 1512634751 -3600<br>
# Thu Dec 07 09:19:11 2017 +0100<br>
# Node ID c9ee52a7b14458abd01ae7540d8d8b<wbr>a34d0393ef<br>
# Parent 7bd8751a81830815cdc8e4dfc88cad<wbr>2c8ca15ca7<br>
remove unnecessary sqrt from MVTHRESHOLD checking<br>
<br>
Thanks MonoS Diablo for pointing this.<br>
<br>
diff -r 7bd8751a8183 -r c9ee52a7b144 source/encoder/encoder.cpp<br>
--- a/source/encoder/encoder.cpp Wed Dec 06 13:33:00 2017 +0530<br>
+++ b/source/encoder/encoder.cpp Thu Dec 07 09:19:11 2017 +0100<br>
@@ -51,7 +51,7 @@<br>
/* Threshold for motion vection, based on expermental result.<br>
* TODO: come up an algorithm for adoptive threshold */<br>
<br>
-#define MVTHRESHOLD 10<br>
+#define MVTHRESHOLD (10*10)<br>
#define PU_2Nx2N 1<br>
<br>
static const char* defaultAnalysisFileName = "x265_analysis.dat";<br>
@@ -571,12 +571,12 @@<br>
(interData)->mvpIdx[k][cuPos + cuOffset] = (srcInterData)->mvpIdx[k][(<wbr>mbIndex * 16) + cuOffset];<br>
(interData)->refIdx[k][cuPos + cuOffset] = (srcInterData)->refIdx[k][(<wbr>mbIndex * 16) + cuOffset];<br>
memcpy(&(interData)->mv[k][<wbr>cuPos + cuOffset], &(srcInterData)->mv[k][(<wbr>mbIndex * 16) + cuOffset], sizeof(MV));<br>
- if (m_param->analysisReuseLevel == 7)<br>
+ if (m_param->analysisReuseLevel == 7 && numPU == PU_2Nx2N &&<br>
+ ((srcInterData)->depth[cuPos + cuOffset] == (m_param->maxCUSize >> 5)))<br>
{<br>
int mv_x = ((analysis_inter_data *)curFrame->m_analysisData.<wbr>interData)->mv[k][(mbIndex * 16) + cuOffset].x;<br>
int mv_y = ((analysis_inter_data *)curFrame->m_analysisData.<wbr>interData)->mv[k][(mbIndex * 16) + cuOffset].y;<br>
- double mv = sqrt((double)(mv_x*mv_x + mv_y*mv_y));<br>
- if (numPU == PU_2Nx2N && ((srcInterData)->depth[cuPos + cuOffset] == (m_param->maxCUSize >> 5)) && mv <= MVTHRESHOLD)<br>
+ if ((mv_x*mv_x + mv_y*mv_y) <= MVTHRESHOLD)<br>
memset(&curFrame->m_<wbr>analysisData.modeFlag[k][cuPos + cuOffset], 1, bytes);<br>
}<br>
}<br>
@@ -654,12 +654,11 @@<br>
(currInterData)->mvpIdx[i][<wbr>count + pu] = (interData)->mvpIdx[i][d];<br>
(currInterData)->refIdx[i][<wbr>count + pu] = (interData)->refIdx[i][d];<br>
memcpy(&(currInterData)->mv[i]<wbr>[count + pu], &(interData)->mv[i][d], sizeof(MV));<br>
- if (m_param->analysisReuseLevel == 7)<br>
+ if (m_param->analysisReuseLevel == 7 && numPU == PU_2Nx2N && m_param->num4x4Partitions <= 16)<br>
{<br>
int mv_x = ((analysis_inter_data *)curFrame->m_analysisData.<wbr>interData)->mv[i][count + pu].x;<br>
int mv_y = ((analysis_inter_data *)curFrame->m_analysisData.<wbr>interData)->mv[i][count + pu].y;<br>
- double mv = sqrt((double)(mv_x*mv_x + mv_y*mv_y));<br>
- if (numPU == PU_2Nx2N && m_param->num4x4Partitions <= 16 && mv <= MVTHRESHOLD)<br>
+ if ((mv_x*mv_x + mv_y*mv_y) <= MVTHRESHOLD)<br>
memset(&curFrame->m_<wbr>analysisData.modeFlag[i][count + pu], 1, bytes);<br>
}<br>
}<br>
______________________________<wbr>_________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/<wbr>listinfo/x265-devel</a><br>
</blockquote></div><br></div></div>