[x265] [PATCH] fix ambiguous call to overloaded function 'sqrt' (in old MSVC)

Ma0 mateuszb at poczta.onet.pl
Thu Nov 30 18:19:09 CET 2017


# HG changeset patch
# User Ma0 <mateuszb at poczta.onet.pl>
# Date 1512062200 -3600
#      Thu Nov 30 18:16:40 2017 +0100
# Node ID 5e5fbf5ce96f0361f51f122ab43f3c6369a79ad2
# Parent  b1dfa312234ed72c3541831a15f307feaf79484d
fix ambiguous call to overloaded function 'sqrt' (in old MSVC)

diff -r b1dfa312234e -r 5e5fbf5ce96f source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Thu Nov 30 10:06:49 2017 +0530
+++ b/source/encoder/encoder.cpp	Thu Nov 30 18:16:40 2017 +0100
@@ -575,7 +575,7 @@
                             {
                                 int mv_x = ((analysis_inter_data *)curFrame->m_analysisData.interData)->mv[k][(mbIndex * 16) + cuOffset].x;
                                 int mv_y = ((analysis_inter_data *)curFrame->m_analysisData.interData)->mv[k][(mbIndex * 16) + cuOffset].y;
-                                double mv = sqrt(mv_x*mv_x + mv_y*mv_y);
+                                double mv = sqrt((double)(mv_x*mv_x + mv_y*mv_y));
                                 if (numPU == PU_2Nx2N && ((srcInterData)->depth[cuPos + cuOffset] == (m_param->maxCUSize >> 5)) && mv <= MVTHRESHOLD)
                                     memset(&curFrame->m_analysisData.modeFlag[k][cuPos + cuOffset], 1, bytes);
                             }
@@ -658,7 +658,7 @@
                                     {
                                         int mv_x = ((analysis_inter_data *)curFrame->m_analysisData.interData)->mv[i][count + pu].x;
                                         int mv_y = ((analysis_inter_data *)curFrame->m_analysisData.interData)->mv[i][count + pu].y;
-                                        double mv = sqrt(mv_x*mv_x + mv_y*mv_y);
+                                        double mv = sqrt((double)(mv_x*mv_x + mv_y*mv_y));
                                         if (numPU == PU_2Nx2N && m_param->num4x4Partitions <= 16 && mv <= MVTHRESHOLD)
                                             memset(&curFrame->m_analysisData.modeFlag[i][count + pu], 1, bytes);
                                     }


More information about the x265-devel mailing list