From: <man...@us...> - 2013-10-21 18:34:29
|
Revision: 2968 http://sourceforge.net/p/modplug/code/2968 Author: manxorist Date: 2013-10-21 18:34:22 +0000 (Mon, 21 Oct 2013) Log Message: ----------- [Ref] Remove unused struct fixed5p27 . Modified Paths: -------------- trunk/OpenMPT/common/typedefs.h trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mod2wave.cpp trunk/OpenMPT/soundlib/SampleFormat.h trunk/OpenMPT/soundlib/SampleFormatConverters.h Modified: trunk/OpenMPT/common/typedefs.h =================================================================== --- trunk/OpenMPT/common/typedefs.h 2013-10-21 18:29:01 UTC (rev 2967) +++ trunk/OpenMPT/common/typedefs.h 2013-10-21 18:34:22 UTC (rev 2968) @@ -301,22 +301,6 @@ #define int24_min (0-0x00800000) #define int24_max (0+0x007fffff) -struct fixed5p27 -{ - // 5 integer bits (including sign) - // 27 fractional bits - int32 raw; - - static fixed5p27 Raw(int32 x) { return fixed5p27().SetRaw(x); } - - fixed5p27& SetRaw(int32 x) { raw = x; return *this; } - int32 GetRaw() const { return raw; } - -}; -STATIC_ASSERT(sizeof(fixed5p27) == 4); -#define fixed5p27_min fixed5p27::Raw(int32_min) -#define fixed5p27_max fixed5p27::Raw(int32_max) - struct uint8_4 { uint8 x[4]; Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2013-10-21 18:29:01 UTC (rev 2967) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2013-10-21 18:34:22 UTC (rev 2968) @@ -842,13 +842,6 @@ target.DataCallback(MixSoundBuffer, channels, countChunk); } break; - case SampleFormatFixed5p27: - { - typedef SampleFormatToType<SampleFormatFixed5p27>::type Tsample; - AudioReadTargetBuffer<Tsample> target(dither, reinterpret_cast<Tsample*>(buffer), nullptr); - target.DataCallback(MixSoundBuffer, channels, countChunk); - } - break; } // increment output buffer for potentially next callback buffer = (char*)buffer + (sampleFormat.GetBitsPerSample()/8) * channels * countChunk; Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mod2wave.cpp 2013-10-21 18:29:01 UTC (rev 2967) +++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2013-10-21 18:34:22 UTC (rev 2968) @@ -68,13 +68,6 @@ return sndFile.Read(count, target); } break; - case SampleFormatFixed5p27: - { - typedef SampleFormatToType<SampleFormatFixed5p27>::type Tsample; - AudioReadTargetBuffer<Tsample> target(dither, reinterpret_cast<Tsample*>(outputBuffer), nullptr); - return sndFile.Read(count, target); - } - break; } return 0; } Modified: trunk/OpenMPT/soundlib/SampleFormat.h =================================================================== --- trunk/OpenMPT/soundlib/SampleFormat.h 2013-10-21 18:29:01 UTC (rev 2967) +++ trunk/OpenMPT/soundlib/SampleFormat.h 2013-10-21 18:34:22 UTC (rev 2968) @@ -17,7 +17,6 @@ SampleFormatInt24 = 24, // do not change value (for compatibility with old configuration settings) SampleFormatInt32 = 32, // do not change value (for compatibility with old configuration settings) SampleFormatFloat32 = 32 + 128, // do not change value (for compatibility with old configuration settings) - SampleFormatFixed5p27 = 255, // mixbuffer format SampleFormatInvalid = 0 }; @@ -27,7 +26,6 @@ template<> struct SampleFormatTraits<int24> { static const SampleFormatEnum sampleFormat = SampleFormatInt24; }; template<> struct SampleFormatTraits<int32> { static const SampleFormatEnum sampleFormat = SampleFormatInt32; }; template<> struct SampleFormatTraits<float> { static const SampleFormatEnum sampleFormat = SampleFormatFloat32; }; -template<> struct SampleFormatTraits<fixed5p27> { static const SampleFormatEnum sampleFormat = SampleFormatFixed5p27; }; template<SampleFormatEnum sampleFormat> struct SampleFormatToType; template<> struct SampleFormatToType<SampleFormatUnsigned8> { typedef uint8 type; }; @@ -35,7 +33,6 @@ template<> struct SampleFormatToType<SampleFormatInt24> { typedef int24 type; }; template<> struct SampleFormatToType<SampleFormatInt32> { typedef int32 type; }; template<> struct SampleFormatToType<SampleFormatFloat32> { typedef float type; }; -template<> struct SampleFormatToType<SampleFormatFixed5p27> { typedef fixed5p27 type; }; struct SampleFormat @@ -69,11 +66,6 @@ if(!IsValid()) return false; return value != SampleFormatFloat32; } - bool IsMixBuffer() const - { - if(!IsValid()) return false; - return value == SampleFormatFixed5p27; - } uint8 GetBitsPerSample() const { if(!IsValid()) return 0; @@ -94,9 +86,6 @@ case SampleFormatFloat32: return 32; break; - case SampleFormatFixed5p27: - return 32; - break; default: return 0; break; Modified: trunk/OpenMPT/soundlib/SampleFormatConverters.h =================================================================== --- trunk/OpenMPT/soundlib/SampleFormatConverters.h 2013-10-21 18:29:01 UTC (rev 2967) +++ trunk/OpenMPT/soundlib/SampleFormatConverters.h 2013-10-21 18:34:22 UTC (rev 2968) @@ -490,21 +490,9 @@ } }; -template <int fractionalBits> -struct ConvertFixedPoint<fixed5p27, int32, fractionalBits> -{ - typedef int32 input_t; - typedef fixed5p27 output_t; - forceinline output_t operator() (input_t val) - { - STATIC_ASSERT(fractionalBits == 27 && sizeof(input_t)*8 == 32); - return fixed5p27::Raw(val); - } -}; - // Reads sample data with Func and passes it directly to Func2. // Func1::output_t and Func2::input_t must be identical template <typename Func2, typename Func1> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |