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
5d3a128c
Commit
5d3a128c
authored
Aug 31, 2014
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NEON impl on cv::convertScaleAba CV_32f
parent
4d474d40
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
10 deletions
+39
-10
CMakeLists.txt
CMakeLists.txt
+1
-1
convert.cpp
modules/core/src/convert.cpp
+38
-9
No files found.
CMakeLists.txt
View file @
5d3a128c
...
...
@@ -130,7 +130,7 @@ OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON
OCV_OPTION
(
WITH_GSTREAMER_0_10
"Enable Gstreamer 0.10 support (instead of 1.x)"
OFF
)
OCV_OPTION
(
WITH_GTK
"Include GTK support"
ON
IF
(
UNIX AND NOT APPLE AND NOT ANDROID
)
)
OCV_OPTION
(
WITH_GTK_2_X
"Use GTK version 2"
OFF
IF
(
UNIX AND NOT APPLE AND NOT ANDROID
)
)
OCV_OPTION
(
WITH_IPP
"Include Intel IPP support"
ON
IF
(
NOT IOS
)
)
OCV_OPTION
(
WITH_IPP
"Include Intel IPP support"
ON
IF
(
X86_64 OR X86
)
)
OCV_OPTION
(
WITH_JASPER
"Include JPEG2K support"
ON
IF
(
NOT IOS
)
)
OCV_OPTION
(
WITH_JPEG
"Include JPEG support"
ON
)
OCV_OPTION
(
WITH_WEBP
"Include WebP support"
ON
IF
(
NOT IOS
)
)
...
...
modules/core/src/convert.cpp
View file @
5d3a128c
...
...
@@ -173,7 +173,7 @@ split_( const T* src, T** dst, int len, int cn )
int
inc_j
=
3
*
inc_i
;
VSplit3
<
T
>
vsplit
;
for
(
;
i
<
len
-
inc_i
;
i
+=
inc_i
,
j
+=
inc_j
)
for
(
;
i
<
=
len
-
inc_i
;
i
+=
inc_i
,
j
+=
inc_j
)
vsplit
(
src
+
j
,
dst0
+
i
,
dst1
+
i
,
dst2
+
i
);
}
#endif
...
...
@@ -196,7 +196,7 @@ split_( const T* src, T** dst, int len, int cn )
int
inc_j
=
4
*
inc_i
;
VSplit4
<
T
>
vsplit
;
for
(
;
i
<
len
-
inc_i
;
i
+=
inc_i
,
j
+=
inc_j
)
for
(
;
i
<
=
len
-
inc_i
;
i
+=
inc_i
,
j
+=
inc_j
)
vsplit
(
src
+
j
,
dst0
+
i
,
dst1
+
i
,
dst2
+
i
,
dst3
+
i
);
}
#endif
...
...
@@ -1076,7 +1076,7 @@ namespace cv
{
template
<
typename
T
,
typename
DT
,
typename
WT
>
struct
cvtScaleAbs_S
SE2
struct
cvtScaleAbs_S
IMD
{
int
operator
()
(
const
T
*
,
DT
*
,
int
,
WT
,
WT
)
const
{
...
...
@@ -1087,7 +1087,7 @@ struct cvtScaleAbs_SSE2
#if CV_SSE2
template
<>
struct
cvtScaleAbs_S
SE2
<
uchar
,
uchar
,
float
>
struct
cvtScaleAbs_S
IMD
<
uchar
,
uchar
,
float
>
{
int
operator
()
(
const
uchar
*
src
,
uchar
*
dst
,
int
width
,
float
scale
,
float
shift
)
const
...
...
@@ -1124,7 +1124,7 @@ struct cvtScaleAbs_SSE2<uchar, uchar, float>
};
template
<>
struct
cvtScaleAbs_S
SE2
<
ushort
,
uchar
,
float
>
struct
cvtScaleAbs_S
IMD
<
ushort
,
uchar
,
float
>
{
int
operator
()
(
const
ushort
*
src
,
uchar
*
dst
,
int
width
,
float
scale
,
float
shift
)
const
...
...
@@ -1155,7 +1155,7 @@ struct cvtScaleAbs_SSE2<ushort, uchar, float>
};
template
<>
struct
cvtScaleAbs_S
SE2
<
short
,
uchar
,
float
>
struct
cvtScaleAbs_S
IMD
<
short
,
uchar
,
float
>
{
int
operator
()
(
const
short
*
src
,
uchar
*
dst
,
int
width
,
float
scale
,
float
shift
)
const
...
...
@@ -1186,7 +1186,7 @@ struct cvtScaleAbs_SSE2<short, uchar, float>
};
template
<>
struct
cvtScaleAbs_S
SE2
<
int
,
uchar
,
float
>
struct
cvtScaleAbs_S
IMD
<
int
,
uchar
,
float
>
{
int
operator
()
(
const
int
*
src
,
uchar
*
dst
,
int
width
,
float
scale
,
float
shift
)
const
...
...
@@ -1215,7 +1215,7 @@ struct cvtScaleAbs_SSE2<int, uchar, float>
};
template
<>
struct
cvtScaleAbs_S
SE2
<
float
,
uchar
,
float
>
struct
cvtScaleAbs_S
IMD
<
float
,
uchar
,
float
>
{
int
operator
()
(
const
float
*
src
,
uchar
*
dst
,
int
width
,
float
scale
,
float
shift
)
const
...
...
@@ -1242,6 +1242,35 @@ struct cvtScaleAbs_SSE2<float, uchar, float>
}
};
#elif CV_NEON
template
<>
struct
cvtScaleAbs_SIMD
<
float
,
uchar
,
float
>
{
int
operator
()
(
const
float
*
src
,
uchar
*
dst
,
int
width
,
float
scale
,
float
shift
)
const
{
int
x
=
0
;
float32x4_t
v_shift
=
vdupq_n_f32
(
shift
);
for
(
;
x
<=
width
-
8
;
x
+=
8
)
{
float32x4_t
v_dst_0
=
vmulq_n_f32
(
vld1q_f32
(
src
+
x
),
scale
);
v_dst_0
=
vabsq_f32
(
vaddq_f32
(
v_dst_0
,
v_shift
));
uint16x4_t
v_dsti_0
=
vqmovun_s32
(
vcvtq_s32_f32
(
v_dst_0
));
float32x4_t
v_dst_1
=
vmulq_n_f32
(
vld1q_f32
(
src
+
x
+
4
),
scale
);
v_dst_1
=
vabsq_f32
(
vaddq_f32
(
v_dst_1
,
v_shift
));
uint16x4_t
v_dsti_1
=
vqmovun_s32
(
vcvtq_s32_f32
(
v_dst_1
));
uint16x8_t
v_dst
=
vcombine_u16
(
v_dsti_0
,
v_dsti_1
);
vst1_u8
(
dst
+
x
,
vqmovn_u16
(
v_dst
));
}
return
x
;
}
};
#endif
template
<
typename
T
,
typename
DT
,
typename
WT
>
static
void
...
...
@@ -1251,7 +1280,7 @@ cvtScaleAbs_( const T* src, size_t sstep,
{
sstep
/=
sizeof
(
src
[
0
]);
dstep
/=
sizeof
(
dst
[
0
]);
cvtScaleAbs_S
SE2
<
T
,
DT
,
WT
>
vop
;
cvtScaleAbs_S
IMD
<
T
,
DT
,
WT
>
vop
;
for
(
;
size
.
height
--
;
src
+=
sstep
,
dst
+=
dstep
)
{
...
...
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