Main MRPT website > C++ reference for MRPT 1.5.6
faster_corner_utilities.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 
10 // ---------------------------------------------------------------------------
11 // LICENSING: This file is a slightly-modified version of part of libcvd,
12 // released under LGPL 2.1 by Edward Rosten
13 // ---------------------------------------------------------------------------
14 
15 #ifndef MRPT_CVD_INTERNAL_INC_FAST_CORNER_UTILITIES_H
16 #define MRPT_CVD_INTERNAL_INC_FAST_CORNER_UTILITIES_H
17 
18 #include <mrpt/utils/SSE_types.h>
19 
20 namespace mrpt
21 {
22  struct Less
23  {
24  template <class T1, class T2> static bool eval(const T1 a, const T2 b)
25  {
26  return a < b;
27  }
28  static int prep_t(int pixel_val, int barrier)
29  {
30  return pixel_val - barrier;
31  }
32  };
33  struct Greater
34  {
35  template <class T1, class T2> static bool eval(const T1 a, const T2 b)
36  {
37  return a > b;
38  }
39  static int prep_t(int pixel_val, int barrier)
40  {
41  return pixel_val + barrier;
42  }
43  };
44 
45 #if MRPT_HAS_SSE2
46 
47  #define CHECK_BARRIER(lo, hi, other, flags) \
48  { \
49  __m128i diff = _mm_subs_epu8(lo, other); \
50  __m128i diff2 = _mm_subs_epu8(other, hi); \
51  __m128i z = _mm_setzero_si128(); \
52  diff = _mm_cmpeq_epi8(diff, z); \
53  diff2 = _mm_cmpeq_epi8(diff2, z); \
54  flags = ~(_mm_movemask_epi8(diff) | (_mm_movemask_epi8(diff2) << 16)); \
55  }
56 
57  template <bool Aligned> inline __m128i load_si128(const void* addr) { return _mm_loadu_si128((const __m128i*)addr); }
58  template <> inline __m128i load_si128<true>(const void* addr) { return _mm_load_si128((const __m128i*)addr); }
59 
60 #endif
61 
62 }
63 #endif
GLboolean GLboolean GLboolean GLboolean a
Definition: glew.h:5406
GLuint barrier
Definition: wglew.h:840
__m128i load_si128(const void *addr)
static bool eval(const T1 a, const T2 b)
static int prep_t(int pixel_val, int barrier)
__m128i load_si128< true >(const void *addr)
static bool eval(const T1 a, const T2 b)
GLenum GLvoid * addr
Definition: glew.h:7141
static int prep_t(int pixel_val, int barrier)
GLdouble GLdouble GLdouble b
Definition: glew.h:5092



Page generated by Doxygen 1.8.6 for MRPT 1.5.6 Git: 4c65e84 Tue Apr 24 08:18:17 2018 +0200 at mar abr 24 08:26:17 CEST 2018