Skip to content

Commit 567bcc9

Browse files
committed
Merge pull request #1898 from tompollok:3.4
2 parents b3d271f + 9e59262 commit 567bcc9

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

modules/optflow/src/dis_flow.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@
4141
//M*/
4242

4343
#include "precomp.hpp"
44+
#include "opencv2/core/hal/intrin.hpp"
4445
#include "opencl_kernels_optflow.hpp"
4546

47+
4648
using namespace std;
4749
#define EPS 0.001F
4850
#define INF 1E+10F
@@ -519,7 +521,7 @@ inline float processPatch(float &dst_dUx, float &dst_dUy, uchar *I0_ptr, uchar *
519521
int I0_stride, int I1_stride, float w00, float w01, float w10, float w11, int patch_sz)
520522
{
521523
float SSD = 0.0f;
522-
#ifdef CV_SIMD128
524+
#if CV_SIMD128
523525
if (patch_sz == 8)
524526
{
525527
/* Variables to accumulate the sums */
@@ -571,7 +573,7 @@ inline float processPatch(float &dst_dUx, float &dst_dUy, uchar *I0_ptr, uchar *
571573
dst_dUx += diff * I0x_ptr[i * I0_stride + j];
572574
dst_dUy += diff * I0y_ptr[i * I0_stride + j];
573575
}
574-
#ifdef CV_SIMD128
576+
#if CV_SIMD128
575577
}
576578
#endif
577579
return SSD;
@@ -588,7 +590,7 @@ inline float processPatchMeanNorm(float &dst_dUx, float &dst_dUy, uchar *I0_ptr,
588590
float sum_I0x_mul = 0.0, sum_I0y_mul = 0.0;
589591
float n = (float)patch_sz * patch_sz;
590592

591-
#ifdef CV_SIMD128
593+
#if CV_SIMD128
592594
if (patch_sz == 8)
593595
{
594596
/* Variables to accumulate the sums */
@@ -643,7 +645,7 @@ inline float processPatchMeanNorm(float &dst_dUx, float &dst_dUy, uchar *I0_ptr,
643645
sum_I0x_mul += diff * I0x_ptr[i * I0_stride + j];
644646
sum_I0y_mul += diff * I0y_ptr[i * I0_stride + j];
645647
}
646-
#ifdef CV_SIMD128
648+
#if CV_SIMD128
647649
}
648650
#endif
649651
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
656658
float w11, int patch_sz)
657659
{
658660
float SSD = 0.0f;
659-
#ifdef CV_SIMD128
661+
#if CV_SIMD128
660662
if (patch_sz == 8)
661663
{
662664
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
681683
I0_ptr[i * I0_stride + j];
682684
SSD += diff * diff;
683685
}
684-
#ifdef CV_SIMD128
686+
#if CV_SIMD128
685687
}
686688
#endif
687689
return SSD;
@@ -693,7 +695,7 @@ inline float computeSSDMeanNorm(uchar *I0_ptr, uchar *I1_ptr, int I0_stride, int
693695
{
694696
float sum_diff = 0.0f, sum_diff_sq = 0.0f;
695697
float n = (float)patch_sz * patch_sz;
696-
#ifdef CV_SIMD128
698+
#if CV_SIMD128
697699
if (patch_sz == 8)
698700
{
699701
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
723725
sum_diff += diff;
724726
sum_diff_sq += diff * diff;
725727
}
726-
#ifdef CV_SIMD128
728+
#if CV_SIMD128
727729
}
728730
#endif
729731
return sum_diff_sq - sum_diff * sum_diff / n;

modules/optflow/src/variational_refinement.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ void VariationalRefinementImpl::ComputeDataTerm_ParBody::operator()(const Range
597597
#undef INIT_ROW_POINTERS
598598

599599
int j = 0;
600-
#ifdef CV_SIMD128
600+
#if CV_SIMD128
601601
v_float32x4 zeta_vec = v_setall_f32(zeta_squared);
602602
v_float32x4 eps_vec = v_setall_f32(epsilon_squared);
603603
v_float32x4 delta_vec = v_setall_f32(delta2);
@@ -803,7 +803,7 @@ void VariationalRefinementImpl::ComputeSmoothnessTermHorPass_ParBody::operator()
803803
pA_v_next[j] += pWeight[j];
804804

805805
int j = 0;
806-
#ifdef CV_SIMD128
806+
#if CV_SIMD128
807807
v_float32x4 alpha2_vec = v_setall_f32(alpha2);
808808
v_float32x4 eps_vec = v_setall_f32(epsilon_squared);
809809
v_float32x4 cW_u_vec, cW_v_vec;
@@ -913,7 +913,7 @@ void VariationalRefinementImpl::ComputeSmoothnessTermVertPass_ParBody::operator(
913913
#undef INIT_ROW_POINTERS
914914

915915
int j = 0;
916-
#ifdef CV_SIMD128
916+
#if CV_SIMD128
917917
v_float32x4 pWeight_vec, uy_vec, vy_vec;
918918
for (; j < len - 3; j += 4)
919919
{
@@ -1015,7 +1015,7 @@ void VariationalRefinementImpl::RedBlackSOR_ParBody::operator()(const Range &ran
10151015
#undef INIT_ROW_POINTERS
10161016

10171017
j = 0;
1018-
#ifdef CV_SIMD128
1018+
#if CV_SIMD128
10191019
v_float32x4 pW_prev_vec = v_setall_f32(pW_next[-1]);
10201020
v_float32x4 pdu_prev_vec = v_setall_f32(pdu_next[-1]);
10211021
v_float32x4 pdv_prev_vec = v_setall_f32(pdv_next[-1]);

0 commit comments

Comments
 (0)