c++ - Image thresholding with SSE -
i'm trying code image segmentation code sse optimization. have strange result.
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
Post a Comment