Commit 0915a551 authored by Josh Coalson's avatar Josh Coalson
Browse files

Fixes for Sun Studio/Forte; us AC_C_INLINE to detect inline keyword for...

Fixes for Sun Studio/Forte; us AC_C_INLINE to detect inline keyword for compiler; eliminate floating point calcs in RG analysis array size calculations (SF#1701960: https://sourceforge.net/tracker2/?func=detail&aid=1701960&group_id=13478&atid=313478)
parent 8e28e43b
...@@ -60,6 +60,7 @@ AC_LANG_POP(C++) ...@@ -60,6 +60,7 @@ AC_LANG_POP(C++)
AC_C_VARARRAYS AC_C_VARARRAYS
AC_C_BIGENDIAN AC_C_BIGENDIAN
AC_C_INLINE
AC_CHECK_TYPES(socklen_t, [], []) AC_CHECK_TYPES(socklen_t, [], [])
...@@ -316,12 +317,15 @@ fi ...@@ -316,12 +317,15 @@ fi
CPPFLAGS='-I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include'" $CPPFLAGS" CPPFLAGS='-I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include'" $CPPFLAGS"
if test "x$debug" = xtrue; then if test "x$debug" = xtrue; then
CPPFLAGS="-DDEBUG $CPPFLAGS" CPPFLAGS="-DDEBUG -DFLaC__INLINE= $CPPFLAGS"
CFLAGS="-g $CFLAGS" CFLAGS="-g $CFLAGS"
else else
CPPFLAGS="-DNDEBUG $CPPFLAGS" CPPFLAGS="-DNDEBUG $CPPFLAGS"
# $ac_cv_c_inline from AC_C_INLINE
if test "x$ac_cv_c_inline" != xno ; then
CPPFLAGS="-DFLaC__INLINE=$ac_cv_c_inline $CPPFLAGS"
fi
if test "x$GCC" = xyes; then if test "x$GCC" = xyes; then
CPPFLAGS="-DFLaC__INLINE=__inline__ $CPPFLAGS"
CFLAGS="-O3 -funroll-loops -finline-functions -Wall -W -Winline $CFLAGS" CFLAGS="-O3 -funroll-loops -finline-functions -Wall -W -Winline $CFLAGS"
fi fi
fi fi
......
...@@ -106,6 +106,7 @@ ...@@ -106,6 +106,7 @@
<ul> <ul>
<li>Fixes for MinGW (<a href="https://sourceforge.net/tracker2/?func=detail&aid=2000973&group_id=13478&atid=113478">SF #2000973</a>, <a href="https://sourceforge.net/tracker2/?func=detail&aid=2209829&group_id=13478&atid=113478">SF #2209829</a>).</li> <li>Fixes for MinGW (<a href="https://sourceforge.net/tracker2/?func=detail&aid=2000973&group_id=13478&atid=113478">SF #2000973</a>, <a href="https://sourceforge.net/tracker2/?func=detail&aid=2209829&group_id=13478&atid=113478">SF #2209829</a>).</li>
<li>Fixes for gcc 4.3 (<a href="https://sourceforge.net/tracker2/?func=detail&aid=1834168&group_id=13478&atid=113478">SF #1834168</a>, <a href="https://sourceforge.net/tracker2/?func=detail&aid=2002481&group_id=13478&atid=113478">SF #2002481</a>).</li> <li>Fixes for gcc 4.3 (<a href="https://sourceforge.net/tracker2/?func=detail&aid=1834168&group_id=13478&atid=113478">SF #1834168</a>, <a href="https://sourceforge.net/tracker2/?func=detail&aid=2002481&group_id=13478&atid=113478">SF #2002481</a>).</li>
<li>Fixes for Sun Studio/Forte (<a href="https://sourceforge.net/tracker2/?func=detail&aid=1701960&group_id=13478&atid=313478">SF #1701960</a>).</li>
<li>Fixes for windows builds (<a href="https://sourceforge.net/tracker2/?func=detail&aid=1676822&group_id=13478&atid=113478">SF #1676822</a>, <a href="https://sourceforge.net/tracker2/?func=detail&aid=1756624&group_id=13478&atid=363478">SF #1756624</a>, <a href="https://sourceforge.net/tracker2/?func=detail&aid=1809863&group_id=13478&atid=113478">SF #1809863</a>, <a href="https://sourceforge.net/tracker2/?func=detail&aid=1911149&group_id=13478&atid=363478">SF #1911149</a>).</li> <li>Fixes for windows builds (<a href="https://sourceforge.net/tracker2/?func=detail&aid=1676822&group_id=13478&atid=113478">SF #1676822</a>, <a href="https://sourceforge.net/tracker2/?func=detail&aid=1756624&group_id=13478&atid=363478">SF #1756624</a>, <a href="https://sourceforge.net/tracker2/?func=detail&aid=1809863&group_id=13478&atid=113478">SF #1809863</a>, <a href="https://sourceforge.net/tracker2/?func=detail&aid=1911149&group_id=13478&atid=363478">SF #1911149</a>).</li>
</ul> </ul>
</li> </li>
......
...@@ -43,7 +43,7 @@ RSC=rc.exe ...@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I ".\include" /I "..\..\include" /D "NDEBUG" /D "FLAC_API_EXPORTS" /D "FLAC__HAS_OGG" /D VERSION=\"1.2.1\" /D "FLAC__CPU_IA32" /D "FLAC__HAS_NASM" /D "FLAC__USE_3DNOW" /D "_WINDOWS" /D "_WINDLL" /D "WIN32" /D "_USRDLL" /FR /FD /c # ADD CPP /nologo /MD /W3 /GR /GX /O2 /I ".\include" /I "..\..\include" /D "NDEBUG" /D "FLAC_API_EXPORTS" /D "FLAC__HAS_OGG" /D VERSION=\"1.2.1\" /D "FLAC__CPU_IA32" /D "FLAC__HAS_NASM" /D "FLAC__USE_3DNOW" /D FLaC__INLINE=_inline /D "_WINDOWS" /D "_WINDLL" /D "WIN32" /D "_USRDLL" /FR /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD BASE RSC /l 0x409 /d "NDEBUG"
......
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
OmitFramePointers="true" OmitFramePointers="true"
WholeProgramOptimization="true" WholeProgramOptimization="true"
AdditionalIncludeDirectories=".\include;..\..\include" AdditionalIncludeDirectories=".\include;..\..\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FLAC_API_EXPORTS;FLAC__HAS_OGG;FLAC__CPU_IA32;FLAC__HAS_NASM;FLAC__USE_3DNOW;VERSION=\&quot;1.2.0\&quot;" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FLAC_API_EXPORTS;FLAC__HAS_OGG;FLAC__CPU_IA32;FLAC__HAS_NASM;FLAC__USE_3DNOW;VERSION=\&quot;1.2.0\&quot;;FLaC__INLINE=_inline"
RuntimeLibrary="0" RuntimeLibrary="0"
BufferSecurityCheck="false" BufferSecurityCheck="false"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
......
...@@ -41,7 +41,7 @@ RSC=rc.exe ...@@ -41,7 +41,7 @@ RSC=rc.exe
# PROP Intermediate_Dir "Release_static" # PROP Intermediate_Dir "Release_static"
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /Op /I ".\include" /I "..\..\include" /D VERSION=\"1.2.1\" /D "FLAC__NO_DLL" /D "FLAC__HAS_OGG" /D "FLAC__CPU_IA32" /D "FLAC__HAS_NASM" /D "FLAC__USE_3DNOW" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /Op /I ".\include" /I "..\..\include" /D VERSION=\"1.2.1\" /D "FLAC__NO_DLL" /D "FLAC__HAS_OGG" /D "FLAC__CPU_IA32" /D "FLAC__HAS_NASM" /D "FLAC__USE_3DNOW" /D FLaC__INLINE=_inline /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe BSC32=bscmake.exe
......
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
OmitFramePointers="true" OmitFramePointers="true"
WholeProgramOptimization="true" WholeProgramOptimization="true"
AdditionalIncludeDirectories=".\include;..\..\include" AdditionalIncludeDirectories=".\include;..\..\include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__HAS_OGG;FLAC__CPU_IA32;FLAC__HAS_NASM;FLAC__USE_3DNOW;VERSION=\&quot;1.2.0\&quot;;FLAC__NO_DLL" PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__HAS_OGG;FLAC__CPU_IA32;FLAC__HAS_NASM;FLAC__USE_3DNOW;VERSION=\&quot;1.2.0\&quot;;FLAC__NO_DLL;FLaC__INLINE=_inline"
RuntimeLibrary="0" RuntimeLibrary="0"
BufferSecurityCheck="false" BufferSecurityCheck="false"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
......
...@@ -41,7 +41,7 @@ RSC=rc.exe ...@@ -41,7 +41,7 @@ RSC=rc.exe
# PROP Intermediate_Dir "Release_static" # PROP Intermediate_Dir "Release_static"
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MD /W3 /WX /GX /Ox /Og /Oi /Os /Op /I ".\include" /I "..\..\include" /D "FLAC__NO_DLL" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # ADD CPP /nologo /MD /W3 /WX /GX /Ox /Og /Oi /Os /Op /I ".\include" /I "..\..\include" /D "FLAC__NO_DLL" /D FLaC__INLINE=_inline /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe BSC32=bscmake.exe
......
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
OmitFramePointers="true" OmitFramePointers="true"
WholeProgramOptimization="true" WholeProgramOptimization="true"
AdditionalIncludeDirectories=".\include;..\..\include" AdditionalIncludeDirectories=".\include;..\..\include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__NO_DLL" PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__NO_DLL;FLaC__INLINE=_inline"
RuntimeLibrary="0" RuntimeLibrary="0"
BufferSecurityCheck="false" BufferSecurityCheck="false"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
......
...@@ -110,24 +110,24 @@ typedef signed int Int32_t; ...@@ -110,24 +110,24 @@ typedef signed int Int32_t;
#define YULE_ORDER 10 #define YULE_ORDER 10
#define BUTTER_ORDER 2 #define BUTTER_ORDER 2
#define RMS_PERCENTILE 0.95 /* percentile which is louder than the proposed level */ #define RMS_PERCENTILE 0.95 /* percentile which is louder than the proposed level */
#define MAX_SAMP_FREQ 48000. /* maximum allowed sample frequency [Hz] */ #define MAX_SAMP_FREQ 48000 /* maximum allowed sample frequency [Hz] */
#define RMS_WINDOW_TIME 0.050 /* Time slice size [s] */ #define RMS_WINDOW_TIME 50 /* Time slice size [ms] */
#define STEPS_per_dB 100. /* Table entries per dB */ #define STEPS_per_dB 100. /* Table entries per dB */
#define MAX_dB 120. /* Table entries for 0...MAX_dB (normal max. values are 70...80 dB) */ #define MAX_dB 120. /* Table entries for 0...MAX_dB (normal max. values are 70...80 dB) */
#define MAX_ORDER (BUTTER_ORDER > YULE_ORDER ? BUTTER_ORDER : YULE_ORDER) #define MAX_ORDER (BUTTER_ORDER > YULE_ORDER ? BUTTER_ORDER : YULE_ORDER)
/* [JEC] the following was originally #defined as: /* [JEC] the following was originally #defined as:
* (size_t) (MAX_SAMP_FREQ * RMS_WINDOW_TIME) * (size_t) (MAX_SAMP_FREQ * RMS_WINDOW_TIME / 1000)
* but that seemed to fail to take into account the ceil() part of the * but that seemed to fail to take into account the ceil() part of the
* sampleWindow calculation in ResetSampleFrequency(), and was causing * sampleWindow calculation in ResetSampleFrequency(), and was causing
* buffer overflows for 48kHz analysis, hence the +1. * buffer overflows for 48kHz analysis, hence the +1.
*/ */
#ifndef __sun /* [JEC] WATCHOUT: if MAX_SAMP_FREQ * RMS_WINDOW_TIME / 1000 is not an
#define MAX_SAMPLES_PER_WINDOW (size_t) (MAX_SAMP_FREQ * RMS_WINDOW_TIME + 1.) /* max. Samples per Time slice */ * integer it must be manually rounded up. there is a limit on the
#else * kind of calculation that can be done in array size definition (e.g.
/* [JEC] Solaris Forte compiler doesn't like float calc in array indices */ * Sun Forte compiler cannot handle any floating point terms).
#define MAX_SAMPLES_PER_WINDOW (size_t) (2401) */
#endif #define MAX_SAMPLES_PER_WINDOW (size_t) (MAX_SAMP_FREQ * RMS_WINDOW_TIME / 1000 + 1) /* max. Samples per Time slice */
#define PINK_REF 64.82 /* 298640883795 */ /* calibration value */ #define PINK_REF 64.82 /* 298640883795 */ /* calibration value */
static Float_t linprebuf [MAX_ORDER * 2]; static Float_t linprebuf [MAX_ORDER * 2];
...@@ -255,7 +255,7 @@ ResetSampleFrequency ( long samplefreq ) { ...@@ -255,7 +255,7 @@ ResetSampleFrequency ( long samplefreq ) {
default: return INIT_GAIN_ANALYSIS_ERROR; default: return INIT_GAIN_ANALYSIS_ERROR;
} }
sampleWindow = (int) ceil (samplefreq * RMS_WINDOW_TIME); sampleWindow = (int) ceil ((double)samplefreq * (double)RMS_WINDOW_TIME / 1000.0);
lsum = 0.; lsum = 0.;
rsum = 0.; rsum = 0.;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment