Merge pull request #2589 from alalek:icv_update

This commit is contained in:
Andrey Pavlenko 2014-04-09 18:23:34 +04:00 committed by OpenCV Buildbot
commit 7b366df822
16 changed files with 193 additions and 161 deletions

View File

@ -127,8 +127,7 @@ OCV_OPTION(WITH_FFMPEG "Include FFMPEG support" ON
OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) ) OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )
OCV_OPTION(WITH_GSTREAMER_0_10 "Enable Gstreamer 0.10 support (instead of 1.x)" OFF ) OCV_OPTION(WITH_GSTREAMER_0_10 "Enable Gstreamer 0.10 support (instead of 1.x)" OFF )
OCV_OPTION(WITH_GTK "Include GTK support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) ) OCV_OPTION(WITH_GTK "Include GTK support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )
OCV_OPTION(WITH_ICV "Include Intel IPP ICV support" ON IF (NOT IOS) ) OCV_OPTION(WITH_IPP "Include Intel IPP support" ON IF (NOT IOS) )
OCV_OPTION(WITH_IPP "Include Intel IPP support" OFF IF (NOT IOS) )
OCV_OPTION(WITH_JASPER "Include JPEG2K support" ON IF (NOT IOS) ) OCV_OPTION(WITH_JASPER "Include JPEG2K support" ON IF (NOT IOS) )
OCV_OPTION(WITH_JPEG "Include JPEG support" ON) OCV_OPTION(WITH_JPEG "Include JPEG support" ON)
OCV_OPTION(WITH_WEBP "Include WebP support" ON IF (NOT IOS) ) OCV_OPTION(WITH_WEBP "Include WebP support" ON IF (NOT IOS) )
@ -917,11 +916,11 @@ endif(DEFINED WITH_INTELPERC)
status("") status("")
status(" Other third-party libraries:") status(" Other third-party libraries:")
if((WITH_IPP OR WITH_ICV) AND HAVE_IPP) if(WITH_IPP AND HAVE_IPP)
status(" Use IPP:" "${IPP_VERSION_STR} [${IPP_VERSION_MAJOR}.${IPP_VERSION_MINOR}.${IPP_VERSION_BUILD}]") status(" Use IPP:" "${IPP_VERSION_STR} [${IPP_VERSION_MAJOR}.${IPP_VERSION_MINOR}.${IPP_VERSION_BUILD}]")
status(" at:" "${IPP_ROOT_DIR}") status(" at:" "${IPP_ROOT_DIR}")
else() else()
status(" Use IPP:" (WITH_IPP OR WITH_ICV) AND NOT HAVE_IPP THEN "IPP not found" ELSE NO) status(" Use IPP:" WITH_IPP AND NOT HAVE_IPP THEN "IPP not found" ELSE NO)
endif() endif()
if(DEFINED WITH_IPP_A) if(DEFINED WITH_IPP_A)

View File

@ -2,15 +2,12 @@
# The script to detect Intel(R) Integrated Performance Primitives (IPP) # The script to detect Intel(R) Integrated Performance Primitives (IPP)
# installation/package # installation/package
# #
# Windows host: # By default, ICV version will be used.
# Run script like this before cmake: # To use standalone IPP update cmake command line:
# call "<IPP_INSTALL_DIR>\bin\ippvars.bat" intel64 # cmake ... -DIPPROOT=<path> ...
# for example: #
# call "C:\Program Files (x86)\Intel\Composer XE\ipp\bin\ippvars.bat" intel64 # Note: Backward compatibility is broken, IPPROOT environment path is ignored
# #
# Linux host:
# Run script like this before cmake:
# source /opt/intel/ipp/bin/ippvars.sh [ia32|intel64]
# #
# On return this will define: # On return this will define:
# #
@ -39,14 +36,6 @@ unset(IPP_VERSION_BUILD)
set(IPP_LIB_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX}) set(IPP_LIB_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX})
set(IPP_LIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX}) set(IPP_LIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
set(IPP_PREFIX "ipp")
set(IPP_SUFFIX "_l")
set(IPPCORE "core") # core functionality
set(IPPS "s") # signal processing
set(IPPI "i") # image processing
set(IPPCC "cc") # color conversion
set(IPPCV "cv") # computer vision
set(IPPVM "vm") # vector math
set(IPP_X64 0) set(IPP_X64 0)
if(CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8) if(CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8)
@ -56,21 +45,21 @@ if(CMAKE_CL_64)
set(IPP_X64 1) set(IPP_X64 1)
endif() endif()
# This function detects IPP version by analyzing ippversion.h file # This function detects IPP version by analyzing .h file
macro(ipp_get_version _ROOT_DIR) macro(ipp_get_version VERSION_FILE)
unset(_VERSION_STR) unset(_VERSION_STR)
unset(_MAJOR) unset(_MAJOR)
unset(_MINOR) unset(_MINOR)
unset(_BUILD) unset(_BUILD)
# read IPP version info from file # read IPP version info from file
file(STRINGS ${_ROOT_DIR}/include/ippversion.h STR1 REGEX "IPP_VERSION_MAJOR") file(STRINGS ${VERSION_FILE} STR1 REGEX "IPP_VERSION_MAJOR")
file(STRINGS ${_ROOT_DIR}/include/ippversion.h STR2 REGEX "IPP_VERSION_MINOR") file(STRINGS ${VERSION_FILE} STR2 REGEX "IPP_VERSION_MINOR")
file(STRINGS ${_ROOT_DIR}/include/ippversion.h STR3 REGEX "IPP_VERSION_BUILD") file(STRINGS ${VERSION_FILE} STR3 REGEX "IPP_VERSION_BUILD")
if("${STR3}" STREQUAL "") if("${STR3}" STREQUAL "")
file(STRINGS ${_ROOT_DIR}/include/ippversion.h STR3 REGEX "IPP_VERSION_UPDATE") file(STRINGS ${VERSION_FILE} STR3 REGEX "IPP_VERSION_UPDATE")
endif() endif()
file(STRINGS ${_ROOT_DIR}/include/ippversion.h STR4 REGEX "IPP_VERSION_STR") file(STRINGS ${VERSION_FILE} STR4 REGEX "IPP_VERSION_STR")
# extract info and assign to variables # extract info and assign to variables
string(REGEX MATCHALL "[0-9]+" _MAJOR ${STR1}) string(REGEX MATCHALL "[0-9]+" _MAJOR ${STR1})
@ -83,65 +72,91 @@ macro(ipp_get_version _ROOT_DIR)
set(IPP_VERSION_MAJOR ${_MAJOR}) set(IPP_VERSION_MAJOR ${_MAJOR})
set(IPP_VERSION_MINOR ${_MINOR}) set(IPP_VERSION_MINOR ${_MINOR})
set(IPP_VERSION_BUILD ${_BUILD}) set(IPP_VERSION_BUILD ${_BUILD})
set(__msg)
if(EXISTS ${_ROOT_DIR}/include/ippicv.h)
ocv_assert(WITH_ICV AND NOT WITH_IPP)
set(__msg " ICV version")
set(HAVE_IPP_ICV_ONLY 1)
endif()
message(STATUS "found IPP: ${_MAJOR}.${_MINOR}.${_BUILD} [${_VERSION_STR}]${__msg}")
message(STATUS "at: ${_ROOT_DIR}")
endmacro() endmacro()
macro(_ipp_not_supported)
# This function sets IPP_INCLUDE_DIRS and IPP_LIBRARIES variables message(STATUS ${ARGN})
macro(ipp_set_variables _LATEST_VERSION)
if(${_LATEST_VERSION} VERSION_LESS "7.0")
message(SEND_ERROR "IPP ${_LATEST_VERSION} is not supported")
unset(HAVE_IPP) unset(HAVE_IPP)
unset(HAVE_IPP_ICV_ONLY)
unset(IPP_VERSION_STR)
return() return()
endmacro()
# This macro uses IPP_ROOT_DIR variable
# TODO Cleanup code after ICV package stabilization
macro(ipp_detect_version)
set(IPP_INCLUDE_DIRS ${IPP_ROOT_DIR}/include)
set(__msg)
if(EXISTS ${IPP_ROOT_DIR}/ippicv.h)
set(__msg " (ICV version)")
set(HAVE_IPP_ICV_ONLY 1)
if(EXISTS ${IPP_ROOT_DIR}/ippversion.h)
_ipp_not_supported("Can't resolve IPP directory: ${IPP_ROOT_DIR}")
else()
ipp_get_version(${IPP_ROOT_DIR}/ippicv.h)
endif()
ocv_assert(IPP_VERSION_STR VERSION_GREATER "8.0")
set(IPP_INCLUDE_DIRS ${IPP_ROOT_DIR}/)
elseif(EXISTS ${IPP_ROOT_DIR}/include/ipp.h)
ipp_get_version(${IPP_ROOT_DIR}/include/ippversion.h)
ocv_assert(IPP_VERSION_STR VERSION_GREATER "1.0")
else()
_ipp_not_supported("Can't resolve IPP directory: ${IPP_ROOT_DIR}")
endif() endif()
# set INCLUDE and LIB folders message(STATUS "found IPP${__msg}: ${_MAJOR}.${_MINOR}.${_BUILD} [${IPP_VERSION_STR}]")
set(IPP_INCLUDE_DIRS ${IPP_ROOT_DIR}/include) message(STATUS "at: ${IPP_ROOT_DIR}")
if(${IPP_VERSION_STR} VERSION_LESS "7.0")
_ipp_not_supported("IPP ${IPP_VERSION_STR} is not supported")
endif()
set(HAVE_IPP 1)
if(EXISTS ${IPP_INCLUDE_DIRS}/ipp_redefine.h)
set(HAVE_IPP_REDEFINE 1)
else()
unset(HAVE_IPP_REDEFINE)
endif()
macro(_ipp_set_library_dir DIR)
if(NOT EXISTS ${DIR})
_ipp_not_supported("IPP library directory not found")
endif()
set(IPP_LIBRARY_DIR ${DIR})
endmacro()
if(NOT HAVE_IPP_ICV_ONLY) if(NOT HAVE_IPP_ICV_ONLY)
if(APPLE) if(APPLE)
set(IPP_LIBRARY_DIR ${IPP_ROOT_DIR}/lib) _ipp_set_library_dir(${IPP_ROOT_DIR}/lib)
elseif(IPP_X64) elseif(IPP_X64)
if(NOT EXISTS ${IPP_ROOT_DIR}/lib/intel64) _ipp_set_library_dir(${IPP_ROOT_DIR}/lib/intel64)
message(SEND_ERROR "IPP EM64T libraries not found")
endif()
set(IPP_LIBRARY_DIR ${IPP_ROOT_DIR}/lib/intel64)
else() else()
if(NOT EXISTS ${IPP_ROOT_DIR}/lib/ia32) _ipp_set_library_dir(${IPP_ROOT_DIR}/lib/ia32)
message(SEND_ERROR "IPP IA32 libraries not found")
endif()
set(IPP_LIBRARY_DIR ${IPP_ROOT_DIR}/lib/ia32)
endif() endif()
else() else()
if(APPLE) if(EXISTS ${IPP_ROOT_DIR}/lib)
set(IPP_LIBRARY_DIR ${IPP_ROOT_DIR}/libs/macosx) set(IPP_LIBRARY_DIR ${IPP_ROOT_DIR}/lib)
elseif(WIN32 AND NOT ARM)
set(IPP_LIBRARY_DIR ${IPP_ROOT_DIR}/libs/windows)
elseif(UNIX)
set(IPP_LIBRARY_DIR ${IPP_ROOT_DIR}/libs/linux)
else() else()
message(MESSAGE "IPP ${_LATEST_VERSION} at ${IPP_ROOT_DIR} is not supported") _ipp_not_supported("IPP ${IPP_VERSION_STR} at ${IPP_ROOT_DIR} is not supported")
unset(HAVE_IPP)
return()
endif() endif()
if(X86_64) if(X86_64)
set(IPP_LIBRARY_DIR ${IPP_LIBRARY_DIR}/intel64) _ipp_set_library_dir(${IPP_LIBRARY_DIR}/intel64)
else() else()
set(IPP_LIBRARY_DIR ${IPP_LIBRARY_DIR}/ia32) _ipp_set_library_dir(${IPP_LIBRARY_DIR}/ia32)
endif() endif()
endif() endif()
macro(_ipp_add_library name)
if (EXISTS ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX})
list(APPEND IPP_LIBRARIES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${name}${IPP_SUFFIX}${IPP_LIB_SUFFIX})
else()
message(STATUS "Can't find IPP library: ${name}")
endif()
endmacro()
set(IPP_PREFIX "ipp") set(IPP_PREFIX "ipp")
if(${_LATEST_VERSION} VERSION_LESS "8.0") if(${IPP_VERSION_STR} VERSION_LESS "8.0")
set(IPP_SUFFIX "_l") # static not threaded libs suffix IPP 7.x set(IPP_SUFFIX "_l") # static not threaded libs suffix IPP 7.x
else() else()
if(WIN32) if(WIN32)
@ -150,86 +165,92 @@ macro(ipp_set_variables _LATEST_VERSION)
set(IPP_SUFFIX "") # static not threaded libs suffix IPP 8.x for Linux/OS X set(IPP_SUFFIX "") # static not threaded libs suffix IPP 8.x for Linux/OS X
endif() endif()
endif() endif()
set(IPPCORE "core") # core functionality
set(IPPSP "s") # signal processing
set(IPPIP "i") # image processing
set(IPPCC "cc") # color conversion
set(IPPCV "cv") # computer vision
set(IPPVM "vm") # vector math
set(IPPM "m") # matrix math
list(APPEND IPP_LIBRARIES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPVM}${IPP_SUFFIX}${IPP_LIB_SUFFIX}) if(HAVE_IPP_ICV_ONLY)
list(APPEND IPP_LIBRARIES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCC}${IPP_SUFFIX}${IPP_LIB_SUFFIX}) _ipp_add_library(icv)
list(APPEND IPP_LIBRARIES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCV}${IPP_SUFFIX}${IPP_LIB_SUFFIX})
list(APPEND IPP_LIBRARIES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPI}${IPP_SUFFIX}${IPP_LIB_SUFFIX})
list(APPEND IPP_LIBRARIES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPS}${IPP_SUFFIX}${IPP_LIB_SUFFIX})
list(APPEND IPP_LIBRARIES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCORE}${IPP_SUFFIX}${IPP_LIB_SUFFIX})
if(NOT HAVE_IPP_ICV_ONLY)
list(APPEND IPP_LIBRARIES ${IPP_LIBRARY_DIR}/${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPM}${IPP_SUFFIX}${IPP_LIB_SUFFIX})
endif()
# FIXIT
# if(UNIX AND NOT HAVE_IPP_ICV_ONLY)
# get_filename_component(INTEL_COMPILER_LIBRARY_DIR ${IPP_ROOT_DIR}/../lib REALPATH)
if(UNIX)
if(NOT HAVE_IPP_ICV_ONLY)
get_filename_component(INTEL_COMPILER_LIBRARY_DIR ${IPP_ROOT_DIR}/../lib REALPATH)
else() else()
set(INTEL_COMPILER_LIBRARY_DIR "/opt/intel/lib") _ipp_add_library(core)
_ipp_add_library(s)
_ipp_add_library(i)
_ipp_add_library(cc)
_ipp_add_library(cv)
_ipp_add_library(vm)
_ipp_add_library(m)
if(UNIX)
get_filename_component(INTEL_COMPILER_LIBRARY_DIR ${IPP_ROOT_DIR}/../lib REALPATH)
if(NOT EXISTS ${INTEL_COMPILER_LIBRARY_DIR})
get_filename_component(INTEL_COMPILER_LIBRARY_DIR ${IPP_ROOT_DIR}/../compiler/lib REALPATH)
endif() endif()
if(NOT EXISTS ${INTEL_COMPILER_LIBRARY_DIR})
_ipp_not_supported("IPP configuration error: can't find Intel compiler library dir ${INTEL_COMPILER_LIBRARY_DIR}")
endif()
if(NOT APPLE)
if(IPP_X64) if(IPP_X64)
if(NOT EXISTS ${INTEL_COMPILER_LIBRARY_DIR}/intel64) if(NOT EXISTS ${INTEL_COMPILER_LIBRARY_DIR}/intel64)
message(SEND_ERROR "Intel compiler EM64T libraries not found") message(SEND_ERROR "Intel compiler EM64T libraries not found")
endif() endif()
if(NOT APPLE)
set(INTEL_COMPILER_LIBRARY_DIR ${INTEL_COMPILER_LIBRARY_DIR}/intel64) set(INTEL_COMPILER_LIBRARY_DIR ${INTEL_COMPILER_LIBRARY_DIR}/intel64)
endif()
else() else()
if(NOT EXISTS ${INTEL_COMPILER_LIBRARY_DIR}/ia32) if(NOT EXISTS ${INTEL_COMPILER_LIBRARY_DIR}/ia32)
message(SEND_ERROR "Intel compiler IA32 libraries not found") message(SEND_ERROR "Intel compiler IA32 libraries not found")
endif() endif()
if (NOT APPLE)
set(INTEL_COMPILER_LIBRARY_DIR ${INTEL_COMPILER_LIBRARY_DIR}/ia32) set(INTEL_COMPILER_LIBRARY_DIR ${INTEL_COMPILER_LIBRARY_DIR}/ia32)
endif() endif()
endif() endif()
list(APPEND IPP_LIBRARIES ${INTEL_COMPILER_LIBRARY_DIR}/${IPP_LIB_PREFIX}irc${CMAKE_SHARED_LIBRARY_SUFFIX})
list(APPEND IPP_LIBRARIES ${INTEL_COMPILER_LIBRARY_DIR}/${IPP_LIB_PREFIX}imf${CMAKE_SHARED_LIBRARY_SUFFIX}) macro(_ipp_add_compiler_library name)
list(APPEND IPP_LIBRARIES ${INTEL_COMPILER_LIBRARY_DIR}/${IPP_LIB_PREFIX}svml${CMAKE_SHARED_LIBRARY_SUFFIX}) if (EXISTS ${INTEL_COMPILER_LIBRARY_DIR}/${IPP_LIB_PREFIX}${name}${CMAKE_SHARED_LIBRARY_SUFFIX})
list(APPEND IPP_LIBRARIES ${INTEL_COMPILER_LIBRARY_DIR}/${IPP_LIB_PREFIX}${name}${CMAKE_SHARED_LIBRARY_SUFFIX})
else()
message(STATUS "Can't find compiler library: ${name}")
endif()
endmacro()
_ipp_add_compiler_library(irc)
_ipp_add_compiler_library(imf)
_ipp_add_compiler_library(svml)
endif(UNIX)
endif() endif()
#message(STATUS "IPP libs: ${IPP_LIBRARIES}") #message(STATUS "IPP libs: ${IPP_LIBRARIES}")
endmacro() endmacro()
if(WITH_IPP) # OPENCV_IPP_PATH is an environment variable for internal usage only, do not use it
set(IPPPATH $ENV{IPPROOT}) if(DEFINED ENV{OPENCV_IPP_PATH} AND NOT DEFINED IPPROOT)
if(UNIX) set(IPPROOT "$ENV{OPENCV_IPP_PATH}")
list(APPEND IPPPATH /opt/intel/ipp) endif()
endif() if(NOT DEFINED IPPROOT)
elseif(WITH_ICV) set(IPPROOT "${OpenCV_SOURCE_DIR}/3rdparty/ippicv")
if(DEFINED ENV{IPPICVROOT})
set(IPPPATH $ENV{IPPICVROOT})
else()
set(IPPPATH ${OpenCV_SOURCE_DIR}/3rdparty/ippicv)
endif()
endif() endif()
# Try ICV
find_path( find_path(
IPP_ICV_H_PATH
NAMES ippicv.h
PATHS ${IPPROOT}
DOC "The path to Intel(R) IPP ICV header files"
NO_DEFAULT_PATH
NO_CMAKE_PATH)
set(IPP_ROOT_DIR ${IPP_ICV_H_PATH})
if(NOT IPP_ICV_H_PATH)
# Try standalone IPP
find_path(
IPP_H_PATH IPP_H_PATH
NAMES ippversion.h NAMES ippversion.h
PATHS ${IPPPATH} PATHS ${IPPROOT}
PATH_SUFFIXES include PATH_SUFFIXES include
DOC "The path to Intel(R) IPP header files" DOC "The path to Intel(R) IPP header files"
NO_DEFAULT_PATH NO_DEFAULT_PATH
NO_CMAKE_PATH) NO_CMAKE_PATH)
if(IPP_H_PATH)
if(IPP_H_PATH)
set(HAVE_IPP 1)
get_filename_component(IPP_ROOT_DIR ${IPP_H_PATH} PATH) get_filename_component(IPP_ROOT_DIR ${IPP_H_PATH} PATH)
endif()
endif()
ipp_get_version(${IPP_ROOT_DIR}) if(IPP_ROOT_DIR)
ipp_set_variables(${IPP_VERSION_STR}) ipp_detect_version()
endif() endif()

View File

@ -8,7 +8,7 @@ if(WITH_TBB)
endif(WITH_TBB) endif(WITH_TBB)
# --- IPP --- # --- IPP ---
if(WITH_IPP OR WITH_ICV) if(WITH_IPP)
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindIPP.cmake") include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindIPP.cmake")
if(HAVE_IPP) if(HAVE_IPP)
ocv_include_directories(${IPP_INCLUDE_DIRS}) ocv_include_directories(${IPP_INCLUDE_DIRS})

View File

@ -211,8 +211,8 @@ CV_EXPORTS void scalarToRawData(const cv::Scalar& s, void* buf, int type, int un
#ifdef HAVE_IPP #ifdef HAVE_IPP
# ifdef HAVE_IPP_ICV_ONLY # ifdef HAVE_IPP_ICV_ONLY
# include "ipp_redefine.h"
# include "ippicv.h" # include "ippicv.h"
# include "ippicv_fn_map.h"
# else # else
# include "ipp.h" # include "ipp.h"
# endif # endif

View File

@ -1079,7 +1079,7 @@ dtype* dst, size_t dstep, Size size, double* scale) \
cvtScale_(src, sstep, dst, dstep, size, (wtype)scale[0], (wtype)scale[1]); \ cvtScale_(src, sstep, dst, dstep, size, (wtype)scale[0], (wtype)scale[1]); \
} }
#ifdef HAVE_IPP #if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY)
#define DEF_CVT_FUNC_F(suffix, stype, dtype, ippFavor) \ #define DEF_CVT_FUNC_F(suffix, stype, dtype, ippFavor) \
static void cvt##suffix( const stype* src, size_t sstep, const uchar*, size_t, \ static void cvt##suffix( const stype* src, size_t sstep, const uchar*, size_t, \
dtype* dst, size_t dstep, Size size, double*) \ dtype* dst, size_t dstep, Size size, double*) \

View File

@ -548,7 +548,7 @@ void flip( InputArray _src, OutputArray _dst, int flip_mode )
Mat dst = _dst.getMat(); Mat dst = _dst.getMat();
size_t esz = CV_ELEM_SIZE(type); size_t esz = CV_ELEM_SIZE(type);
#ifdef HAVE_IPP #if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY)
typedef IppStatus (CV_STDCALL * ippiMirror)(const void * pSrc, int srcStep, void * pDst, int dstStep, IppiSize roiSize, IppiAxis flip); typedef IppStatus (CV_STDCALL * ippiMirror)(const void * pSrc, int srcStep, void * pDst, int dstStep, IppiSize roiSize, IppiAxis flip);
ippiMirror ippFunc = ippiMirror ippFunc =
type == CV_8UC1 ? (ippiMirror)ippiMirror_8u_C1R : type == CV_8UC1 ? (ippiMirror)ippiMirror_8u_C1R :

View File

@ -238,7 +238,7 @@ float cubeRoot( float value )
static void Magnitude_32f(const float* x, const float* y, float* mag, int len) static void Magnitude_32f(const float* x, const float* y, float* mag, int len)
{ {
#ifdef HAVE_IPP #if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY)
IppStatus status = ippsMagnitude_32f(x, y, mag, len); IppStatus status = ippsMagnitude_32f(x, y, mag, len);
if (status >= 0) if (status >= 0)
return; return;
@ -270,7 +270,7 @@ static void Magnitude_32f(const float* x, const float* y, float* mag, int len)
static void Magnitude_64f(const double* x, const double* y, double* mag, int len) static void Magnitude_64f(const double* x, const double* y, double* mag, int len)
{ {
#ifdef HAVE_IPP #if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY)
IppStatus status = ippsMagnitude_64f(x, y, mag, len); IppStatus status = ippsMagnitude_64f(x, y, mag, len);
if (status >= 0) if (status >= 0)
return; return;
@ -303,7 +303,7 @@ static void Magnitude_64f(const double* x, const double* y, double* mag, int len
static void InvSqrt_32f(const float* src, float* dst, int len) static void InvSqrt_32f(const float* src, float* dst, int len)
{ {
#ifdef HAVE_IPP #if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY)
if (ippsInvSqrt_32f_A21(src, dst, len) >= 0) if (ippsInvSqrt_32f_A21(src, dst, len) >= 0)
return; return;
#endif #endif
@ -351,7 +351,7 @@ static void InvSqrt_64f(const double* src, double* dst, int len)
static void Sqrt_32f(const float* src, float* dst, int len) static void Sqrt_32f(const float* src, float* dst, int len)
{ {
#ifdef HAVE_IPP #if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY)
if (ippsSqrt_32f_A21(src, dst, len) >= 0) if (ippsSqrt_32f_A21(src, dst, len) >= 0)
return; return;
#endif #endif
@ -384,7 +384,7 @@ static void Sqrt_32f(const float* src, float* dst, int len)
static void Sqrt_64f(const double* src, double* dst, int len) static void Sqrt_64f(const double* src, double* dst, int len)
{ {
#ifdef HAVE_IPP #if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY)
if (ippsSqrt_64f_A50(src, dst, len) >= 0) if (ippsSqrt_64f_A50(src, dst, len) >= 0)
return; return;
#endif #endif
@ -755,7 +755,7 @@ void polarToCart( InputArray src1, InputArray src2,
dst2.create( Angle.dims, Angle.size, type ); dst2.create( Angle.dims, Angle.size, type );
Mat X = dst1.getMat(), Y = dst2.getMat(); Mat X = dst1.getMat(), Y = dst2.getMat();
#ifdef HAVE_IPP #if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY)
if (Mag.isContinuous() && Angle.isContinuous() && X.isContinuous() && Y.isContinuous() && !angleInDegrees) if (Mag.isContinuous() && Angle.isContinuous() && X.isContinuous() && Y.isContinuous() && !angleInDegrees)
{ {
typedef IppStatus (CV_STDCALL * ippsPolarToCart)(const void * pSrcMagn, const void * pSrcPhase, typedef IppStatus (CV_STDCALL * ippsPolarToCart)(const void * pSrcMagn, const void * pSrcPhase,
@ -2161,7 +2161,7 @@ void pow( InputArray _src, double power, OutputArray _dst )
_src.copyTo(_dst); _src.copyTo(_dst);
return; return;
case 2: case 2:
#ifdef HAVE_IPP #if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY)
if (depth == CV_32F && !same && ( (_src.dims() <= 2 && !ocl::useOpenCL()) || (_src.dims() > 2 && _src.isContinuous() && _dst.isContinuous()) )) if (depth == CV_32F && !same && ( (_src.dims() <= 2 && !ocl::useOpenCL()) || (_src.dims() > 2 && _src.isContinuous() && _dst.isContinuous()) ))
{ {
Mat src = _src.getMat(); Mat src = _src.getMat();
@ -2233,7 +2233,7 @@ void pow( InputArray _src, double power, OutputArray _dst )
} }
else else
{ {
#ifdef HAVE_IPP #if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY)
if (src.isContinuous() && dst.isContinuous()) if (src.isContinuous() && dst.isContinuous())
{ {
IppStatus status = depth == CV_32F ? IppStatus status = depth == CV_32F ?

View File

@ -2967,7 +2967,7 @@ void cv::transpose( InputArray _src, OutputArray _dst )
return; return;
} }
#ifdef HAVE_IPP #if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY)
typedef IppStatus (CV_STDCALL * ippiTranspose)(const void * pSrc, int srcStep, void * pDst, int dstStep, IppiSize roiSize); typedef IppStatus (CV_STDCALL * ippiTranspose)(const void * pSrc, int srcStep, void * pDst, int dstStep, IppiSize roiSize);
ippiTranspose ippFunc = ippiTranspose ippFunc =
type == CV_8UC1 ? (ippiTranspose)ippiTranspose_8u_C1R : type == CV_8UC1 ? (ippiTranspose)ippiTranspose_8u_C1R :

View File

@ -457,7 +457,7 @@ void cv::accumulateSquare( InputArray _src, InputOutputArray _dst, InputArray _m
Mat src = _src.getMat(), dst = _dst.getMat(), mask = _mask.getMat(); Mat src = _src.getMat(), dst = _dst.getMat(), mask = _mask.getMat();
#ifdef HAVE_IPP #if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY)
if (src.dims <= 2 || (src.isContinuous() && dst.isContinuous() && (mask.empty() || mask.isContinuous()))) if (src.dims <= 2 || (src.isContinuous() && dst.isContinuous() && (mask.empty() || mask.isContinuous())))
{ {
typedef IppStatus (CV_STDCALL * ippiAddSquare)(const void * pSrc, int srcStep, Ipp32f * pSrcDst, int srcdstStep, IppiSize roiSize); typedef IppStatus (CV_STDCALL * ippiAddSquare)(const void * pSrc, int srcStep, Ipp32f * pSrcDst, int srcdstStep, IppiSize roiSize);
@ -535,7 +535,7 @@ void cv::accumulateProduct( InputArray _src1, InputArray _src2,
Mat src1 = _src1.getMat(), src2 = _src2.getMat(), dst = _dst.getMat(), mask = _mask.getMat(); Mat src1 = _src1.getMat(), src2 = _src2.getMat(), dst = _dst.getMat(), mask = _mask.getMat();
#ifdef HAVE_IPP #if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY)
if (src1.dims <= 2 || (src1.isContinuous() && src2.isContinuous() && dst.isContinuous())) if (src1.dims <= 2 || (src1.isContinuous() && src2.isContinuous() && dst.isContinuous()))
{ {
typedef IppStatus (CV_STDCALL * ippiAddProduct)(const void * pSrc1, int src1Step, const void * pSrc2, typedef IppStatus (CV_STDCALL * ippiAddProduct)(const void * pSrc1, int src1Step, const void * pSrc2,
@ -615,7 +615,7 @@ void cv::accumulateWeighted( InputArray _src, InputOutputArray _dst,
Mat src = _src.getMat(), dst = _dst.getMat(), mask = _mask.getMat(); Mat src = _src.getMat(), dst = _dst.getMat(), mask = _mask.getMat();
#ifdef HAVE_IPP #if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY)
if (src.dims <= 2 || (src.isContinuous() && dst.isContinuous() && mask.isContinuous())) if (src.dims <= 2 || (src.isContinuous() && dst.isContinuous() && mask.isContinuous()))
{ {
typedef IppStatus (CV_STDCALL * ippiAddWeighted)(const void * pSrc, int srcStep, Ipp32f * pSrcDst, int srcdstStep, typedef IppStatus (CV_STDCALL * ippiAddWeighted)(const void * pSrc, int srcStep, Ipp32f * pSrcDst, int srcdstStep,

View File

@ -300,7 +300,7 @@ static ippiReorderFunc ippiSwapChannelsC3RTab[] =
0, (ippiReorderFunc)ippiSwapChannels_32f_C3R, 0, 0 0, (ippiReorderFunc)ippiSwapChannels_32f_C3R, 0, 0
}; };
#if IPP_VERSION_X100 >= 801 #if !defined(HAVE_IPP_ICV_ONLY) && IPP_VERSION_X100 >= 801
static ippiReorderFunc ippiSwapChannelsC4RTab[] = static ippiReorderFunc ippiSwapChannelsC4RTab[] =
{ {
(ippiReorderFunc)ippiSwapChannels_8u_C4R, 0, (ippiReorderFunc)ippiSwapChannels_16u_C4R, 0, (ippiReorderFunc)ippiSwapChannels_8u_C4R, 0, (ippiReorderFunc)ippiSwapChannels_16u_C4R, 0,
@ -3280,7 +3280,7 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
if( CvtColorIPPLoopCopy(src, dst, IPPReorderFunctor(ippiSwapChannelsC3RTab[depth], 2, 1, 0)) ) if( CvtColorIPPLoopCopy(src, dst, IPPReorderFunctor(ippiSwapChannelsC3RTab[depth], 2, 1, 0)) )
return; return;
} }
#if (IPP_VERSION_X100 >= 801) #if !defined(HAVE_IPP_ICV_ONLY) && (IPP_VERSION_X100 >= 801)
else if( code == CV_RGBA2BGRA ) else if( code == CV_RGBA2BGRA )
{ {
if( CvtColorIPPLoopCopy(src, dst, IPPReorderFunctor(ippiSwapChannelsC4RTab[depth], 2, 1, 0)) ) if( CvtColorIPPLoopCopy(src, dst, IPPReorderFunctor(ippiSwapChannelsC4RTab[depth], 2, 1, 0)) )

View File

@ -233,6 +233,9 @@ static bool IPPDerivScharr(const Mat& src, Mat& dst, int ddepth, int dx, int dy,
} }
} }
case CV_32F: case CV_32F:
#if defined(HAVE_IPP_ICV_ONLY) // N/A: ippiMulC_32f_C1R
return false;
#else
{ {
switch(dst.type()) switch(dst.type())
{ {
@ -277,6 +280,7 @@ static bool IPPDerivScharr(const Mat& src, Mat& dst, int ddepth, int dx, int dy,
return false; return false;
} }
} }
#endif
default: default:
return false; return false;
} }
@ -341,6 +345,9 @@ static bool IPPDeriv(const Mat& src, Mat& dst, int ddepth, int dx, int dy, int k
if (src.type() == CV_32F && dst.type() == CV_32F) if (src.type() == CV_32F && dst.type() == CV_32F)
{ {
#if defined(HAVE_IPP_ICV_ONLY) // N/A: ippiMulC_32f_C1R
return false;
#else
#if 0 #if 0
if ((dx == 1) && (dy == 0)) if ((dx == 1) && (dy == 0))
{ {
@ -411,6 +418,7 @@ static bool IPPDeriv(const Mat& src, Mat& dst, int ddepth, int dx, int dy, int k
ippiMulC_32f_C1R((Ipp32f *)dst.data, (int)dst.step, (Ipp32f)scale, (Ipp32f *)dst.data, (int)dst.step, ippiSize(dst.cols*dst.channels(), dst.rows)); ippiMulC_32f_C1R((Ipp32f *)dst.data, (int)dst.step, (Ipp32f)scale, (Ipp32f *)dst.data, (int)dst.step, ippiSize(dst.cols*dst.channels(), dst.rows));
return true; return true;
} }
#endif
} }
} }

View File

@ -1912,7 +1912,7 @@ static int computeResizeAreaTab( int ssize, int dsize, int cn, double scale, Dec
getBufferSizeFunc = (ippiResizeGetBufferSize)ippiResizeGetBufferSize_##TYPE;\ getBufferSizeFunc = (ippiResizeGetBufferSize)ippiResizeGetBufferSize_##TYPE;\
getSrcOffsetFunc = (ippiResizeGetSrcOffset)ippiResizeGetSrcOffset_##TYPE; getSrcOffsetFunc = (ippiResizeGetSrcOffset)ippiResizeGetSrcOffset_##TYPE;
#if IPP_VERSION_X100 >= 701 #if !defined(HAVE_IPP_ICV_ONLY) && IPP_VERSION_X100 >= 701
class IPPresizeInvoker : class IPPresizeInvoker :
public ParallelLoopBody public ParallelLoopBody
{ {
@ -2384,7 +2384,7 @@ void cv::resize( InputArray _src, OutputArray _dst, Size dsize,
double scale_x = 1./inv_scale_x, scale_y = 1./inv_scale_y; double scale_x = 1./inv_scale_x, scale_y = 1./inv_scale_y;
int k, sx, sy, dx, dy; int k, sx, sy, dx, dy;
#if IPP_VERSION_X100 >= 701 #if !defined(HAVE_IPP_ICV_ONLY) && IPP_VERSION_X100 >= 701
#define IPP_RESIZE_EPS 1.e-10 #define IPP_RESIZE_EPS 1.e-10
double ex = fabs((double)dsize.width/src.cols - inv_scale_x)/inv_scale_x; double ex = fabs((double)dsize.width/src.cols - inv_scale_x)/inv_scale_x;

View File

@ -1228,6 +1228,9 @@ static bool IPPMorphReplicate(int op, const Mat &src, Mat &dst, const Mat &kerne
} }
else else
{ {
#if defined(HAVE_IPP_ICV_ONLY) // N/A: ippiFilterMin*/ippiFilterMax*
return false;
#else
IppiPoint point = {anchor.x, anchor.y}; IppiPoint point = {anchor.x, anchor.y};
#define IPP_MORPH_CASE(cvtype, flavor, data_type) \ #define IPP_MORPH_CASE(cvtype, flavor, data_type) \
@ -1257,6 +1260,7 @@ static bool IPPMorphReplicate(int op, const Mat &src, Mat &dst, const Mat &kerne
} }
#undef IPP_MORPH_CASE #undef IPP_MORPH_CASE
#endif
} }
} }

View File

@ -858,7 +858,7 @@ void cv::boxFilter( InputArray _src, OutputArray _dst, int ddepth,
return; return;
#endif #endif
#ifdef HAVE_IPP #if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY)
int ippBorderType = borderType & ~BORDER_ISOLATED; int ippBorderType = borderType & ~BORDER_ISOLATED;
Point ocvAnchor, ippAnchor; Point ocvAnchor, ippAnchor;
ocvAnchor.x = anchor.x < 0 ? ksize.width / 2 : anchor.x; ocvAnchor.x = anchor.x < 0 ? ksize.width / 2 : anchor.x;
@ -2018,7 +2018,7 @@ void cv::medianBlur( InputArray _src0, OutputArray _dst, int ksize )
_dst.create( src0.size(), src0.type() ); _dst.create( src0.size(), src0.type() );
Mat dst = _dst.getMat(); Mat dst = _dst.getMat();
#if defined HAVE_IPP && IPP_VERSION_MAJOR >= 8 && IPP_VERSION_MINOR >= 1 #if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) && IPP_VERSION_X100 >= 801
#define IPP_FILTER_MEDIAN_BORDER(ippType, ippDataType, flavor) \ #define IPP_FILTER_MEDIAN_BORDER(ippType, ippDataType, flavor) \
do \ do \
{ \ { \

View File

@ -68,7 +68,7 @@ thresh_8u( const Mat& _src, Mat& _dst, uchar thresh, uchar maxval, int type )
return; return;
#endif #endif
#ifdef HAVE_IPP #if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY)
IppiSize sz = { roi.width, roi.height }; IppiSize sz = { roi.width, roi.height };
switch( type ) switch( type )
{ {
@ -306,7 +306,7 @@ thresh_16s( const Mat& _src, Mat& _dst, short thresh, short maxval, int type )
return; return;
#endif #endif
#ifdef HAVE_IPP #if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY)
IppiSize sz = { roi.width, roi.height }; IppiSize sz = { roi.width, roi.height };
switch( type ) switch( type )
{ {
@ -497,7 +497,7 @@ thresh_32f( const Mat& _src, Mat& _dst, float thresh, float maxval, int type )
return; return;
#endif #endif
#ifdef HAVE_IPP #if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY)
IppiSize sz = { roi.width, roi.height }; IppiSize sz = { roi.width, roi.height };
switch( type ) switch( type )
{ {

View File

@ -80,7 +80,7 @@ void cv::updateMotionHistory( InputArray _silhouette, InputOutputArray _mhi,
Mat silh = _silhouette.getMat(), mhi = _mhi.getMat(); Mat silh = _silhouette.getMat(), mhi = _mhi.getMat();
Size size = silh.size(); Size size = silh.size();
#ifdef HAVE_IPP #if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY)
int silhstep = (int)silh.step, mhistep = (int)mhi.step; int silhstep = (int)silh.step, mhistep = (int)mhi.step;
#endif #endif
@ -88,13 +88,13 @@ void cv::updateMotionHistory( InputArray _silhouette, InputOutputArray _mhi,
{ {
size.width *= size.height; size.width *= size.height;
size.height = 1; size.height = 1;
#ifdef HAVE_IPP #if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY)
silhstep = (int)silh.total(); silhstep = (int)silh.total();
mhistep = (int)mhi.total() * sizeof(Ipp32f); mhistep = (int)mhi.total() * sizeof(Ipp32f);
#endif #endif
} }
#ifdef HAVE_IPP #if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY)
IppStatus status = ippiUpdateMotionHistory_8u32f_C1IR((const Ipp8u *)silh.data, silhstep, (Ipp32f *)mhi.data, mhistep, IppStatus status = ippiUpdateMotionHistory_8u32f_C1IR((const Ipp8u *)silh.data, silhstep, (Ipp32f *)mhi.data, mhistep,
ippiSize(size.width, size.height), (Ipp32f)timestamp, (Ipp32f)duration); ippiSize(size.width, size.height), (Ipp32f)timestamp, (Ipp32f)duration);
if (status >= 0) if (status >= 0)