Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
d16e0b37
O
Opencv
项目概览
Greenplum
/
Opencv
11 个月 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d16e0b37
编写于
4月 24, 2014
作者:
I
Ilya Lavrenov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
disabled IPP functions that slower than OpenCV
上级
e1b5a547
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
49 addition
and
50 deletion
+49
-50
modules/core/src/copy.cpp
modules/core/src/copy.cpp
+5
-5
modules/core/src/mathfuncs.cpp
modules/core/src/mathfuncs.cpp
+1
-1
modules/core/src/matmul.cpp
modules/core/src/matmul.cpp
+1
-1
modules/core/src/matrix.cpp
modules/core/src/matrix.cpp
+15
-14
modules/imgproc/src/color.cpp
modules/imgproc/src/color.cpp
+3
-5
modules/imgproc/src/corner.cpp
modules/imgproc/src/corner.cpp
+2
-4
modules/imgproc/src/imgwarp.cpp
modules/imgproc/src/imgwarp.cpp
+9
-10
modules/imgproc/src/moments.cpp
modules/imgproc/src/moments.cpp
+1
-1
modules/imgproc/src/pyramids.cpp
modules/imgproc/src/pyramids.cpp
+12
-9
未找到文件。
modules/core/src/copy.cpp
浏览文件 @
d16e0b37
...
...
@@ -423,7 +423,7 @@ Mat& Mat::setTo(InputArray _value, InputArray _mask)
int
cn
=
channels
(),
depth0
=
depth
();
if
(
!
mask
.
empty
()
&&
(
dims
<=
2
||
(
isContinuous
()
&&
mask
.
isContinuous
()))
&&
(
depth0
==
CV_8U
||
depth0
==
CV_16U
||
depth0
==
CV_16S
||
depth0
==
CV_32S
||
depth0
==
CV_32F
)
&&
(
/*depth0 == CV_8U ||*/
depth0
==
CV_16U
||
depth0
==
CV_16S
||
depth0
==
CV_32S
||
depth0
==
CV_32F
)
&&
(
cn
==
1
||
cn
==
3
||
cn
==
4
))
{
uchar
_buf
[
32
];
...
...
@@ -442,9 +442,9 @@ Mat& Mat::setTo(InputArray _value, InputArray _mask)
if
(
cn
==
1
)
{
if
(
depth0
==
CV_8U
)
/*
if (depth0 == CV_8U)
status = ippiSet_8u_C1MR(*(Ipp8u *)buf, (Ipp8u *)data, dstep, roisize, mask.data, mstep);
else
if
(
depth0
==
CV_16U
)
else
*/
if
(
depth0
==
CV_16U
)
status
=
ippiSet_16u_C1MR
(
*
(
Ipp16u
*
)
buf
,
(
Ipp16u
*
)
data
,
dstep
,
roisize
,
mask
.
data
,
mstep
);
else
if
(
depth0
==
CV_16S
)
status
=
ippiSet_16s_C1MR
(
*
(
Ipp16s
*
)
buf
,
(
Ipp16s
*
)
data
,
dstep
,
roisize
,
mask
.
data
,
mstep
);
...
...
@@ -468,9 +468,9 @@ Mat& Mat::setTo(InputArray _value, InputArray _mask)
{ \
if (cn == ippcn) \
{ \
if (depth0 == CV_8U) \
/*
if (depth0 == CV_8U) \
IPP_SET(8u, ippcn); \
else if (depth0 == CV_16U) \
else
*/
if (depth0 == CV_16U) \
IPP_SET(16u, ippcn); \
else if (depth0 == CV_16S) \
IPP_SET(16s, ippcn); \
...
...
modules/core/src/mathfuncs.cpp
浏览文件 @
d16e0b37
...
...
@@ -237,7 +237,7 @@ float cubeRoot( float value )
static
void
Magnitude_32f
(
const
float
*
x
,
const
float
*
y
,
float
*
mag
,
int
len
)
{
#if defined
(HAVE_IPP)
#if defined
HAVE_IPP && 0
IppStatus
status
=
ippsMagnitude_32f
(
x
,
y
,
mag
,
len
);
if
(
status
>=
0
)
return
;
...
...
modules/core/src/matmul.cpp
浏览文件 @
d16e0b37
...
...
@@ -2798,7 +2798,7 @@ dotProd_(const T* src1, const T* src2, int len)
static
double
dotProd_8u
(
const
uchar
*
src1
,
const
uchar
*
src2
,
int
len
)
{
double
r
=
0
;
#if ARITHM_USE_IPP
#if ARITHM_USE_IPP
&& 0
if
(
0
<=
ippiDotProd_8u64f_C1R
(
src1
,
(
int
)(
len
*
sizeof
(
src1
[
0
])),
src2
,
(
int
)(
len
*
sizeof
(
src2
[
0
])),
ippiSize
(
len
,
1
),
&
r
))
...
...
modules/core/src/matrix.cpp
浏览文件 @
d16e0b37
...
...
@@ -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
;
};
#if
def 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
;
#if
def 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
;
#if
def USE_IPP_SORT
#if
defined USE_IPP_SORT && 0
if
(
sortRows
||
!
ippFunc
||
ippFunc
(
ptr
,
iptr
,
len
)
<
0
)
#endif
{
#if
def USE_IPP_SORT
#if
defined USE_IPP_SORT && 0
setIppErrorStatus
();
#endif
std
::
sort
(
iptr
,
iptr
+
len
,
LessThanIdx
<
T
>
(
ptr
)
);
if
(
sortDescending
)
{
#if
def USE_IPP_SORT
#if
defined USE_IPP_SORT && 0
if
(
!
ippFlipFunc
||
ippFlipFunc
(
iptr
,
len
)
<
0
)
#endif
{
#if
def USE_IPP_SORT
#if
defined USE_IPP_SORT && 0
setIppErrorStatus
();
#endif
for
(
j
=
0
;
j
<
len
/
2
;
j
++
)
...
...
modules/imgproc/src/color.cpp
浏览文件 @
d16e0b37
...
...
@@ -3977,22 +3977,20 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
setIppErrorStatus();
}
else
#endif
if
(
code
==
CV_LRGB2Lab
&&
scn
==
3
&&
depth
==
CV_8U
)
if (code == CV_LRGB2Lab && scn == 3 && depth == CV_8U) // slower than OpenCV
{
if (CvtColorIPPLoop(src, dst, IPPReorderGeneralFunctor(ippiSwapChannelsC3RTab[depth],
(ippiGeneralFunc)ippiBGRToLab_8u_C3R, 2, 1, 0, depth)))
return;
setIppErrorStatus();
}
else
if
(
code
==
CV_LRGB2Lab
&&
scn
==
4
&&
depth
==
CV_8U
)
else if (code == CV_LRGB2Lab && scn == 4 && depth == CV_8U)
// slower than OpenCV
{
if (CvtColorIPPLoop(src, dst, IPPReorderGeneralFunctor(ippiSwapChannelsC4C3RTab[depth],
(ippiGeneralFunc)ippiBGRToLab_8u_C3R, 2, 1, 0, depth)))
return;
setIppErrorStatus();
}
#if 0
else if (code == CV_LRGB2Luv && scn == 3)
{
if (CvtColorIPPLoop(src, dst, IPPGeneralFunctor(ippiRGBToLUVTab[depth])))
...
...
@@ -4054,7 +4052,7 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
_dst
.
create
(
sz
,
CV_MAKETYPE
(
depth
,
dcn
));
dst
=
_dst
.
getMat
();
#if defined
(HAVE_IPP)
&& 0
#if defined
HAVE_IPP
&& 0
if
(
code
==
CV_Lab2LBGR
&&
dcn
==
3
&&
depth
==
CV_8U
)
{
if
(
CvtColorIPPLoop
(
src
,
dst
,
IPPGeneralFunctor
((
ippiGeneralFunc
)
ippiLabToBGR_8u_C3R
))
)
...
...
modules/imgproc/src/corner.cpp
浏览文件 @
d16e0b37
...
...
@@ -526,7 +526,7 @@ void cv::cornerHarris( InputArray _src, OutputArray _dst, int blockSize, int ksi
_dst
.
create
(
src
.
size
(),
CV_32FC1
);
Mat
dst
=
_dst
.
getMat
();
#if IPP_VERSION_X100 >= 801
#if IPP_VERSION_X100 >= 801
&& 0
int
type
=
src
.
type
(),
depth
=
CV_MAT_DEPTH
(
type
),
cn
=
CV_MAT_CN
(
type
);
int
borderTypeNI
=
borderType
&
~
BORDER_ISOLATED
;
bool
isolated
=
(
borderType
&
BORDER_ISOLATED
)
!=
0
;
...
...
@@ -563,10 +563,8 @@ void cv::cornerHarris( InputArray _src, OutputArray _dst, int blockSize, int ksi
if
(
status
>=
0
)
return
;
setIppErrorStatus
();
}
else
setIppErrorStatus
();
setIppErrorStatus
();
}
#endif
...
...
modules/imgproc/src/imgwarp.cpp
浏览文件 @
d16e0b37
...
...
@@ -2085,10 +2085,8 @@ static bool ocl_resize( InputArray _src, OutputArray _dst, Size dsize,
cn
);
k
.
create
(
"resizeSampler"
,
ocl
::
imgproc
::
resize_oclsrc
,
compileOpts
);
if
(
k
.
empty
())
{
if
(
k
.
empty
())
useSampler
=
false
;
}
else
{
// Convert the input into an OpenCL image type, using normalized channel data types
...
...
@@ -2397,6 +2395,12 @@ void cv::resize( InputArray _src, OutputArray _dst, Size dsize,
double
scale_x
=
1.
/
inv_scale_x
,
scale_y
=
1.
/
inv_scale_y
;
int
k
,
sx
,
sy
,
dx
,
dy
;
int
iscale_x
=
saturate_cast
<
int
>
(
scale_x
);
int
iscale_y
=
saturate_cast
<
int
>
(
scale_y
);
bool
is_area_fast
=
std
::
abs
(
scale_x
-
iscale_x
)
<
DBL_EPSILON
&&
std
::
abs
(
scale_y
-
iscale_y
)
<
DBL_EPSILON
;
#if IPP_VERSION_X100 >= 701
#define IPP_RESIZE_EPS 1e-10
...
...
@@ -2404,7 +2408,8 @@ void cv::resize( InputArray _src, OutputArray _dst, Size dsize,
double
ey
=
fabs
((
double
)
dsize
.
height
/
src
.
rows
-
inv_scale_y
)
/
inv_scale_y
;
if
(
((
ex
<
IPP_RESIZE_EPS
&&
ey
<
IPP_RESIZE_EPS
&&
depth
!=
CV_64F
)
||
(
ex
==
0
&&
ey
==
0
&&
depth
==
CV_64F
))
&&
(
interpolation
==
INTER_LINEAR
||
interpolation
==
INTER_CUBIC
))
(
interpolation
==
INTER_LINEAR
||
interpolation
==
INTER_CUBIC
)
&&
!
(
interpolation
==
INTER_LINEAR
&&
is_area_fast
&&
iscale_x
==
2
&&
iscale_y
==
2
&&
depth
==
CV_8U
))
{
int
mode
=
-
1
;
if
(
interpolation
==
INTER_LINEAR
&&
src
.
rows
>=
2
&&
src
.
cols
>=
2
)
...
...
@@ -2435,12 +2440,6 @@ void cv::resize( InputArray _src, OutputArray _dst, Size dsize,
}
{
int
iscale_x
=
saturate_cast
<
int
>
(
scale_x
);
int
iscale_y
=
saturate_cast
<
int
>
(
scale_y
);
bool
is_area_fast
=
std
::
abs
(
scale_x
-
iscale_x
)
<
DBL_EPSILON
&&
std
::
abs
(
scale_y
-
iscale_y
)
<
DBL_EPSILON
;
// in case of scale_x && scale_y is equal to 2
// INTER_AREA (fast) also is equal to INTER_LINEAR
if
(
interpolation
==
INTER_LINEAR
&&
is_area_fast
&&
iscale_x
==
2
&&
iscale_y
==
2
)
...
...
modules/imgproc/src/moments.cpp
浏览文件 @
d16e0b37
...
...
@@ -462,7 +462,7 @@ cv::Moments cv::moments( InputArray _src, bool binary )
if
(
cn
>
1
)
CV_Error
(
CV_StsBadArg
,
"Invalid image type (must be single-channel)"
);
#if IPP_VERSION_X100 >= 801
#if IPP_VERSION_X100 >= 801
&& 0
if
(
!
binary
)
{
IppiSize
roi
=
{
mat
.
cols
,
mat
.
rows
};
...
...
modules/imgproc/src/pyramids.cpp
浏览文件 @
d16e0b37
...
...
@@ -508,7 +508,7 @@ void cv::pyrDown( InputArray _src, OutputArray _dst, const Size& _dsz, int borde
return
;
#endif
#if IPP_VERSION_X100 >= 801
#if IPP_VERSION_X100 >= 801
&& 0
bool
isolated
=
(
borderType
&
BORDER_ISOLATED
)
!=
0
;
int
borderTypeNI
=
borderType
&
~
BORDER_ISOLATED
;
if
(
borderTypeNI
==
BORDER_DEFAULT
&&
(
!
src
.
isSubmatrix
()
||
isolated
)
&&
dsz
==
Size
((
src
.
cols
+
1
)
/
2
,
(
src
.
rows
+
1
)
/
2
))
...
...
@@ -577,7 +577,7 @@ void cv::pyrUp( InputArray _src, OutputArray _dst, const Size& _dsz, int borderT
return
;
#endif
#if IPP_VERSION_X100 >= 801
#if IPP_VERSION_X100 >= 801
&& 0
bool
isolated
=
(
borderType
&
BORDER_ISOLATED
)
!=
0
;
int
borderTypeNI
=
borderType
&
~
BORDER_ISOLATED
;
if
(
borderTypeNI
==
BORDER_DEFAULT
&&
(
!
src
.
isSubmatrix
()
||
isolated
)
&&
dsz
==
Size
(
src
.
cols
*
2
,
src
.
rows
*
2
))
...
...
@@ -648,7 +648,7 @@ void cv::buildPyramid( InputArray _src, OutputArrayOfArrays _dst, int maxlevel,
int
i
=
1
;
#if IPP_VERSION_X100 >= 801
#if IPP_VERSION_X100 >= 801
&& 0
bool
isolated
=
(
borderType
&
BORDER_ISOLATED
)
!=
0
;
int
borderTypeNI
=
borderType
&
~
BORDER_ISOLATED
;
if
(
borderTypeNI
==
BORDER_DEFAULT
&&
(
!
src
.
isSubmatrix
()
||
isolated
))
...
...
@@ -668,17 +668,20 @@ void cv::buildPyramid( InputArray _src, OutputArrayOfArrays _dst, int maxlevel,
pyrInitAllocFunc
=
(
ippiPyramidLayerDownInitAlloc
)
ippiPyramidLayerDownInitAlloc_8u_C1R
;
pyrDownFunc
=
(
ippiPyramidLayerDown
)
ippiPyramidLayerDown_8u_C1R
;
pyrFreeFunc
=
(
ippiPyramidLayerDownFree
)
ippiPyramidLayerDownFree_8u_C1R
;
}
else
if
(
type
==
CV_8UC3
)
}
else
if
(
type
==
CV_8UC3
)
{
pyrInitAllocFunc
=
(
ippiPyramidLayerDownInitAlloc
)
ippiPyramidLayerDownInitAlloc_8u_C3R
;
pyrDownFunc
=
(
ippiPyramidLayerDown
)
ippiPyramidLayerDown_8u_C3R
;
pyrFreeFunc
=
(
ippiPyramidLayerDownFree
)
ippiPyramidLayerDownFree_8u_C3R
;
}
else
if
(
type
==
CV_32FC1
)
}
else
if
(
type
==
CV_32FC1
)
{
pyrInitAllocFunc
=
(
ippiPyramidLayerDownInitAlloc
)
ippiPyramidLayerDownInitAlloc_32f_C1R
;
pyrDownFunc
=
(
ippiPyramidLayerDown
)
ippiPyramidLayerDown_32f_C1R
;
pyrFreeFunc
=
(
ippiPyramidLayerDownFree
)
ippiPyramidLayerDownFree_32f_C1R
;
}
else
if
(
type
==
CV_32FC3
)
}
else
if
(
type
==
CV_32FC3
)
{
pyrInitAllocFunc
=
(
ippiPyramidLayerDownInitAlloc
)
ippiPyramidLayerDownInitAlloc_32f_C3R
;
pyrDownFunc
=
(
ippiPyramidLayerDown
)
ippiPyramidLayerDown_32f_C3R
;
...
...
@@ -722,10 +725,10 @@ void cv::buildPyramid( InputArray _src, OutputArrayOfArrays _dst, int maxlevel,
}
}
pyrFreeFunc
(
gPyr
->
pState
);
}
else
{
setIppErrorStatus
();
}
else
setIppErrorStatus
();
ippiPyramidFree
(
gPyr
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录