From df945913367258a5054647d2c1ff9183e7c46a73 Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Thu, 11 Oct 2012 15:00:43 +0400 Subject: [PATCH] Fix instability of Luv/Lab color conversions --- modules/imgproc/src/color.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/imgproc/src/color.cpp b/modules/imgproc/src/color.cpp index 64aa9f0e08..5686204deb 100644 --- a/modules/imgproc/src/color.cpp +++ b/modules/imgproc/src/color.cpp @@ -124,8 +124,8 @@ template static void splineBuild(const _Tp* f, int n, _Tp* tab) // interpolates value of a function at x, 0 <= x <= n using a cubic spline. template static inline _Tp splineInterpolate(_Tp x, const _Tp* tab, int n) { - int ix = cvFloor(x); - ix = std::min(std::max(ix, 0), n-1); + // don't touch this function without urgent need - some versions of gcc fail to inline it correctly + int ix = std::min(std::max(int(x), 0), n-1); x -= ix; tab += ix*4; return ((tab[3]*x + tab[2])*x + tab[1])*x + tab[0];