From 8599571935b08104b666695987ba663db76f461e Mon Sep 17 00:00:00 2001 From: James Zern Date: Mon, 18 Jan 2021 16:36:49 -0800 Subject: [PATCH] disable CombinedShannonEntropy_SSE2 on x86 this function produces different results from the C code due to use of double/float resulting in output differences when compared to -noasm. Bug: webp:499 Change-Id: Ia039b168c0a66da723fb434656657ba1948db8ae --- src/dsp/lossless_enc_sse2.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/dsp/lossless_enc_sse2.c b/src/dsp/lossless_enc_sse2.c index 68d1ac3c..90c26373 100644 --- a/src/dsp/lossless_enc_sse2.c +++ b/src/dsp/lossless_enc_sse2.c @@ -249,6 +249,7 @@ static void AddVectorEq_SSE2(const uint32_t* a, uint32_t* out, int size) { } \ } while (0) +#if !(defined(__i386__) || defined(_M_IX86)) static float CombinedShannonEntropy_SSE2(const int X[256], const int Y[256]) { int i; double retval = 0.; @@ -300,6 +301,8 @@ static float CombinedShannonEntropy_SSE2(const int X[256], const int Y[256]) { retval += VP8LFastSLog2(sumX) + VP8LFastSLog2(sumXY); return (float)retval; } +#endif // !(defined(__i386__) || defined(_M_IX86)) + #undef ANALYZE_X_OR_Y #undef ANALYZE_XY @@ -659,7 +662,12 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8LEncDspInitSSE2(void) { VP8LCollectColorRedTransforms = CollectColorRedTransforms_SSE2; VP8LAddVector = AddVector_SSE2; VP8LAddVectorEq = AddVectorEq_SSE2; + // TODO(https://crbug.com/webp/499): this function produces different results + // from the C code due to use of double/float resulting in output differences + // when compared to -noasm. +#if !(defined(__i386__) || defined(_M_IX86)) VP8LCombinedShannonEntropy = CombinedShannonEntropy_SSE2; +#endif VP8LVectorMismatch = VectorMismatch_SSE2; VP8LBundleColorMap = BundleColorMap_SSE2;