From 38fca4a203a6759f2c90b86c84c4db087982ca81 Mon Sep 17 00:00:00 2001 From: Mark Harris Date: Sat, 28 Jul 2018 13:07:15 -0700 Subject: Work around VS2015 internal compiler error The error was: c:\projects\opus\celt\celt_encoder.c(1019): fatal error C1001: An internal error has occurred in the compiler. [C:\projects\opus\win32\VS2015\opus.vcxproj] (compiler file 'f:\dd\vctools\compiler\utc\src\p2\main.c', line 255) To work around this problem, try simplifying or changing the program near the locations listed above. Please choose the Technical Support command on the Visual C++ Help menu, or open the Technical Support help file for more information Internal Compiler Error in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\CL.exe. You will be prompted to send an error report to Microsoft later. --- celt/celt_encoder.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/celt/celt_encoder.c b/celt/celt_encoder.c index fb582c47..e6a47df6 100644 --- a/celt/celt_encoder.c +++ b/celt/celt_encoder.c @@ -1021,13 +1021,13 @@ static opus_val16 dynalloc_analysis(const opus_val16 *bandLogE, const opus_val16 /* Compute SMR: Mask is never more than 72 dB below the peak and never below the noise floor.*/ opus_val16 smr = sig[i]-MAX16(MAX16(0, maxDepth-QCONST16(12.f, DB_SHIFT)), mask[i]); /* Clamp SMR to make sure we're not shifting by something negative or too large. */ - smr = MAX16(-QCONST16(5.f, DB_SHIFT), MIN16(0, smr)); #ifdef FIXED_POINT /* FIXME: Use PSHR16() instead */ - spread_weight[i] = IMAX(1, 32 >> -PSHR32(smr, DB_SHIFT)); + int shift = -PSHR32(MAX16(-QCONST16(5.f, DB_SHIFT), MIN16(0, smr)), DB_SHIFT); #else - spread_weight[i] = IMAX(1, 32 >> -(int)floor(.5f + smr)); + int shift = IMIN(5, IMAX(0, -(int)floor(.5f + smr))); #endif + spread_weight[i] = 32 >> shift; } /*for (i=0;i