Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update usage of operators with the new Universal Intrinsics API #1310

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions modules/tracker/mbt/src/depth/vpMbtFaceDepthDense.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,15 @@ void vpMbtFaceDepthDense::computeInteractionMatrixAndResidu(const vpHomogeneousM
cv::v_float64x2 vx, vy, vz;
cv::v_load_deinterleave(ptr_point_cloud, vx, vy, vz);

#if (VISP_HAVE_OPENCV_VERSION >= 0x040900)
cv::v_float64x2 va1 = cv::v_sub(cv::v_mul(vnz, vy), cv::v_mul(vny, vz)); // vnz*vy - vny*vz
cv::v_float64x2 va2 = cv::v_sub(cv::v_mul(vnx, vz), cv::v_mul(vnz, vx)); // vnx*vz - vnz*vx
cv::v_float64x2 va3 = cv::v_sub(cv::v_mul(vny, vx), cv::v_mul(vnx, vy)); // vny*vx - vnx*vy
#else
cv::v_float64x2 va1 = vnz*vy - vny*vz;
cv::v_float64x2 va2 = vnx*vz - vnz*vx;
cv::v_float64x2 va3 = vny*vx - vnx*vy;
#endif

cv::v_float64x2 vnxy = cv::v_combine_low(vnx, vny);
cv::v_store(ptr_L, vnxy);
Expand All @@ -630,7 +636,12 @@ void vpMbtFaceDepthDense::computeInteractionMatrixAndResidu(const vpHomogeneousM
cv::v_store(ptr_L, vnxy);
ptr_L += 2;

#if (VISP_HAVE_OPENCV_VERSION >= 0x040900)
cv::v_float64x2 verr = cv::v_add(vd, cv::v_muladd(vnx, vx, cv::v_muladd(vny, vy, cv::v_mul(vnz, vz))));
#else
cv::v_float64x2 verr = vd + cv::v_muladd(vnx, vx, cv::v_muladd(vny, vy, vnz*vz));
#endif

cv::v_store(ptr_error, verr);
ptr_error += 2;
#elif USE_SSE
Expand Down
Loading