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
881cee4d
Commit
881cee4d
authored
Jan 22, 2020
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16146 from pmur:reg_16137x2
parents
16d8e9e0
c1cdb241
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
14 deletions
+10
-14
resize.cpp
modules/imgproc/src/resize.cpp
+10
-14
No files found.
modules/imgproc/src/resize.cpp
View file @
881cee4d
...
...
@@ -1526,7 +1526,7 @@ struct HResizeLinearVec_X4
struct
HResizeLinearVecU8_X4
{
int
operator
()(
const
uchar
**
src
,
int
**
dst
,
int
count
,
const
int
*
xofs
,
const
short
*
alpha
/*[xmax]*/
,
int
smax
,
int
/*dmax*/
,
int
cn
,
int
/*xmin*/
,
int
xmax
)
const
const
short
*
alpha
/*[xmax]*/
,
int
/*smax*/
,
int
dmax
,
int
cn
,
int
/*xmin*/
,
int
xmax
)
const
{
int
dx
=
0
,
k
=
0
;
...
...
@@ -1612,17 +1612,11 @@ struct HResizeLinearVecU8_X4
}
else
if
(
cn
==
3
)
{
int
len0
=
xmax
-
cn
;
/* This may need to trim 1 or more extra units depending on the amount of
scaling. Test until we find the first value which we know cannot overrun. */
while
(
len0
>=
cn
&&
xofs
[
len0
-
cn
]
+
cn
>=
smax
-
cn
// check access: v_load_expand_q(S+xofs[dx]+cn)
)
{
len0
-=
cn
;
}
CV_DbgAssert
(
len0
<=
0
||
len0
>=
cn
);
/* Peek at the last x offset to find the maximal s offset. We know the loop
will terminate prior to value which may be 1 or more elements prior to the
final valid offset. xofs[] is constucted to be an array of increasingly
large offsets (i.e xofs[x] <= xofs[x+1] for x < xmax). */
int
smax
=
xofs
[
dmax
-
cn
];
for
(
;
k
<=
(
count
-
2
);
k
+=
2
)
{
...
...
@@ -1631,7 +1625,7 @@ struct HResizeLinearVecU8_X4
const
uchar
*
S1
=
src
[
k
+
1
];
int
*
D1
=
dst
[
k
+
1
];
for
(
dx
=
0
;
dx
<
len0
;
dx
+=
cn
)
for
(
dx
=
0
;
(
xofs
[
dx
]
+
cn
)
<
smax
;
dx
+=
cn
)
{
v_int16x8
a
=
v_load
(
alpha
+
dx
*
2
);
v_store
(
&
D0
[
dx
],
v_dotprod
(
v_reinterpret_as_s16
(
v_load_expand_q
(
S0
+
xofs
[
dx
])
|
(
v_load_expand_q
(
S0
+
xofs
[
dx
]
+
cn
)
<<
16
)),
a
));
...
...
@@ -1642,12 +1636,14 @@ struct HResizeLinearVecU8_X4
{
const
uchar
*
S
=
src
[
k
];
int
*
D
=
dst
[
k
];
for
(
dx
=
0
;
dx
<
len0
;
dx
+=
cn
)
for
(
dx
=
0
;
(
xofs
[
dx
]
+
cn
)
<
smax
;
dx
+=
cn
)
{
v_int16x8
a
=
v_load
(
alpha
+
dx
*
2
);
v_store
(
&
D
[
dx
],
v_dotprod
(
v_reinterpret_as_s16
(
v_load_expand_q
(
S
+
xofs
[
dx
])
|
(
v_load_expand_q
(
S
+
xofs
[
dx
]
+
cn
)
<<
16
)),
a
));
}
}
/* Debug check to ensure truthiness that we never vector the final value. */
CV_DbgAssert
(
dx
<
dmax
);
}
else
if
(
cn
==
4
)
{
...
...
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