Hello,
My input data is 16-bit data, and I need to find a median of 3 values using SSE2 instruction set.
If I have 3 16-bits input values A, B and C, I thought to do it like this:
D = max( max( A, B ), C )
E = min( min( A, B ), C )
median = A + B + C - D - E
C functions I am planing to use are :
- max - _mm_max_epi16
- min - _mm_min_epi16
- addition - _mm_add_epi16
- subtract - _mm_sub_epi16
Can anyone suggest a better way?