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
526defab
Commit
526defab
authored
9 years ago
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4048 from vpisarev:hal_fixes
parents
8e392251
f32f0486
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
106 additions
and
13 deletions
+106
-13
base.hpp
modules/core/include/opencv2/core/base.hpp
+19
-10
matx.hpp
modules/core/include/opencv2/core/matx.hpp
+1
-1
operations.hpp
modules/core/include/opencv2/core/operations.hpp
+2
-2
lapack.cpp
modules/core/src/lapack.cpp
+20
-0
mathfuncs.cpp
modules/hal/src/mathfuncs.cpp
+64
-0
No files found.
modules/core/include/opencv2/core/base.hpp
View file @
526defab
...
...
@@ -492,11 +492,9 @@ _AccTp normL2Sqr(const _Tp* a, const _Tp* b, int n)
return
s
;
}
inline
float
normL2Sqr
(
const
float
*
a
,
const
float
*
b
,
int
n
)
static
inline
float
normL2Sqr
(
const
float
*
a
,
const
float
*
b
,
int
n
)
{
if
(
n
>=
8
)
return
hal
::
normL2Sqr_
(
a
,
b
,
n
);
float
s
=
0
;
float
s
=
0.
f
;
for
(
int
i
=
0
;
i
<
n
;
i
++
)
{
float
v
=
a
[
i
]
-
b
[
i
];
...
...
@@ -527,20 +525,22 @@ _AccTp normL1(const _Tp* a, const _Tp* b, int n)
inline
float
normL1
(
const
float
*
a
,
const
float
*
b
,
int
n
)
{
if
(
n
>=
8
)
return
hal
::
normL1_
(
a
,
b
,
n
);
float
s
=
0
;
float
s
=
0.
f
;
for
(
int
i
=
0
;
i
<
n
;
i
++
)
{
float
v
=
a
[
i
]
-
b
[
i
];
s
+=
std
::
abs
(
v
);
s
+=
std
::
abs
(
a
[
i
]
-
b
[
i
]);
}
return
s
;
}
inline
int
normL1
(
const
uchar
*
a
,
const
uchar
*
b
,
int
n
)
{
return
hal
::
normL1_
(
a
,
b
,
n
);
int
s
=
0
;
for
(
int
i
=
0
;
i
<
n
;
i
++
)
{
s
+=
std
::
abs
(
a
[
i
]
-
b
[
i
]);
}
return
s
;
}
template
<
typename
_Tp
,
typename
_AccTp
>
static
inline
...
...
@@ -573,6 +573,15 @@ CV_EXPORTS_W float cubeRoot(float val);
*/
CV_EXPORTS_W
float
fastAtan2
(
float
y
,
float
x
);
/** proxy for hal::LU */
CV_EXPORTS
int
LU
(
float
*
A
,
size_t
astep
,
int
m
,
float
*
b
,
size_t
bstep
,
int
n
);
/** proxy for hal::LU */
CV_EXPORTS
int
LU
(
double
*
A
,
size_t
astep
,
int
m
,
double
*
b
,
size_t
bstep
,
int
n
);
/** proxy for hal::Cholesky */
CV_EXPORTS
bool
Cholesky
(
float
*
A
,
size_t
astep
,
int
m
,
float
*
b
,
size_t
bstep
,
int
n
);
/** proxy for hal::Cholesky */
CV_EXPORTS
bool
Cholesky
(
double
*
A
,
size_t
astep
,
int
m
,
double
*
b
,
size_t
bstep
,
int
n
);
////////////////// forward declarations for important OpenCV types //////////////////
//! @cond IGNORED
...
...
This diff is collapsed.
Click to expand it.
modules/core/include/opencv2/core/matx.hpp
View file @
526defab
...
...
@@ -427,7 +427,7 @@ template<typename _Tp, int m> struct Matx_DetOp
double
operator
()(
const
Matx
<
_Tp
,
m
,
m
>&
a
)
const
{
Matx
<
_Tp
,
m
,
m
>
temp
=
a
;
double
p
=
hal
::
LU
(
temp
.
val
,
m
*
sizeof
(
_Tp
),
m
,
0
,
0
,
0
);
double
p
=
LU
(
temp
.
val
,
m
*
sizeof
(
_Tp
),
m
,
0
,
0
,
0
);
if
(
p
==
0
)
return
p
;
for
(
int
i
=
0
;
i
<
m
;
i
++
)
...
...
This diff is collapsed.
Click to expand it.
modules/core/include/opencv2/core/operations.hpp
View file @
526defab
...
...
@@ -72,9 +72,9 @@ template<typename _Tp, int m> struct Matx_FastInvOp
b
(
i
,
i
)
=
(
_Tp
)
1
;
if
(
method
==
DECOMP_CHOLESKY
)
return
hal
::
Cholesky
(
temp
.
val
,
m
*
sizeof
(
_Tp
),
m
,
b
.
val
,
m
*
sizeof
(
_Tp
),
m
);
return
Cholesky
(
temp
.
val
,
m
*
sizeof
(
_Tp
),
m
,
b
.
val
,
m
*
sizeof
(
_Tp
),
m
);
return
hal
::
LU
(
temp
.
val
,
m
*
sizeof
(
_Tp
),
m
,
b
.
val
,
m
*
sizeof
(
_Tp
),
m
)
!=
0
;
return
LU
(
temp
.
val
,
m
*
sizeof
(
_Tp
),
m
,
b
.
val
,
m
*
sizeof
(
_Tp
),
m
)
!=
0
;
}
};
...
...
This diff is collapsed.
Click to expand it.
modules/core/src/lapack.cpp
View file @
526defab
...
...
@@ -50,6 +50,26 @@
namespace
cv
{
int
LU
(
float
*
A
,
size_t
astep
,
int
m
,
float
*
b
,
size_t
bstep
,
int
n
)
{
return
hal
::
LU
(
A
,
astep
,
m
,
b
,
bstep
,
n
);
}
int
LU
(
double
*
A
,
size_t
astep
,
int
m
,
double
*
b
,
size_t
bstep
,
int
n
)
{
return
hal
::
LU
(
A
,
astep
,
m
,
b
,
bstep
,
n
);
}
bool
Cholesky
(
float
*
A
,
size_t
astep
,
int
m
,
float
*
b
,
size_t
bstep
,
int
n
)
{
return
hal
::
Cholesky
(
A
,
astep
,
m
,
b
,
bstep
,
n
);
}
bool
Cholesky
(
double
*
A
,
size_t
astep
,
int
m
,
double
*
b
,
size_t
bstep
,
int
n
)
{
return
hal
::
Cholesky
(
A
,
astep
,
m
,
b
,
bstep
,
n
);
}
template
<
typename
_Tp
>
static
inline
_Tp
hypot
(
_Tp
a
,
_Tp
b
)
{
a
=
std
::
abs
(
a
);
...
...
This diff is collapsed.
Click to expand it.
modules/hal/src/mathfuncs.cpp
View file @
526defab
...
...
@@ -42,6 +42,8 @@
#include "precomp.hpp"
#undef HAVE_IPP
namespace
cv
{
namespace
hal
{
///////////////////////////////////// ATAN2 ////////////////////////////////////
...
...
@@ -160,6 +162,19 @@ void fastAtan2(const float *Y, const float *X, float *angle, int len, bool angle
void
magnitude
(
const
float
*
x
,
const
float
*
y
,
float
*
mag
,
int
len
)
{
#if defined HAVE_IPP
CV_IPP_CHECK
()
{
IppStatus
status
=
ippsMagnitude_32f
(
x
,
y
,
mag
,
len
);
if
(
status
>=
0
)
{
CV_IMPL_ADD
(
CV_IMPL_IPP
);
return
;
}
setIppErrorStatus
();
}
#endif
int
i
=
0
;
#if CV_SIMD128
...
...
@@ -183,6 +198,19 @@ void magnitude(const float* x, const float* y, float* mag, int len)
void
magnitude
(
const
double
*
x
,
const
double
*
y
,
double
*
mag
,
int
len
)
{
#if defined(HAVE_IPP)
CV_IPP_CHECK
()
{
IppStatus
status
=
ippsMagnitude_64f
(
x
,
y
,
mag
,
len
);
if
(
status
>=
0
)
{
CV_IMPL_ADD
(
CV_IMPL_IPP
);
return
;
}
setIppErrorStatus
();
}
#endif
int
i
=
0
;
#if CV_SIMD128_64F
...
...
@@ -207,6 +235,18 @@ void magnitude(const double* x, const double* y, double* mag, int len)
void
invSqrt
(
const
float
*
src
,
float
*
dst
,
int
len
)
{
#if defined(HAVE_IPP)
CV_IPP_CHECK
()
{
if
(
ippsInvSqrt_32f_A21
(
src
,
dst
,
len
)
>=
0
)
{
CV_IMPL_ADD
(
CV_IMPL_IPP
);
return
;
}
setIppErrorStatus
();
}
#endif
int
i
=
0
;
#if CV_SIMD128
...
...
@@ -241,6 +281,18 @@ void invSqrt(const double* src, double* dst, int len)
void
sqrt
(
const
float
*
src
,
float
*
dst
,
int
len
)
{
#if defined(HAVE_IPP)
CV_IPP_CHECK
()
{
if
(
ippsSqrt_32f_A21
(
src
,
dst
,
len
)
>=
0
)
{
CV_IMPL_ADD
(
CV_IMPL_IPP
);
return
;
}
setIppErrorStatus
();
}
#endif
int
i
=
0
;
#if CV_SIMD128
...
...
@@ -260,6 +312,18 @@ void sqrt(const float* src, float* dst, int len)
void
sqrt
(
const
double
*
src
,
double
*
dst
,
int
len
)
{
#if defined(HAVE_IPP)
CV_IPP_CHECK
()
{
if
(
ippsSqrt_64f_A50
(
src
,
dst
,
len
)
>=
0
)
{
CV_IMPL_ADD
(
CV_IMPL_IPP
);
return
;
}
setIppErrorStatus
();
}
#endif
int
i
=
0
;
#if CV_SIMD128_64F
...
...
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