41
41
//M*/
42
42
43
43
#include " precomp.hpp"
44
+ #include " opencv2/core/hal/intrin.hpp"
44
45
#include " opencl_kernels_optflow.hpp"
45
46
47
+
46
48
using namespace std ;
47
49
#define EPS 0 .001F
48
50
#define INF 1E+10F
@@ -519,7 +521,7 @@ inline float processPatch(float &dst_dUx, float &dst_dUy, uchar *I0_ptr, uchar *
519
521
int I0_stride, int I1_stride, float w00, float w01, float w10, float w11, int patch_sz)
520
522
{
521
523
float SSD = 0 .0f ;
522
- #ifdef CV_SIMD128
524
+ #if CV_SIMD128
523
525
if (patch_sz == 8 )
524
526
{
525
527
/* Variables to accumulate the sums */
@@ -571,7 +573,7 @@ inline float processPatch(float &dst_dUx, float &dst_dUy, uchar *I0_ptr, uchar *
571
573
dst_dUx += diff * I0x_ptr[i * I0_stride + j];
572
574
dst_dUy += diff * I0y_ptr[i * I0_stride + j];
573
575
}
574
- #ifdef CV_SIMD128
576
+ #if CV_SIMD128
575
577
}
576
578
#endif
577
579
return SSD;
@@ -588,7 +590,7 @@ inline float processPatchMeanNorm(float &dst_dUx, float &dst_dUy, uchar *I0_ptr,
588
590
float sum_I0x_mul = 0.0 , sum_I0y_mul = 0.0 ;
589
591
float n = (float )patch_sz * patch_sz;
590
592
591
- #ifdef CV_SIMD128
593
+ #if CV_SIMD128
592
594
if (patch_sz == 8 )
593
595
{
594
596
/* Variables to accumulate the sums */
@@ -643,7 +645,7 @@ inline float processPatchMeanNorm(float &dst_dUx, float &dst_dUy, uchar *I0_ptr,
643
645
sum_I0x_mul += diff * I0x_ptr[i * I0_stride + j];
644
646
sum_I0y_mul += diff * I0y_ptr[i * I0_stride + j];
645
647
}
646
- #ifdef CV_SIMD128
648
+ #if CV_SIMD128
647
649
}
648
650
#endif
649
651
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
656
658
float w11, int patch_sz)
657
659
{
658
660
float SSD = 0 .0f ;
659
- #ifdef CV_SIMD128
661
+ #if CV_SIMD128
660
662
if (patch_sz == 8 )
661
663
{
662
664
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
681
683
I0_ptr[i * I0_stride + j];
682
684
SSD += diff * diff;
683
685
}
684
- #ifdef CV_SIMD128
686
+ #if CV_SIMD128
685
687
}
686
688
#endif
687
689
return SSD;
@@ -693,7 +695,7 @@ inline float computeSSDMeanNorm(uchar *I0_ptr, uchar *I1_ptr, int I0_stride, int
693
695
{
694
696
float sum_diff = 0 .0f , sum_diff_sq = 0 .0f ;
695
697
float n = (float )patch_sz * patch_sz;
696
- #ifdef CV_SIMD128
698
+ #if CV_SIMD128
697
699
if (patch_sz == 8 )
698
700
{
699
701
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
723
725
sum_diff += diff;
724
726
sum_diff_sq += diff * diff;
725
727
}
726
- #ifdef CV_SIMD128
728
+ #if CV_SIMD128
727
729
}
728
730
#endif
729
731
return sum_diff_sq - sum_diff * sum_diff / n;
0 commit comments