|
From: <man...@us...> - 2013-04-12 14:03:20
|
Revision: 1856
http://sourceforge.net/p/modplug/code/1856
Author: manxorist
Date: 2013-04-12 14:03:13 +0000 (Fri, 12 Apr 2013)
Log Message:
-----------
[Ref] Make the non-parametrized downsample tables in CResampler static in MODPLUG_TRACKER builds.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Resampler.h
trunk/OpenMPT/soundlib/Tables.cpp
Modified: trunk/OpenMPT/soundlib/Resampler.h
===================================================================
--- trunk/OpenMPT/soundlib/Resampler.h 2013-04-12 13:49:50 UTC (rev 1855)
+++ trunk/OpenMPT/soundlib/Resampler.h 2013-04-12 14:03:13 UTC (rev 1856)
@@ -48,8 +48,15 @@
CResamplerSettings m_Settings;
CWindowedFIR m_WindowedFIR;
short int gKaiserSinc[SINC_PHASES*8]; // Upsampling
+#ifdef MODPLUG_TRACKER
+ static bool StaticTablesInitialized;
+ static short int gDownsample13x[SINC_PHASES*8]; // Downsample 1.333x
+ static short int gDownsample2x[SINC_PHASES*8]; // Downsample 2x
+#else
+ // no global data which has to be initialized by hand in the library
short int gDownsample13x[SINC_PHASES*8]; // Downsample 1.333x
short int gDownsample2x[SINC_PHASES*8]; // Downsample 2x
+#endif
private:
CResamplerSettings m_OldSettings;
public:
Modified: trunk/OpenMPT/soundlib/Tables.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Tables.cpp 2013-04-12 13:49:50 UTC (rev 1855)
+++ trunk/OpenMPT/soundlib/Tables.cpp 2013-04-12 14:03:13 UTC (rev 1856)
@@ -692,17 +692,34 @@
}
+#ifdef MODPLUG_TRACKER
+bool CResampler::StaticTablesInitialized = false;
+short int CResampler::gDownsample13x[SINC_PHASES*8]; // Downsample 1.333x
+short int CResampler::gDownsample2x[SINC_PHASES*8]; // Downsample 2x
+#endif
+
+
void CResampler::InitializeTables(bool force)
{
+ #ifdef MODPLUG_TRACKER
+ if(!StaticTablesInitialized)
+ {
+ //ericus' downsampling improvement.
+ //getsinc(gDownsample13x, 8.5, 3.0/4.0);
+ //getdownsample2x(gDownsample2x);
+ getsinc(gDownsample13x, 8.5, 0.5);
+ getsinc(gDownsample2x, 2.7625, 0.425);
+ //end ericus' downsampling improvement.
+ StaticTablesInitialized = true;
+ }
+ #endif
if((m_OldSettings == m_Settings) && !force) return;
m_WindowedFIR.InitTable(m_Settings.gdWFIRCutoff, m_Settings.gbWFIRType);
getsinc(gKaiserSinc, 9.6377, m_Settings.gdWFIRCutoff);
- //ericus' downsampling improvement.
- //getsinc(gDownsample13x, 8.5, 3.0/4.0);
- //getdownsample2x(gDownsample2x);
- getsinc(gDownsample13x, 8.5, 0.5);
- getsinc(gDownsample2x, 2.7625, 0.425);
- //end ericus' downsampling improvement.
+ #ifndef MODPLUG_TRACKER
+ getsinc(gDownsample13x, 8.5, 0.5);
+ getsinc(gDownsample2x, 2.7625, 0.425);
+ #endif
m_OldSettings = m_Settings;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|