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
fadf25ac
Commit
fadf25ac
authored
Jul 03, 2017
by
Vitaly Tuzov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SSE4_1 optimized implementation of resize and warp functions migrated to separate file
parent
3681dcef
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
3 deletions
+27
-3
imgwarp.avx2.cpp
modules/imgproc/src/imgwarp.avx2.cpp
+10
-2
imgwarp.cpp
modules/imgproc/src/imgwarp.cpp
+0
-0
imgwarp.hpp
modules/imgproc/src/imgwarp.hpp
+17
-1
imgwarp.sse4_1.cpp
modules/imgproc/src/imgwarp.sse4_1.cpp
+0
-0
No files found.
modules/imgproc/src/imgwarp.avx2.cpp
View file @
fadf25ac
...
...
@@ -83,7 +83,9 @@ public:
uchar
*
Dstart
=
D
;
int
sy
=
std
::
min
(
cvFloor
(
y
*
ify
),
ssize
.
height
-
1
);
const
uchar
*
S
=
src
.
data
+
sy
*
src
.
step
;
#ifdef CV_ICC
#pragma unroll(4)
#endif
for
(
x
=
0
;
x
<
avxWidth
;
x
+=
8
)
{
const
__m256i
CV_DECL_ALIGNED
(
64
)
*
addr
=
(
__m256i
*
)(
x_ofs
+
x
);
...
...
@@ -106,7 +108,9 @@ public:
uchar
*
Dstart
=
D
;
int
sy
=
std
::
min
(
cvFloor
(
y
*
ify
),
ssize
.
height
-
1
);
const
uchar
*
S
=
src
.
data
+
sy
*
src
.
step
;
#ifdef CV_ICC
#pragma unroll(4)
#endif
for
(
x
=
0
;
x
<
avxWidth
;
x
+=
8
)
{
const
__m256i
CV_DECL_ALIGNED
(
64
)
*
addr
=
(
__m256i
*
)(
x_ofs
+
x
);
...
...
@@ -157,8 +161,8 @@ public:
const
__m256i
CV_DECL_ALIGNED
(
64
)
shuffle_mask
=
_mm256_set_epi8
(
15
,
14
,
11
,
10
,
13
,
12
,
9
,
8
,
7
,
6
,
3
,
2
,
5
,
4
,
1
,
0
,
15
,
14
,
11
,
10
,
13
,
12
,
9
,
8
,
7
,
6
,
3
,
2
,
5
,
4
,
1
,
0
);
const
__m256i
CV_DECL_ALIGNED
(
64
)
permute_mask
=
_mm256_set_epi32
(
7
,
5
,
3
,
1
,
6
,
4
,
2
,
0
);
const
__m256i
CV_DECL_ALIGNED
(
64
)
shift_shuffle_mask
=
_mm256_set_epi8
(
13
,
12
,
15
,
14
,
9
,
8
,
11
,
10
,
5
,
4
,
7
,
6
,
1
,
0
,
3
,
2
,
13
,
12
,
15
,
14
,
9
,
8
,
11
,
10
,
5
,
4
,
7
,
6
,
1
,
0
,
3
,
2
);
//
const __m256i CV_DECL_ALIGNED(64) shift_shuffle_mask = _mm256_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2,
//
13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2);
if
(((
int64
)(
dst
.
data
+
dst
.
step
)
&
0x1f
)
==
0
)
{
for
(
y
=
range
.
start
;
y
<
range
.
end
;
y
++
)
...
...
@@ -168,7 +172,9 @@ public:
int
sy
=
std
::
min
(
cvFloor
(
y
*
ify
),
ssize
.
height
-
1
);
const
uchar
*
S
=
src
.
data
+
sy
*
src
.
step
;
const
uchar
*
S2
=
S
-
2
;
#ifdef CV_ICC
#pragma unroll(4)
#endif
for
(
x
=
0
;
x
<
avxWidth
;
x
+=
16
)
{
const
__m256i
CV_DECL_ALIGNED
(
64
)
*
addr
=
(
__m256i
*
)(
x_ofs
+
x
);
...
...
@@ -200,7 +206,9 @@ public:
int
sy
=
std
::
min
(
cvFloor
(
y
*
ify
),
ssize
.
height
-
1
);
const
uchar
*
S
=
src
.
data
+
sy
*
src
.
step
;
const
uchar
*
S2
=
S
-
2
;
#ifdef CV_ICC
#pragma unroll(4)
#endif
for
(
x
=
0
;
x
<
avxWidth
;
x
+=
16
)
{
const
__m256i
CV_DECL_ALIGNED
(
64
)
*
addr
=
(
__m256i
*
)(
x_ofs
+
x
);
...
...
modules/imgproc/src/imgwarp.cpp
View file @
fadf25ac
This diff is collapsed.
Click to expand it.
modules/imgproc/src/imgwarp.hpp
View file @
fadf25ac
...
...
@@ -61,11 +61,27 @@ void resizeNN4_AVX2(const Range&, const Mat&, Mat&, int*, int, double);
int
warpAffineBlockline
(
int
*
adelta
,
int
*
bdelta
,
short
*
xy
,
short
*
alpha
,
int
X0
,
int
Y0
,
int
bw
);
#endif
}
namespace
opt_SSE41
namespace
opt_SSE4_1
{
#if CV_TRY_SSE4_1
void
resizeNN2_SSE4_1
(
const
Range
&
,
const
Mat
&
,
Mat
&
,
int
*
,
int
,
double
);
void
resizeNN4_SSE4_1
(
const
Range
&
,
const
Mat
&
,
Mat
&
,
int
*
,
int
,
double
);
int
VResizeLanczos4Vec_32f16u_SSE41
(
const
uchar
**
_src
,
uchar
*
_dst
,
const
uchar
*
_beta
,
int
width
);
void
convertMaps_nninterpolate32f1c16s_SSE41
(
const
float
*
src1f
,
const
float
*
src2f
,
short
*
dst1
,
int
width
);
void
convertMaps_32f1c16s_SSE41
(
const
float
*
src1f
,
const
float
*
src2f
,
short
*
dst1
,
ushort
*
dst2
,
int
width
);
void
convertMaps_32f2c16s_SSE41
(
const
float
*
src1f
,
short
*
dst1
,
ushort
*
dst2
,
int
width
);
void
WarpAffineInvoker_Blockline_SSE41
(
int
*
adelta
,
int
*
bdelta
,
short
*
xy
,
int
X0
,
int
Y0
,
int
bw
);
class
WarpPerspectiveLine_SSE4
{
public
:
static
Ptr
<
WarpPerspectiveLine_SSE4
>
getImpl
(
const
double
*
M
);
virtual
void
processNN
(
const
double
*
M
,
short
*
xy
,
double
X0
,
double
Y0
,
double
W0
,
int
bw
)
=
0
;
virtual
void
process
(
const
double
*
M
,
short
*
xy
,
short
*
alpha
,
double
X0
,
double
Y0
,
double
W0
,
int
bw
)
=
0
;
virtual
~
WarpPerspectiveLine_SSE4
()
{};
};
#endif
}
}
...
...
modules/imgproc/src/imgwarp.sse4_1.cpp
View file @
fadf25ac
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