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
971a7c88
Commit
971a7c88
authored
Oct 19, 2016
by
Tomoaki Teshima
Committed by
Tomoaki Teshima
Oct 20, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
let the performance test pass on ARM
* use round-to-neaerest in div of carotene
parent
8213e57f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
div.cpp
3rdparty/carotene/src/div.cpp
+9
-2
No files found.
3rdparty/carotene/src/div.cpp
View file @
971a7c88
...
...
@@ -51,6 +51,13 @@ namespace {
#ifdef CAROTENE_NEON
inline
float32x4_t
vroundq
(
const
float32x4_t
&
v
)
{
const
int32x4_t
signMask
=
vdupq_n_s32
(
1
<<
31
),
half
=
vreinterpretq_s32_f32
(
vdupq_n_f32
(
0.5
f
));
float32x4_t
v_addition
=
vreinterpretq_f32_s32
(
vorrq_s32
(
half
,
vandq_s32
(
signMask
,
vreinterpretq_s32_f32
(
v
))));
return
vaddq_f32
(
v
,
v_addition
);
}
template
<
typename
T
>
inline
T
divSaturateQ
(
const
T
&
v1
,
const
T
&
v2
,
const
float
scale
)
{
...
...
@@ -62,10 +69,10 @@ inline T divSaturateQ(const T &v1, const T &v2, const float scale)
}
template
<>
inline
int32x4_t
divSaturateQ
<
int32x4_t
>
(
const
int32x4_t
&
v1
,
const
int32x4_t
&
v2
,
const
float
scale
)
{
return
vcvtq_s32_f32
(
v
mulq_f32
(
vmulq_n_f32
(
vcvtq_f32_s32
(
v1
),
scale
),
internal
::
vrecpq_f32
(
vcvtq_f32_s32
(
v2
))));
}
{
return
vcvtq_s32_f32
(
v
roundq
(
vmulq_f32
(
vmulq_n_f32
(
vcvtq_f32_s32
(
v1
),
scale
),
internal
::
vrecpq_f32
(
vcvtq_f32_s32
(
v2
)
))));
}
template
<>
inline
uint32x4_t
divSaturateQ
<
uint32x4_t
>
(
const
uint32x4_t
&
v1
,
const
uint32x4_t
&
v2
,
const
float
scale
)
{
return
vcvtq_u32_f32
(
v
mulq_f32
(
vmulq_n_f32
(
vcvtq_f32_u32
(
v1
),
scale
),
internal
::
vrecpq_f32
(
vcvtq_f32_u32
(
v2
))));
}
{
return
vcvtq_u32_f32
(
v
roundq
(
vmulq_f32
(
vmulq_n_f32
(
vcvtq_f32_u32
(
v1
),
scale
),
internal
::
vrecpq_f32
(
vcvtq_f32_u32
(
v2
)
))));
}
template
<
typename
T
>
inline
T
divSaturate
(
const
T
&
v1
,
const
T
&
v2
,
const
float
scale
)
...
...
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