Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
2d71c094
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,发现更多精彩内容 >>
提交
2d71c094
编写于
4月 23, 2014
作者:
E
Elena Gvozdeva
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
IPP: CV::dft
上级
580559e1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
133 addition
and
6 deletion
+133
-6
modules/core/perf/perf_dft.cpp
modules/core/perf/perf_dft.cpp
+11
-6
modules/core/src/dxt.cpp
modules/core/src/dxt.cpp
+122
-0
未找到文件。
modules/core/perf/perf_dft.cpp
浏览文件 @
2d71c094
...
...
@@ -6,21 +6,26 @@ using namespace perf;
using
std
::
tr1
::
make_tuple
;
using
std
::
tr1
::
get
;
#define MAT_TYPES_DFT CV_32FC1, CV_64FC1
#define MAT_SIZES_DFT sz1080p, sz2K
#define TEST_MATS_DFT testing::Combine(testing::Values(MAT_SIZES_DFT), testing::Values(MAT_TYPES_DFT))
#define MAT_TYPES_DFT CV_32FC1, CV_32FC2, CV_64FC1
#define MAT_SIZES_DFT cv::Size(320, 480), cv::Size(800, 600), cv::Size(1280, 1024), sz1080p, sz2K
CV_ENUM
(
FlagsType
,
0
,
DFT_INVERSE
,
DFT_SCALE
,
DFT_COMPLEX_OUTPUT
,
DFT_ROWS
,
DFT_INVERSE
|
DFT_COMPLEX_OUTPUT
)
#define TEST_MATS_DFT testing::Combine(testing::Values(MAT_SIZES_DFT), testing::Values(MAT_TYPES_DFT), FlagsType::all())
PERF_TEST_P
(
Size_MatType
,
dft
,
TEST_MATS_DFT
)
typedef
std
::
tr1
::
tuple
<
Size
,
MatType
,
FlagsType
>
Size_MatType_FlagsType_t
;
typedef
perf
::
TestBaseWithParam
<
Size_MatType_FlagsType_t
>
Size_MatType_FlagsType
;
PERF_TEST_P
(
Size_MatType_FlagsType
,
dft
,
TEST_MATS_DFT
)
{
Size
sz
=
get
<
0
>
(
GetParam
());
int
type
=
get
<
1
>
(
GetParam
());
int
flags
=
get
<
2
>
(
GetParam
());
Mat
src
(
sz
,
type
);
Mat
dst
(
sz
,
type
);
declare
.
in
(
src
,
WARMUP_RNG
).
time
(
60
);
TEST_CYCLE
()
dft
(
src
,
dst
);
TEST_CYCLE
()
dft
(
src
,
dst
,
flags
);
SANITY_CHECK
(
dst
,
1e-5
,
ERROR_RELATIVE
);
}
}
\ No newline at end of file
modules/core/src/dxt.cpp
浏览文件 @
2d71c094
...
...
@@ -1476,6 +1476,111 @@ typedef IppStatus (CV_STDCALL* IppDFTGetSizeFunc)(int, int, IppHintAlgorithm, in
typedef
IppStatus
(
CV_STDCALL
*
IppDFTInitFunc
)(
int
,
int
,
IppHintAlgorithm
,
void
*
,
uchar
*
);
#endif
namespace
cv
{
#if defined USE_IPP_DFT && !defined HAVE_IPP_ICV_ONLY
static
bool
ippi_DFT_C_32F
(
const
Mat
&
src
,
Mat
&
dst
,
bool
inv
,
int
norm_flag
)
{
IppStatus
status
;
Ipp8u
*
pBuffer
=
0
;
Ipp8u
*
pMemInit
=
0
;
int
sizeBuffer
=
0
;
int
sizeSpec
=
0
;
int
sizeInit
=
0
;
IppiSize
srcRoiSize
=
{
src
.
cols
,
src
.
rows
};
status
=
ippiDFTGetSize_C_32fc
(
srcRoiSize
,
norm_flag
,
ippAlgHintNone
,
&
sizeSpec
,
&
sizeInit
,
&
sizeBuffer
);
if
(
status
<
0
)
return
false
;
IppiDFTSpec_C_32fc
*
pDFTSpec
=
(
IppiDFTSpec_C_32fc
*
)
ippMalloc
(
sizeSpec
);
if
(
sizeInit
>
0
)
pMemInit
=
(
Ipp8u
*
)
ippMalloc
(
sizeInit
);
if
(
sizeBuffer
>
0
)
pBuffer
=
(
Ipp8u
*
)
ippMalloc
(
sizeBuffer
);
status
=
ippiDFTInit_C_32fc
(
srcRoiSize
,
norm_flag
,
ippAlgHintNone
,
pDFTSpec
,
pMemInit
);
if
(
sizeInit
>
0
)
ippFree
(
pMemInit
);
if
(
status
<
0
)
{
ippFree
(
pDFTSpec
);
if
(
sizeBuffer
>
0
)
ippFree
(
pBuffer
);
return
false
;
}
if
(
!
inv
)
status
=
ippiDFTFwd_CToC_32fc_C1R
(
(
Ipp32fc
*
)
src
.
data
,
(
int
)
src
.
step
,
(
Ipp32fc
*
)
dst
.
data
,
(
int
)
dst
.
step
,
pDFTSpec
,
pBuffer
);
else
status
=
ippiDFTInv_CToC_32fc_C1R
(
(
Ipp32fc
*
)
src
.
data
,
(
int
)
src
.
step
,
(
Ipp32fc
*
)
dst
.
data
,
(
int
)
dst
.
step
,
pDFTSpec
,
pBuffer
);
if
(
sizeBuffer
>
0
)
ippFree
(
pBuffer
);
ippFree
(
pDFTSpec
);
return
status
>=
0
;
}
static
bool
ippi_DFT_R_32F
(
const
Mat
&
src
,
Mat
&
dst
,
bool
inv
,
int
norm_flag
)
{
IppStatus
status
;
Ipp8u
*
pBuffer
=
0
;
Ipp8u
*
pMemInit
=
0
;
int
sizeBuffer
=
0
;
int
sizeSpec
=
0
;
int
sizeInit
=
0
;
IppiSize
srcRoiSize
=
{
src
.
cols
,
src
.
rows
};
status
=
ippiDFTGetSize_R_32f
(
srcRoiSize
,
norm_flag
,
ippAlgHintNone
,
&
sizeSpec
,
&
sizeInit
,
&
sizeBuffer
);
if
(
status
<
0
)
return
false
;
IppiDFTSpec_R_32f
*
pDFTSpec
=
(
IppiDFTSpec_R_32f
*
)
ippMalloc
(
sizeSpec
);
if
(
sizeInit
>
0
)
pMemInit
=
(
Ipp8u
*
)
ippMalloc
(
sizeInit
);
if
(
sizeBuffer
>
0
)
pBuffer
=
(
Ipp8u
*
)
ippMalloc
(
sizeBuffer
);
status
=
ippiDFTInit_R_32f
(
srcRoiSize
,
norm_flag
,
ippAlgHintNone
,
pDFTSpec
,
pMemInit
);
if
(
sizeInit
>
0
)
ippFree
(
pMemInit
);
if
(
status
<
0
)
{
ippFree
(
pDFTSpec
);
if
(
sizeBuffer
>
0
)
ippFree
(
pBuffer
);
return
false
;
}
if
(
!
inv
)
status
=
ippiDFTFwd_RToPack_32f_C1R
(
(
float
*
)
src
.
data
,
(
int
)(
src
.
step
),
(
float
*
)(
dst
.
data
),
(
int
)
dst
.
step
,
pDFTSpec
,
pBuffer
);
else
status
=
ippiDFTInv_PackToR_32f_C1R
(
(
float
*
)
src
.
data
,
(
int
)
src
.
step
,
(
float
*
)
dst
.
data
,
(
int
)
dst
.
step
,
pDFTSpec
,
pBuffer
);
if
(
sizeBuffer
>
0
)
ippFree
(
pBuffer
);
ippFree
(
pDFTSpec
);
return
status
>=
0
;
}
#endif
}
#ifdef HAVE_CLAMDFFT
namespace
cv
{
...
...
@@ -1769,6 +1874,23 @@ void cv::dft( InputArray _src0, OutputArray _dst, int flags, int nonzero_rows )
Mat
dst
=
_dst
.
getMat
();
#if defined USE_IPP_DFT && !defined HAVE_IPP_ICV_ONLY
if
((
src
.
depth
()
==
CV_32F
)
&&
(
flags
&
DFT_ROWS
)
==
0
&&
(
src
.
total
()
>
(
int
)(
1
<<
6
)))
if
(
!
real_transform
)
{
if
(
ippi_DFT_C_32F
(
src
,
dst
,
inv
,
ipp_norm_flag
))
return
;
setIppErrorStatus
();
}
else
if
(
inv
||
!
(
flags
&
DFT_COMPLEX_OUTPUT
))
{
if
(
ippi_DFT_R_32F
(
src
,
dst
,
inv
,
ipp_norm_flag
))
return
;
setIppErrorStatus
();
}
#endif
if
(
!
real_transform
)
elem_size
=
complex_elem_size
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录