mirror of
https://github.com/webmproject/libwebp.git
synced 2025-03-03 16:22:51 +01:00
dec_sse2/GetNotHEV: micro optimization
trade 2 subtractions + logical or for 1 max + 1 subtraction Change-Id: I7d1f25f7cda2a89bc8247f3d3d5417f6b0e3d96c
This commit is contained in:
parent
422ec9fb62
commit
ef314a5d6c
@ -330,10 +330,9 @@ static WEBP_INLINE void GetNotHEV(const __m128i* const p1,
|
|||||||
const __m128i t_2 = MM_ABS(*q1, *q0);
|
const __m128i t_2 = MM_ABS(*q1, *q0);
|
||||||
|
|
||||||
const __m128i h = _mm_set1_epi8(hev_thresh);
|
const __m128i h = _mm_set1_epi8(hev_thresh);
|
||||||
const __m128i t_3 = _mm_subs_epu8(t_1, h); // abs(p1 - p0) - hev_tresh
|
const __m128i t_max = _mm_max_epu8(t_1, t_2);
|
||||||
const __m128i t_4 = _mm_subs_epu8(t_2, h); // abs(q1 - q0) - hev_tresh
|
|
||||||
|
|
||||||
*not_hev = _mm_or_si128(t_3, t_4);
|
*not_hev = _mm_subs_epu8(t_max, h);
|
||||||
*not_hev = _mm_cmpeq_epi8(*not_hev, zero); // not_hev <= t1 && not_hev <= t2
|
*not_hev = _mm_cmpeq_epi8(*not_hev, zero); // not_hev <= t1 && not_hev <= t2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user