10 #include "base-precomp.h"
25 #include "CImage_SSEx.h"
42 MRPT_ALIGN16 const unsigned long long mask[2] = {0x00FF00FF00FF00FFull, 0x00FF00FF00FF00FFull};
43 const __m128i m = _mm_load_si128((
const __m128i*)mask);
48 for (
int i=0; i<sh; i++)
50 for (
int j=0; j<sw; j++)
52 const __m128i here_sampled = _mm_and_si128( _mm_load_si128((
const __m128i*)in), m);
53 _mm_storel_epi64((__m128i*)out, _mm_packus_epi16(here_sampled,here_sampled));
72 MRPT_ALIGN16 const unsigned long long mask[2] = {0x00FF00FF00FF00FFull, 0x00FF00FF00FF00FFull};
73 const uint8_t* nextRow = in + w;
74 __m128i m = _mm_load_si128((
const __m128i*)mask);
78 for (
int i=0; i<sh; i++)
80 for (
int j=0; j<sw; j++)
82 __m128i here = _mm_load_si128((
const __m128i*)in);
83 __m128i next = _mm_load_si128((
const __m128i*)nextRow);
84 here = _mm_avg_epu8(here,next);
85 next = _mm_and_si128(_mm_srli_si128(here,1), m);
86 here = _mm_and_si128(here,m);
87 here = _mm_avg_epu16(here, next);
88 _mm_storel_epi64((__m128i*)out, _mm_packus_epi16(here,here));
123 #endif // end if MRPT_HAS_SSE2