disabled IPP functions that slower than OpenCV
This commit is contained in:
@@ -3617,25 +3617,25 @@ namespace cv
|
||||
#if IPP_VERSION_X100 > 0
|
||||
#define USE_IPP_SORT
|
||||
|
||||
typedef IppStatus (CV_STDCALL *IppSortFunc)(void *, int);
|
||||
typedef IppStatus (CV_STDCALL * IppSortFunc)(void *, int);
|
||||
typedef IppSortFunc IppFlipFunc;
|
||||
|
||||
static IppSortFunc getSortFunc(int depth, bool sortDescending)
|
||||
{
|
||||
if (!sortDescending)
|
||||
return depth == CV_8U ? (IppSortFunc)ippsSortAscend_8u_I :
|
||||
depth == CV_16U ? (IppSortFunc)ippsSortAscend_16u_I :
|
||||
/*depth == CV_16U ? (IppSortFunc)ippsSortAscend_16u_I :
|
||||
depth == CV_16S ? (IppSortFunc)ippsSortAscend_16s_I :
|
||||
depth == CV_32S ? (IppSortFunc)ippsSortAscend_32s_I :
|
||||
depth == CV_32F ? (IppSortFunc)ippsSortAscend_32f_I :
|
||||
depth == CV_64F ? (IppSortFunc)ippsSortAscend_64f_I : 0;
|
||||
depth == CV_64F ? (IppSortFunc)ippsSortAscend_64f_I :*/ 0;
|
||||
else
|
||||
return depth == CV_8U ? (IppSortFunc)ippsSortDescend_8u_I :
|
||||
depth == CV_16U ? (IppSortFunc)ippsSortDescend_16u_I :
|
||||
/*depth == CV_16U ? (IppSortFunc)ippsSortDescend_16u_I :
|
||||
depth == CV_16S ? (IppSortFunc)ippsSortDescend_16s_I :
|
||||
depth == CV_32S ? (IppSortFunc)ippsSortDescend_32s_I :
|
||||
depth == CV_32F ? (IppSortFunc)ippsSortDescend_32f_I :
|
||||
depth == CV_64F ? (IppSortFunc)ippsSortDescend_64f_I : 0;
|
||||
depth == CV_64F ? (IppSortFunc)ippsSortDescend_64f_I :*/ 0;
|
||||
}
|
||||
|
||||
static IppFlipFunc getFlipFunc(int depth)
|
||||
@@ -3643,9 +3643,9 @@ static IppFlipFunc getFlipFunc(int depth)
|
||||
CV_SUPPRESS_DEPRECATED_START
|
||||
return
|
||||
depth == CV_8U || depth == CV_8S ? (IppFlipFunc)ippsFlip_8u_I :
|
||||
depth == CV_16U || depth == CV_16S ? (IppFlipFunc)ippsFlip_16u_I :
|
||||
/*depth == CV_16U || depth == CV_16S ? (IppFlipFunc)ippsFlip_16u_I :
|
||||
depth == CV_32S || depth == CV_32F ? (IppFlipFunc)ippsFlip_32f_I :
|
||||
depth == CV_64F ? (IppFlipFunc)ippsFlip_64f_I : 0;
|
||||
depth == CV_64F ? (IppFlipFunc)ippsFlip_64f_I : */0;
|
||||
CV_SUPPRESS_DEPRECATED_END
|
||||
}
|
||||
|
||||
@@ -3700,7 +3700,8 @@ template<typename T> static void sort_( const Mat& src, Mat& dst, int flags )
|
||||
#endif
|
||||
{
|
||||
#ifdef USE_IPP_SORT
|
||||
setIppErrorStatus();
|
||||
if (depth != CV_8U)
|
||||
setIppErrorStatus();
|
||||
#endif
|
||||
std::sort( ptr, ptr + len );
|
||||
if( sortDescending )
|
||||
@@ -3732,7 +3733,7 @@ public:
|
||||
const _Tp* arr;
|
||||
};
|
||||
|
||||
#ifdef USE_IPP_SORT
|
||||
#if defined USE_IPP_SORT && 0
|
||||
|
||||
typedef IppStatus (CV_STDCALL *IppSortIndexFunc)(void *, int *, int);
|
||||
|
||||
@@ -3779,7 +3780,7 @@ template<typename T> static void sortIdx_( const Mat& src, Mat& dst, int flags )
|
||||
bptr = (T*)buf;
|
||||
_iptr = (int*)ibuf;
|
||||
|
||||
#ifdef USE_IPP_SORT
|
||||
#if defined USE_IPP_SORT && 0
|
||||
int depth = src.depth();
|
||||
IppSortIndexFunc ippFunc = getSortIndexFunc(depth, sortDescending);
|
||||
IppFlipFunc ippFlipFunc = getFlipFunc(depth);
|
||||
@@ -3803,21 +3804,21 @@ template<typename T> static void sortIdx_( const Mat& src, Mat& dst, int flags )
|
||||
for( j = 0; j < len; j++ )
|
||||
iptr[j] = j;
|
||||
|
||||
#ifdef USE_IPP_SORT
|
||||
#if defined USE_IPP_SORT && 0
|
||||
if (sortRows || !ippFunc || ippFunc(ptr, iptr, len) < 0)
|
||||
#endif
|
||||
{
|
||||
#ifdef USE_IPP_SORT
|
||||
#if defined USE_IPP_SORT && 0
|
||||
setIppErrorStatus();
|
||||
#endif
|
||||
std::sort( iptr, iptr + len, LessThanIdx<T>(ptr) );
|
||||
if( sortDescending )
|
||||
{
|
||||
#ifdef USE_IPP_SORT
|
||||
#if defined USE_IPP_SORT && 0
|
||||
if (!ippFlipFunc || ippFlipFunc(iptr, len) < 0)
|
||||
#endif
|
||||
{
|
||||
#ifdef USE_IPP_SORT
|
||||
#if defined USE_IPP_SORT && 0
|
||||
setIppErrorStatus();
|
||||
#endif
|
||||
for( j = 0; j < len/2; j++ )
|
||||
|
Reference in New Issue
Block a user