From: <sag...@us...> - 2014-12-19 19:04:39
|
Revision: 4658 http://sourceforge.net/p/modplug/code/4658 Author: saga-games Date: 2014-12-19 19:04:33 +0000 (Fri, 19 Dec 2014) Log Message: ----------- [Imp] Update r8brain to r72. Revision Links: -------------- http://sourceforge.net/p/modplug/code/72 Modified Paths: -------------- trunk/OpenMPT/include/r8brain/CDSPBlockConvolver.h trunk/OpenMPT/include/r8brain/CDSPResampler.h trunk/OpenMPT/include/r8brain/OpenMPT.txt trunk/OpenMPT/include/r8brain/r8bbase.h trunk/OpenMPT/mptrack/Ctrl_smp.cpp Modified: trunk/OpenMPT/include/r8brain/CDSPBlockConvolver.h =================================================================== --- trunk/OpenMPT/include/r8brain/CDSPBlockConvolver.h 2014-12-16 21:49:48 UTC (rev 4657) +++ trunk/OpenMPT/include/r8brain/CDSPBlockConvolver.h 2014-12-19 19:04:33 UTC (rev 4658) @@ -294,7 +294,7 @@ ilu = InputLen; } - const int pil = PrevInputLen * sizeof( double ); + const int pil = (int) ( PrevInputLen * sizeof( double )); memcpy( &CurInput[ ilu ], PrevInput, pil ); memcpy( PrevInput, &CurInput[ ilu - PrevInputLen ], pil ); Modified: trunk/OpenMPT/include/r8brain/CDSPResampler.h =================================================================== --- trunk/OpenMPT/include/r8brain/CDSPResampler.h 2014-12-16 21:49:48 UTC (rev 4657) +++ trunk/OpenMPT/include/r8brain/CDSPResampler.h 2014-12-19 19:04:33 UTC (rev 4658) @@ -383,7 +383,7 @@ } double* ip = ip0; - double* op; + double* op = NULL; int i; for( i = 0; i < ConvCount; i++ ) Modified: trunk/OpenMPT/include/r8brain/OpenMPT.txt =================================================================== --- trunk/OpenMPT/include/r8brain/OpenMPT.txt 2014-12-16 21:49:48 UTC (rev 4657) +++ trunk/OpenMPT/include/r8brain/OpenMPT.txt 2014-12-19 19:04:33 UTC (rev 4658) @@ -1,4 +1,4 @@ -r8brain-free resampling library from https://code.google.com/p/r8brain-free-src/ revision 71. +r8brain-free resampling library from https://code.google.com/p/r8brain-free-src/ revision 72. The (non-functional) example program, DLL folder and logo file have been removed. No further local changes have been made. For building, premake4 is used to generate Visual Studio project files. Modified: trunk/OpenMPT/include/r8brain/r8bbase.h =================================================================== --- trunk/OpenMPT/include/r8brain/r8bbase.h 2014-12-16 21:49:48 UTC (rev 4657) +++ trunk/OpenMPT/include/r8brain/r8bbase.h 2014-12-19 19:04:33 UTC (rev 4658) @@ -859,40 +859,54 @@ /** * Function calculates frequency response of the specified FIR filter at the - * specified circular frequency. + * specified circular frequency. Phase can be calculated as atan2( im, re ). * * @param flt FIR filter's coefficients. * @param fltlen Number of coefficients (taps) in the filter. * @param th Circular frequency [0; pi]. * @param[out] re0 Resulting real part of the complex frequency response. * @param[out] im0 Resulting imaginary part of the complex frequency response. + * @param fltlat Filter's latency in samples. */ inline void calcFIRFilterResponse( const double* flt, int fltlen, - const double th, double& re0, double& im0 ) + const double th, double& re0, double& im0, const int fltlat = 0 ) { - double svalue1 = 0.0; - double svalue2 = sin( -th ); const double sincr = 2.0 * cos( th ); - double cvalue1 = 1.0; - double cvalue2 = sin( M_PId2 - th ); + double cvalue1; + double svalue1; + + if( fltlat == 0 ) + { + cvalue1 = 1.0; + svalue1 = 0.0; + } + else + { + cvalue1 = cos( -fltlat * th ); + svalue1 = sin( -fltlat * th ); + } + + double cvalue2 = cos( -( fltlat + 1 ) * th ); + double svalue2 = sin( -( fltlat + 1 ) * th ); + double re = 0.0; double im = 0.0; while( fltlen > 0 ) { - re += svalue1 * flt[ 0 ]; - im += cvalue1 * flt[ 0 ]; + re += cvalue1 * flt[ 0 ]; + im += svalue1 * flt[ 0 ]; flt++; fltlen--; - double tmp = svalue1; + double tmp = cvalue1; + cvalue1 = sincr * cvalue1 - cvalue2; + cvalue2 = tmp; + + tmp = svalue1; svalue1 = sincr * svalue1 - svalue2; svalue2 = tmp; - - tmp = cvalue1; - cvalue1 = sincr * cvalue1 - cvalue2; - cvalue2 = tmp; } re0 = re; Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2014-12-16 21:49:48 UTC (rev 4657) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2014-12-19 19:04:33 UTC (rev 4658) @@ -36,9 +36,7 @@ #include <math.h> #endif -#pragma warning(disable:4701) #include "../include/r8brain/CDSPResampler.h" -#pragma warning(default:4701) #ifdef _DEBUG #define new DEBUG_NEW This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |