Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
f40d7014
Commit
f40d7014
authored
9 years ago
by
Maksim Shabunin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DFT: renamed HAL functions
parent
15783cf6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
55 deletions
+55
-55
hal.hpp
modules/core/include/opencv2/core/hal/hal.hpp
+7
-7
dxt.cpp
modules/core/src/dxt.cpp
+31
-31
hal_replacement.hpp
modules/core/src/hal_replacement.hpp
+14
-14
templmatch.cpp
modules/imgproc/src/templmatch.cpp
+3
-3
No files found.
modules/core/include/opencv2/core/hal/hal.hpp
View file @
f40d7014
...
...
@@ -195,16 +195,16 @@ struct DftContext
};
CV_EXPORTS
void
dftInit2D
(
DftContext
&
c
,
int
_width
,
int
_height
,
int
_depth
,
int
_src_channels
,
int
_dst_channels
,
int
flags
,
int
_nonzero_rows
=
0
);
CV_EXPORTS
void
dft
Run
2D
(
const
DftContext
&
c
,
const
void
*
src
,
int
src_step
,
void
*
dst
,
int
dst_step
);
CV_EXPORTS
void
dft2D
(
const
DftContext
&
c
,
const
void
*
src
,
int
src_step
,
void
*
dst
,
int
dst_step
);
CV_EXPORTS
void
dftFree2D
(
DftContext
&
c
);
CV_EXPORTS
void
dftInit
(
DftContext
&
c
,
int
len
,
int
count
,
int
depth
,
int
flags
,
bool
*
useBuffer
=
0
);
CV_EXPORTS
void
dft
Run
(
const
DftContext
&
c
,
const
void
*
src
,
void
*
dst
);
CV_EXPORTS
void
dftFree
(
DftContext
&
c
);
CV_EXPORTS
void
dftInit
1D
(
DftContext
&
c
,
int
len
,
int
count
,
int
depth
,
int
flags
,
bool
*
useBuffer
=
0
);
CV_EXPORTS
void
dft
1D
(
const
DftContext
&
c
,
const
void
*
src
,
void
*
dst
);
CV_EXPORTS
void
dftFree
1D
(
DftContext
&
c
);
CV_EXPORTS
void
dctInit
(
DftContext
&
c
,
int
width
,
int
height
,
int
depth
,
int
flags
);
CV_EXPORTS
void
dct
Run
(
const
DftContext
&
c
,
const
void
*
src
,
int
src_step
,
void
*
dst
,
int
dst_step
);
CV_EXPORTS
void
dctFree
(
DftContext
&
c
);
CV_EXPORTS
void
dctInit
2D
(
DftContext
&
c
,
int
width
,
int
height
,
int
depth
,
int
flags
);
CV_EXPORTS
void
dct
2D
(
const
DftContext
&
c
,
const
void
*
src
,
int
src_step
,
void
*
dst
,
int
dst_step
);
CV_EXPORTS
void
dctFree
2D
(
DftContext
&
c
);
//! @} core_hal
...
...
This diff is collapsed.
Click to expand it.
modules/core/src/dxt.cpp
View file @
f40d7014
...
...
@@ -2763,7 +2763,7 @@ public:
count
=
height
;
}
needBufferA
=
isInplace
;
hal
::
dftInit
(
contextA
,
len
,
count
,
depth
,
f
,
&
needBufferA
);
hal
::
dftInit
1D
(
contextA
,
len
,
count
,
depth
,
f
,
&
needBufferA
);
if
(
needBufferA
)
tmp_bufA
.
allocate
(
len
*
complex_elem_size
);
}
...
...
@@ -2773,7 +2773,7 @@ public:
count
=
width
;
f
|=
CV_HAL_DFT_STAGE_COLS
;
needBufferB
=
isInplace
;
hal
::
dftInit
(
contextB
,
len
,
count
,
depth
,
f
,
&
needBufferB
);
hal
::
dftInit
1D
(
contextB
,
len
,
count
,
depth
,
f
,
&
needBufferB
);
if
(
needBufferB
)
tmp_bufB
.
allocate
(
len
*
complex_elem_size
);
...
...
@@ -2864,8 +2864,8 @@ public:
{
if
(
useIpp
)
return
;
hal
::
dftFree
(
contextA
);
hal
::
dftFree
(
contextB
);
hal
::
dftFree
1D
(
contextA
);
hal
::
dftFree
1D
(
contextB
);
}
protected
:
...
...
@@ -2909,7 +2909,7 @@ protected:
if
(
needBufferA
)
dptr
=
tmp_bufA
;
hal
::
dft
Run
(
contextA
,
sptr
,
dptr
);
hal
::
dft
1D
(
contextA
,
sptr
,
dptr
);
if
(
needBufferA
)
memcpy
(
dptr0
,
dptr
+
dptr_offset
,
dst_full_len
);
...
...
@@ -2983,8 +2983,8 @@ protected:
}
if
(
even
)
hal
::
dft
Run
(
contextB
,
buf1
,
dbuf1
);
hal
::
dft
Run
(
contextB
,
buf0
,
dbuf0
);
hal
::
dft
1D
(
contextB
,
buf1
,
dbuf1
);
hal
::
dft
1D
(
contextB
,
buf0
,
dbuf0
);
if
(
stage_dst_channels
==
1
)
{
...
...
@@ -3032,12 +3032,12 @@ protected:
if
(
i
+
1
<
b
)
{
CopyFrom2Columns
(
sptr0
,
src_step
,
buf0
,
buf1
,
len
,
complex_elem_size
);
hal
::
dft
Run
(
contextB
,
buf1
,
dbuf1
);
hal
::
dft
1D
(
contextB
,
buf1
,
dbuf1
);
}
else
CopyColumn
(
sptr0
,
src_step
,
buf0
,
complex_elem_size
,
len
,
complex_elem_size
);
hal
::
dft
Run
(
contextB
,
buf0
,
dbuf0
);
hal
::
dft
1D
(
contextB
,
buf0
,
dbuf0
);
if
(
i
+
1
<
b
)
CopyTo2Columns
(
dbuf0
,
dbuf1
,
dptr0
,
dst_step
,
len
,
complex_elem_size
);
...
...
@@ -3223,9 +3223,9 @@ namespace hal {
//================== 1D ======================
void
dftInit
(
DftContext
&
context
,
int
len
,
int
count
,
int
depth
,
int
flags
,
bool
*
needBuffer
)
void
dftInit
1D
(
DftContext
&
context
,
int
len
,
int
count
,
int
depth
,
int
flags
,
bool
*
needBuffer
)
{
int
res
=
cv_hal_dftInit
(
&
context
.
impl
,
len
,
count
,
depth
,
flags
,
needBuffer
);
int
res
=
cv_hal_dftInit
1D
(
&
context
.
impl
,
len
,
count
,
depth
,
flags
,
needBuffer
);
if
(
res
==
CV_HAL_ERROR_OK
)
{
context
.
useReplacement
=
true
;
...
...
@@ -3242,11 +3242,11 @@ void dftInit(DftContext & context, int len, int count, int depth, int flags, boo
c
->
init
(
len
,
count
,
depth
,
flags
,
needBuffer
);
}
void
dft
Run
(
const
DftContext
&
context
,
const
void
*
src
,
void
*
dst
)
void
dft
1D
(
const
DftContext
&
context
,
const
void
*
src
,
void
*
dst
)
{
if
(
context
.
useReplacement
)
{
int
res
=
cv_hal_dft
Run
(
context
.
impl
,
src
,
dst
);
int
res
=
cv_hal_dft
1D
(
context
.
impl
,
src
,
dst
);
if
(
res
!=
CV_HAL_ERROR_OK
)
{
CV_Error
(
CV_StsNotImplemented
,
"Custom HAL implementation failed to call dftRun"
);
...
...
@@ -3257,11 +3257,11 @@ void dftRun(const DftContext & context, const void * src, void * dst)
c
->
run
(
src
,
dst
);
}
void
dftFree
(
DftContext
&
context
)
void
dftFree
1D
(
DftContext
&
context
)
{
if
(
context
.
useReplacement
)
{
int
res
=
cv_hal_dftFree
(
context
.
impl
);
int
res
=
cv_hal_dftFree
1D
(
context
.
impl
);
if
(
res
!=
CV_HAL_ERROR_OK
)
{
CV_Error
(
CV_StsNotImplemented
,
"Custom HAL implementation failed to call dftFree"
);
...
...
@@ -3282,9 +3282,9 @@ void dftFree(DftContext & context)
//================== 2D ======================
void
dftInit2D
(
DftContext
&
c
,
int
_width
,
int
_height
,
int
_depth
,
int
_src_channels
,
int
_dst_channels
,
int
flags
,
int
_nonzero_rows
)
int
_width
,
int
_height
,
int
_depth
,
int
_src_channels
,
int
_dst_channels
,
int
flags
,
int
_nonzero_rows
)
{
int
res
=
cv_hal_dftInit2D
(
&
c
.
impl
,
_width
,
_height
,
_depth
,
_src_channels
,
_dst_channels
,
flags
,
_nonzero_rows
);
if
(
res
==
CV_HAL_ERROR_OK
)
...
...
@@ -3304,12 +3304,12 @@ void dftInit2D(DftContext & c,
c
.
impl
=
(
void
*
)
d
;
}
void
dft
Run
2D
(
const
DftContext
&
c
,
const
void
*
src
,
int
src_step
,
void
*
dst
,
int
dst_step
)
void
dft2D
(
const
DftContext
&
c
,
const
void
*
src
,
int
src_step
,
void
*
dst
,
int
dst_step
)
{
if
(
c
.
useReplacement
)
{
int
res
=
cv_hal_dft
Run
2D
(
c
.
impl
,
(
uchar
*
)
src
,
src_step
,
(
uchar
*
)
dst
,
dst_step
);
int
res
=
cv_hal_dft2D
(
c
.
impl
,
(
uchar
*
)
src
,
src_step
,
(
uchar
*
)
dst
,
dst_step
);
if
(
res
!=
CV_HAL_ERROR_OK
)
{
CV_Error
(
CV_StsNotImplemented
,
"Custom HAL implementation failed to call dftRun2D"
);
...
...
@@ -3384,7 +3384,7 @@ void cv::dft( InputArray _src0, OutputArray _dst, int flags, int nonzero_rows )
f
|=
CV_HAL_DFT_IS_INPLACE
;
hal
::
DftContext
c
;
hal
::
dftInit2D
(
c
,
src
.
cols
,
src
.
rows
,
depth
,
src
.
channels
(),
dst
.
channels
(),
f
,
nonzero_rows
);
hal
::
dft
Run
2D
(
c
,
src
.
data
,
(
int
)
src
.
step
,
dst
.
data
,
(
int
)
dst
.
step
);
hal
::
dft2D
(
c
,
src
.
data
,
(
int
)
src
.
step
,
dst
.
data
,
(
int
)
dst
.
step
);
hal
::
dftFree2D
(
c
);
}
...
...
@@ -4198,9 +4198,9 @@ public:
namespace
hal
{
void
dctInit
(
DftContext
&
c
,
int
width
,
int
height
,
int
depth
,
int
flags
)
void
dctInit
2D
(
DftContext
&
c
,
int
width
,
int
height
,
int
depth
,
int
flags
)
{
int
res
=
cv_hal_dctInit
(
&
c
.
impl
,
width
,
height
,
depth
,
flags
);
int
res
=
cv_hal_dctInit
2D
(
&
c
.
impl
,
width
,
height
,
depth
,
flags
);
if
(
res
==
CV_HAL_ERROR_OK
)
{
c
.
useReplacement
=
true
;
...
...
@@ -4212,11 +4212,11 @@ void dctInit(DftContext & c, int width, int height, int depth, int flags)
c
.
impl
=
impl
;
}
void
dct
Run
(
const
DftContext
&
c
,
const
void
*
src
,
int
src_step
,
void
*
dst
,
int
dst_step
)
void
dct
2D
(
const
DftContext
&
c
,
const
void
*
src
,
int
src_step
,
void
*
dst
,
int
dst_step
)
{
if
(
c
.
useReplacement
)
{
int
res
=
cv_hal_dct
Run
(
c
.
impl
,
src
,
src_step
,
dst
,
dst_step
);
int
res
=
cv_hal_dct
2D
(
c
.
impl
,
src
,
src_step
,
dst
,
dst_step
);
if
(
res
!=
CV_HAL_ERROR_OK
)
{
CV_Error
(
CV_StsNotImplemented
,
"Custom HAL implementation failed to call dctRun"
);
...
...
@@ -4227,11 +4227,11 @@ void dctRun(const DftContext & c, const void * src, int src_step, void * dst, in
impl
->
run
((
uchar
*
)
src
,
src_step
,
(
uchar
*
)
dst
,
dst_step
);
}
void
dctFree
(
DftContext
&
c
)
void
dctFree
2D
(
DftContext
&
c
)
{
if
(
c
.
useReplacement
)
{
int
res
=
cv_hal_dctFree
(
c
.
impl
);
int
res
=
cv_hal_dctFree
2D
(
c
.
impl
);
if
(
res
!=
CV_HAL_ERROR_OK
)
{
CV_Error
(
CV_StsNotImplemented
,
"Custom HAL implementation failed to call dctFree"
);
...
...
@@ -4266,9 +4266,9 @@ void cv::dct( InputArray _src0, OutputArray _dst, int flags )
f
|=
CV_HAL_DFT_IS_CONTINUOUS
;
hal
::
DftContext
c
;
hal
::
dctInit
(
c
,
src
.
cols
,
src
.
rows
,
depth
,
f
);
hal
::
dct
Run
(
c
,
(
void
*
)
src
.
data
,
(
int
)
src
.
step
,
(
void
*
)
dst
.
data
,
(
int
)
dst
.
step
);
hal
::
dctFree
(
c
);
hal
::
dctInit
2D
(
c
,
src
.
cols
,
src
.
rows
,
depth
,
f
);
hal
::
dct
2D
(
c
,
(
void
*
)
src
.
data
,
(
int
)
src
.
step
,
(
void
*
)
dst
.
data
,
(
int
)
dst
.
step
);
hal
::
dctFree
2D
(
c
);
}
...
...
This diff is collapsed.
Click to expand it.
modules/core/src/hal_replacement.hpp
View file @
f40d7014
...
...
@@ -384,30 +384,30 @@ inline int hal_ni_merge64s(const int64 **src_data, int64 *dst_data, int len, int
# pragma warning( pop )
#endif
inline
int
hal_ni_dftInit
(
void
**
,
int
,
int
,
int
,
int
,
bool
*
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dft
Run
(
const
void
*
,
const
void
*
,
void
*
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dftFree
(
void
*
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dftInit
1D
(
void
**
,
int
,
int
,
int
,
int
,
bool
*
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dft
1D
(
const
void
*
,
const
void
*
,
void
*
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dftFree
1D
(
void
*
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
#define cv_hal_dftInit
hal_ni_dftInit
#define cv_hal_dft
Run hal_ni_dftRun
#define cv_hal_dftFree
hal_ni_dftFree
#define cv_hal_dftInit
1D hal_ni_dftInit1D
#define cv_hal_dft
1D hal_ni_dft1D
#define cv_hal_dftFree
1D hal_ni_dftFree1D
inline
int
hal_ni_dftInit2D
(
void
**
,
int
,
int
,
int
,
int
,
int
,
int
,
int
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dft
Run
2D
(
const
void
*
,
const
void
*
,
int
,
void
*
,
int
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dft2D
(
const
void
*
,
const
void
*
,
int
,
void
*
,
int
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dftFree2D
(
void
*
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
#define cv_hal_dftInit2D hal_ni_dftInit2D
#define cv_hal_dft
Run2D hal_ni_dftRun
2D
#define cv_hal_dft
2D hal_ni_dft
2D
#define cv_hal_dftFree2D hal_ni_dftFree2D
inline
int
hal_ni_dctInit
(
void
**
,
int
,
int
,
int
,
int
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dct
Run
(
const
void
*
,
const
void
*
,
int
,
void
*
,
int
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dctFree
(
void
*
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dctInit
2D
(
void
**
,
int
,
int
,
int
,
int
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dct
2D
(
const
void
*
,
const
void
*
,
int
,
void
*
,
int
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dctFree
2D
(
void
*
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
#define cv_hal_dctInit
hal_ni_dctInit
#define cv_hal_dct
Run hal_ni_dctRun
#define cv_hal_dctFree
hal_ni_dctFree
#define cv_hal_dctInit
2D hal_ni_dctInit2D
#define cv_hal_dct
2D hal_ni_dct2D
#define cv_hal_dctFree
2D hal_ni_dctFree2D
#include "custom_hal.hpp"
...
...
This diff is collapsed.
Click to expand it.
modules/imgproc/src/templmatch.cpp
View file @
f40d7014
...
...
@@ -726,7 +726,7 @@ void crossCorr( const Mat& img, const Mat& _templ, Mat& corr,
Mat
part
(
dst
,
Range
(
0
,
templ
.
rows
),
Range
(
templ
.
cols
,
dst
.
cols
));
part
=
Scalar
::
all
(
0
);
}
hal
::
dft
Run
2D
(
c
,
dst
.
data
,
(
int
)
dst
.
step
,
dst
.
data
,
(
int
)
dst
.
step
);
hal
::
dft2D
(
c
,
dst
.
data
,
(
int
)
dst
.
step
,
dst
.
data
,
(
int
)
dst
.
step
);
}
hal
::
dftFree2D
(
c
);
...
...
@@ -791,7 +791,7 @@ void crossCorr( const Mat& img, const Mat& _templ, Mat& corr,
x1
-
x0
,
dst
.
cols
-
dst1
.
cols
-
(
x1
-
x0
),
borderType
);
if
(
bsz
.
height
==
blocksize
.
height
)
hal
::
dft
Run
2D
(
cF
,
dftImg
.
data
,
(
int
)
dftImg
.
step
,
dftImg
.
data
,
(
int
)
dftImg
.
step
);
hal
::
dft2D
(
cF
,
dftImg
.
data
,
(
int
)
dftImg
.
step
,
dftImg
.
data
,
(
int
)
dftImg
.
step
);
else
dft
(
dftImg
,
dftImg
,
0
,
dsz
.
height
);
...
...
@@ -800,7 +800,7 @@ void crossCorr( const Mat& img, const Mat& _templ, Mat& corr,
mulSpectrums
(
dftImg
,
dftTempl1
,
dftImg
,
0
,
true
);
if
(
bsz
.
height
==
blocksize
.
height
)
hal
::
dft
Run
2D
(
cR
,
dftImg
.
data
,
(
int
)
dftImg
.
step
,
dftImg
.
data
,
(
int
)
dftImg
.
step
);
hal
::
dft2D
(
cR
,
dftImg
.
data
,
(
int
)
dftImg
.
step
,
dftImg
.
data
,
(
int
)
dftImg
.
step
);
else
dft
(
dftImg
,
dftImg
,
DFT_INVERSE
+
DFT_SCALE
,
bsz
.
height
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment