From ecceaa7721be04097b8dd61ea6f62bc94007c041 Mon Sep 17 00:00:00 2001 From: sekrit-twc Date: Wed, 18 Oct 2017 08:24:55 -0700 Subject: [PATCH] depth: fix clamping of negative pixels inn AVX-512 dither --- src/zimg/depth/x86/dither_avx512.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/zimg/depth/x86/dither_avx512.cpp b/src/zimg/depth/x86/dither_avx512.cpp index 43a85090..1085074f 100644 --- a/src/zimg/depth/x86/dither_avx512.cpp +++ b/src/zimg/depth/x86/dither_avx512.cpp @@ -75,6 +75,7 @@ inline FORCE_INLINE __m512i ordered_dither_avx512_xiter(__m512 x, unsigned j, co x = _mm512_add_ps(x, dith); out = _mm512_cvtps_epi32(x); out = _mm512_min_epi32(out, out_max); + out = _mm512_max_epi32(out, _mm512_setzero_si512()); return out; }