c++ - Image thresholding with SSE -


i'm trying code image segmentation code sse optimization. have strange result. enter image description here

this code :

void binaire_sse(unsigned int * img, long h,long l, long seuil ,unsigned int * out) {     __m128i vthreshold = _mm_set1_epi8(seuil);     int i, j;      (i = 0; < h; ++i)     {         const __m128i * p_in = (__m128i *)&img[i * l];         uint16_t * p_out = (uint16_t *)&out[i * l / char_bit];          (j = 0; j < l; j += 16)         {             __m128i v = _mm_load_si128(p_in);             uint16_t b;              v = _mm_add_epi8(v, vthreshold);             b = _mm_movemask_epi8(v);              *p_out = b;              p_in++;             p_out++;         }     } } 


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -