Merge release 2.4.3

This commit is contained in:
Andrey Kamaev
2012-11-02 17:45:58 +04:00
126 changed files with 61518 additions and 51142 deletions

View File

@@ -59,16 +59,7 @@
# endif
#endif
#if defined WIN32 || defined WINCE
# ifndef _WIN32_WINNT // This is needed for the declaration of TryEnterCriticalSection in winbase.h with Visual Studio 2005 (and older?)
# define _WIN32_WINNT 0x0400 // http://msdn.microsoft.com/en-us/library/ms686857(VS.85).aspx
# endif
# include <windows.h>
# undef small
# undef min
# undef max
# undef abs
#else
#if !defined WIN32 && !defined WINCE
# include <pthread.h>
#endif

View File

@@ -56,7 +56,13 @@
#define CV_XADD(addr,delta) _InterlockedExchangeAdd(const_cast<void*>(reinterpret_cast<volatile void*>(addr)), delta)
#elif defined __GNUC__
#if __GNUC__*10 + __GNUC_MINOR__ >= 42
#if defined __clang__ && __clang_major__ >= 3
#ifdef __ATOMIC_SEQ_CST
#define CV_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), (delta), __ATOMIC_SEQ_CST)
#else
#define CV_XADD(addr, delta) __atomic_fetch_add((_Atomic(int)*)(addr), (delta), 5)
#endif
#elif __GNUC__*10 + __GNUC_MINOR__ >= 42
#if !defined WIN32 && (defined __i486__ || defined __i586__ || \
defined __i686__ || defined __MMX__ || defined __SSE__ || defined __ppc__)
@@ -2460,18 +2466,10 @@ dot(const Vector<_Tp>& v1, const Vector<_Tp>& v2)
assert(v1.size() == v2.size());
_Tw s = 0;
if( n > 0 )
{
const _Tp *ptr1 = &v1[0], *ptr2 = &v2[0];
#if CV_ENABLE_UNROLLED
const size_t n2 = (n > 4) ? n : 4;
for(; i <= n2 - 4; i += 4 )
s += (_Tw)ptr1[i]*ptr2[i] + (_Tw)ptr1[i+1]*ptr2[i+1] +
(_Tw)ptr1[i+2]*ptr2[i+2] + (_Tw)ptr1[i+3]*ptr2[i+3];
#endif
for( ; i < n; i++ )
s += (_Tw)ptr1[i]*ptr2[i];
}
const _Tp *ptr1 = &v1[0], *ptr2 = &v2[0];
for( ; i < n; i++ )
s += (_Tw)ptr1[i]*ptr2[i];
return s;
}