From 22acabcf0d095fef5ac14526bed9b59db68ea38a Mon Sep 17 00:00:00 2001 From: sekrit-twc Date: Fri, 28 Jan 2022 15:06:27 -0800 Subject: [PATCH] Fix AVX2 16-bit output --- timecube/x86/lut_avx2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timecube/x86/lut_avx2.cpp b/timecube/x86/lut_avx2.cpp index d08384b..b77e5ee 100644 --- a/timecube/x86/lut_avx2.cpp +++ b/timecube/x86/lut_avx2.cpp @@ -143,7 +143,7 @@ void float_to_word(const float *src, uint16_t *dst, unsigned depth, float scale, x = _mm256_packus_epi32(x, y); x = _mm256_permute4x64_epi64(x, _MM_SHUFFLE(3, 1, 2, 0)); - x = _mm256_max_epu16(x, _mm256_set1_epi16((1U << depth) - 1)); + x = _mm256_min_epu16(x, _mm256_set1_epi16((1U << depth) - 1)); _mm256_store_si256((__m256i *)(dst + i), x); }