[x265] [PATCH] fix build error on VS2008 ( ambiguous on pow() )

chen chenm003 at 163.com
Wed Jun 28 18:55:27 CEST 2017


From 360c25c6198e7aaa3a9f0ad611d99f94a1ea6347 Mon Sep 17 00:00:00 2001
From: Min Chen <chenm003 at 163.com>
Date: Wed, 28 Jun 2017 11:54:05 -0500
Subject: [PATCH] fix build error on VS2008 ( ambiguous on pow() )


---
 source/encoder/slicetype.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/source/encoder/slicetype.cpp b/source/encoder/slicetype.cpp
index b013335..d7638a4 100644
--- a/source/encoder/slicetype.cpp
+++ b/source/encoder/slicetype.cpp
@@ -1819,7 +1819,8 @@ void Lookahead::calcMotionAdaptiveQuantFrame(Lowres **frames, int p0, int p1, in
                     MV *mvs = frames[b]->lowresMvs[list][listDist[list]];
                     int32_t x = mvs[cuIndex].x;
                     int32_t y = mvs[cuIndex].y;
-                    displacement += sqrt(pow(abs(x), 2) + pow(abs(y), 2));
+                    // NOTE: the dynamic range of abs(x) and abs(y) is 15-bits
+                    displacement += sqrt((double)(abs(x) * abs(x)) + (double)(abs(y) * abs(y)));
                 }
                 else
                     displacement += 0.0;
-- 
1.7.9.msysgit.0

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20170629/b6060fca/attachment.html>


More information about the x265-devel mailing list