Skip to content

Commit

Permalink
brisk_2d does not use the SSE4.1 intrinsic instructions
Browse files Browse the repository at this point in the history
brisk_2d use the SSE2 and SSSE3 intrinsic instructions.
"_mm_shuffle_epi8" is SSSE3, others is SSE2.
  • Loading branch information
UnaNancyOwen committed Feb 6, 2016
1 parent aa58bc5 commit 332d157
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions keypoints/src/brisk_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@
#include <pcl/keypoints/brisk_2d.h>
#include <pcl/point_types.h>
#include <pcl/impl/instantiate.hpp>
#if defined(__SSE4_1__) && !defined(__i386__)
#if defined(__SSSE3__) && !defined(__i386__)
#include <tmmintrin.h>
#include <emmintrin.h>
#endif

/////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1568,7 +1569,7 @@ pcl::keypoints::brisk::Layer::halfsample (
int dstwidth, int dstheight)
{
(void)dstheight;
#if defined(__SSE4_1__) && !defined(__i386__)
#if defined(__SSSE3__) && !defined(__i386__)
const unsigned short leftoverCols = static_cast<unsigned short> ((srcwidth % 16) / 2); // take care with border...
const bool noleftover = (srcwidth % 16) == 0; // note: leftoverCols can be zero but this still false...

Expand Down Expand Up @@ -1720,7 +1721,7 @@ pcl::keypoints::brisk::Layer::halfsample (
(void) (srcheight);
(void) (dstimg);
(void) (dstwidth);
PCL_ERROR("brisk without SSE4.1 support not implemented");
PCL_ERROR("brisk without SSSE3 support not implemented");
#endif
}

Expand All @@ -1733,7 +1734,7 @@ pcl::keypoints::brisk::Layer::twothirdsample (
int dstwidth, int dstheight)
{
(void)dstheight;
#if defined(__SSE4_1__) && !defined(__i386__)
#if defined(__SSSE3__) && !defined(__i386__)
const unsigned short leftoverCols = static_cast<unsigned short> (((srcwidth / 3) * 3) % 15);// take care with border...

// make sure the destination image is of the right size:
Expand Down Expand Up @@ -1834,7 +1835,7 @@ pcl::keypoints::brisk::Layer::twothirdsample (
(void) (srcheight);
(void) (dstimg);
(void) (dstwidth);
PCL_ERROR("brisk without SSE4.1 support not implemented");
PCL_ERROR("brisk without SSSE3 support not implemented");
#endif
}

4 changes: 2 additions & 2 deletions test/features/test_brisk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ PointCloud<BRISKSignature512>::Ptr cloud_descriptors_gt (new PointCloud<BRISKSig
//////////////////////////////////////////////////////////////////////////////////////////////
TEST (PCL, BRISK_2D)
{
#if defined(__SSE4_1__) && !defined(__i386__)
#if defined(__SSSE3__) && !defined(__i386__)
// Compute BRISK keypoints
BriskKeypoint2D<PointT> brisk_keypoint_estimation;
brisk_keypoint_estimation.setThreshold (60);
Expand Down Expand Up @@ -120,7 +120,7 @@ TEST (PCL, BRISK_2D)
EXPECT_NEAR (0.0f, sqr_dist, 1e-4);
}
#else
PCL_WARN ("Not compiled with SSE4.1, skipping test of Brisk.\n");
PCL_WARN ("Not compiled with SSSE3, skipping test of Brisk.\n");
#endif
}

Expand Down

0 comments on commit 332d157

Please sign in to comment.