Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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_contrib
Commits
9e592620
Commit
9e592620
authored
Nov 11, 2018
by
tompollok
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use #if instead of #ifdef for CV_SIMD128
parent
fae2d927
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
12 deletions
+14
-12
dis_flow.cpp
modules/optflow/src/dis_flow.cpp
+10
-8
variational_refinement.cpp
modules/optflow/src/variational_refinement.cpp
+4
-4
No files found.
modules/optflow/src/dis_flow.cpp
View file @
9e592620
...
...
@@ -41,8 +41,10 @@
//M*/
#include "precomp.hpp"
#include "opencv2/core/hal/intrin.hpp"
#include "opencl_kernels_optflow.hpp"
using
namespace
std
;
#define EPS 0.001F
#define INF 1E+10F
...
...
@@ -519,7 +521,7 @@ inline float processPatch(float &dst_dUx, float &dst_dUy, uchar *I0_ptr, uchar *
int
I0_stride
,
int
I1_stride
,
float
w00
,
float
w01
,
float
w10
,
float
w11
,
int
patch_sz
)
{
float
SSD
=
0.0
f
;
#if
def
CV_SIMD128
#if CV_SIMD128
if
(
patch_sz
==
8
)
{
/* Variables to accumulate the sums */
...
...
@@ -571,7 +573,7 @@ inline float processPatch(float &dst_dUx, float &dst_dUy, uchar *I0_ptr, uchar *
dst_dUx
+=
diff
*
I0x_ptr
[
i
*
I0_stride
+
j
];
dst_dUy
+=
diff
*
I0y_ptr
[
i
*
I0_stride
+
j
];
}
#if
def
CV_SIMD128
#if CV_SIMD128
}
#endif
return
SSD
;
...
...
@@ -588,7 +590,7 @@ inline float processPatchMeanNorm(float &dst_dUx, float &dst_dUy, uchar *I0_ptr,
float
sum_I0x_mul
=
0.0
,
sum_I0y_mul
=
0.0
;
float
n
=
(
float
)
patch_sz
*
patch_sz
;
#if
def
CV_SIMD128
#if CV_SIMD128
if
(
patch_sz
==
8
)
{
/* Variables to accumulate the sums */
...
...
@@ -643,7 +645,7 @@ inline float processPatchMeanNorm(float &dst_dUx, float &dst_dUy, uchar *I0_ptr,
sum_I0x_mul
+=
diff
*
I0x_ptr
[
i
*
I0_stride
+
j
];
sum_I0y_mul
+=
diff
*
I0y_ptr
[
i
*
I0_stride
+
j
];
}
#if
def
CV_SIMD128
#if CV_SIMD128
}
#endif
dst_dUx
=
sum_I0x_mul
-
sum_diff
*
x_grad_sum
/
n
;
...
...
@@ -656,7 +658,7 @@ inline float computeSSD(uchar *I0_ptr, uchar *I1_ptr, int I0_stride, int I1_stri
float
w11
,
int
patch_sz
)
{
float
SSD
=
0.0
f
;
#if
def
CV_SIMD128
#if CV_SIMD128
if
(
patch_sz
==
8
)
{
v_float32x4
SSD_vec
=
v_setall_f32
(
0
);
...
...
@@ -681,7 +683,7 @@ inline float computeSSD(uchar *I0_ptr, uchar *I1_ptr, int I0_stride, int I1_stri
I0_ptr
[
i
*
I0_stride
+
j
];
SSD
+=
diff
*
diff
;
}
#if
def
CV_SIMD128
#if CV_SIMD128
}
#endif
return
SSD
;
...
...
@@ -693,7 +695,7 @@ inline float computeSSDMeanNorm(uchar *I0_ptr, uchar *I1_ptr, int I0_stride, int
{
float
sum_diff
=
0.0
f
,
sum_diff_sq
=
0.0
f
;
float
n
=
(
float
)
patch_sz
*
patch_sz
;
#if
def
CV_SIMD128
#if CV_SIMD128
if
(
patch_sz
==
8
)
{
v_float32x4
sum_diff_vec
=
v_setall_f32
(
0
);
...
...
@@ -723,7 +725,7 @@ inline float computeSSDMeanNorm(uchar *I0_ptr, uchar *I1_ptr, int I0_stride, int
sum_diff
+=
diff
;
sum_diff_sq
+=
diff
*
diff
;
}
#if
def
CV_SIMD128
#if CV_SIMD128
}
#endif
return
sum_diff_sq
-
sum_diff
*
sum_diff
/
n
;
...
...
modules/optflow/src/variational_refinement.cpp
View file @
9e592620
...
...
@@ -597,7 +597,7 @@ void VariationalRefinementImpl::ComputeDataTerm_ParBody::operator()(const Range
#undef INIT_ROW_POINTERS
int
j
=
0
;
#if
def
CV_SIMD128
#if CV_SIMD128
v_float32x4
zeta_vec
=
v_setall_f32
(
zeta_squared
);
v_float32x4
eps_vec
=
v_setall_f32
(
epsilon_squared
);
v_float32x4
delta_vec
=
v_setall_f32
(
delta2
);
...
...
@@ -803,7 +803,7 @@ void VariationalRefinementImpl::ComputeSmoothnessTermHorPass_ParBody::operator()
pA_v_next[j] += pWeight[j];
int
j
=
0
;
#if
def
CV_SIMD128
#if CV_SIMD128
v_float32x4
alpha2_vec
=
v_setall_f32
(
alpha2
);
v_float32x4
eps_vec
=
v_setall_f32
(
epsilon_squared
);
v_float32x4
cW_u_vec
,
cW_v_vec
;
...
...
@@ -913,7 +913,7 @@ void VariationalRefinementImpl::ComputeSmoothnessTermVertPass_ParBody::operator(
#undef INIT_ROW_POINTERS
int
j
=
0
;
#if
def
CV_SIMD128
#if CV_SIMD128
v_float32x4
pWeight_vec
,
uy_vec
,
vy_vec
;
for
(;
j
<
len
-
3
;
j
+=
4
)
{
...
...
@@ -1015,7 +1015,7 @@ void VariationalRefinementImpl::RedBlackSOR_ParBody::operator()(const Range &ran
#undef INIT_ROW_POINTERS
j
=
0
;
#if
def
CV_SIMD128
#if CV_SIMD128
v_float32x4
pW_prev_vec
=
v_setall_f32
(
pW_next
[
-
1
]);
v_float32x4
pdu_prev_vec
=
v_setall_f32
(
pdu_next
[
-
1
]);
v_float32x4
pdv_prev_vec
=
v_setall_f32
(
pdv_next
[
-
1
]);
...
...
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