From 3c2b21c22e5d12fc790324ac2f78c029ccf694b3 Mon Sep 17 00:00:00 2001 From: Scott LaVarnway Date: Mon, 8 Aug 2022 15:09:32 -0700 Subject: [PATCH] VPX: Fix vp9_quantize_fp_avx2() VS build error. Add build fix for _mm256_extract_epi16() being undefined. Bug: b/237714063 Change-Id: I855b1828ce1b6b2b2f063fe097999481881bf074 --- vp9/encoder/x86/vp9_quantize_avx2.c | 4 ++++ vpx_dsp/x86/highbd_quantize_intrin_avx2.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/vp9/encoder/x86/vp9_quantize_avx2.c b/vp9/encoder/x86/vp9_quantize_avx2.c index 7afeba3..15ce71c 100644 --- a/vp9/encoder/x86/vp9_quantize_avx2.c +++ b/vp9/encoder/x86/vp9_quantize_avx2.c @@ -67,7 +67,11 @@ static VPX_FORCE_INLINE uint16_t get_max_eob(__m256i eob256) { eob = _mm256_max_epi16(eob, eob_s); eob_s = _mm256_shufflelo_epi16(eob, 1); eob = _mm256_max_epi16(eob, eob_s); +#if defined(_MSC_VER) && (_MSC_VER < 1910) + return _mm_cvtsi128_si32(_mm256_extracti128_si256(eob, 0)) & 0xffff; +#else return (uint16_t)_mm256_extract_epi16(eob, 0); +#endif } static VPX_FORCE_INLINE void quantize_fp_16( diff --git a/vpx_dsp/x86/highbd_quantize_intrin_avx2.c b/vpx_dsp/x86/highbd_quantize_intrin_avx2.c index ec1110f..cbc715c 100644 --- a/vpx_dsp/x86/highbd_quantize_intrin_avx2.c +++ b/vpx_dsp/x86/highbd_quantize_intrin_avx2.c @@ -94,7 +94,11 @@ static VPX_FORCE_INLINE uint16_t get_max_eob(__m256i eob) { eob = _mm256_max_epi16(eob, eob_s); eob_s = _mm256_shufflelo_epi16(eob, 1); eob = _mm256_max_epi16(eob, eob_s); +#if defined(_MSC_VER) && (_MSC_VER < 1910) + return _mm_cvtsi128_si32(_mm256_extracti128_si256(eob, 0)) & 0xffff; +#else return (uint16_t)_mm256_extract_epi16(eob, 0); +#endif } static VPX_FORCE_INLINE void quantize(const __m256i *qp, -- 2.7.4