From 360c25c6198e7aaa3a9f0ad611d99f94a1ea6347 Mon Sep 17 00:00:00 2001
From: Min Chen <[email protected]>
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

_______________________________________________
x265-devel mailing list
[email protected]
https://mailman.videolan.org/listinfo/x265-devel

Reply via email to