44 #include "CImage_SSEx.h"
61 EIGEN_ALIGN16
const unsigned long long mask[2] = {0x00FF00FF00FF00FFull, 0x00FF00FF00FF00FFull};
62 const __m128i m = _mm_load_si128((
const __m128i*)mask);
67 for (
int i=0; i<sh; i++)
69 for (
int j=0; j<sw; j++)
71 const __m128i here_sampled = _mm_and_si128( _mm_load_si128((
const __m128i*)in), m);
72 _mm_storel_epi64((__m128i*)out, _mm_packus_epi16(here_sampled,here_sampled));
91 EIGEN_ALIGN16
const unsigned long long mask[2] = {0x00FF00FF00FF00FFull, 0x00FF00FF00FF00FFull};
92 const uint8_t* nextRow = in + w;
93 __m128i m = _mm_load_si128((
const __m128i*)mask);
97 for (
int i=0; i<sh; i++)
99 for (
int j=0; j<sw; j++)
101 __m128i here = _mm_load_si128((
const __m128i*)in);
102 __m128i next = _mm_load_si128((
const __m128i*)nextRow);
103 here = _mm_avg_epu8(here,next);
104 next = _mm_and_si128(_mm_srli_si128(here,1), m);
105 here = _mm_and_si128(here,m);
106 here = _mm_avg_epu16(here, next);
107 _mm_storel_epi64((__m128i*)out, _mm_packus_epi16(here,here));
142 #endif // end if MRPT_HAS_SSE2