Aufgrund eines Versionsupdates wird GitLab am 17.12. zwischen 9:00 und 9:30 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to a version upgrade, GitLab won't be accessible at 17.12. between 9 and 9:30 a.m.

Fixing bug in interpolation

parent 73fc1d0b
......@@ -65,6 +65,8 @@ public:
*
* \return True, if interpolation algorithm could be executed
*
* @note Raises an exception on bad input
*
*/
virtual bool Interpolate( const ITASampleBuffer* pInput, const int iInputLength, const int iInputStartOffset, ITASampleBuffer* pOutput, const int iOutputLength, const int iOutputOffset = 0 ) const = 0;
};
......
#include <ITAInterpolation.h>
#include <ITAConstants.h>
#include <ITAException.h>
#include <ITASampleBuffer.h>
#include <ITANumericUtils.h>
......@@ -15,9 +16,13 @@ float spline_cubic_val_equidistant( const float fX, const float* y, const std::v
bool CITASampleLinearInterpolation::Interpolate( const ITASampleBuffer* pInput, const int iInputLength, const int iInputStartOffset, ITASampleBuffer* pOutput, const int iOutputLength, const int iOutputOffset /*=0*/ ) const
{
assert(pOutput->GetLength() >= iOutputLength + iOutputOffset);
assert(pInput->GetLength() >= iInputLength + iInputStartOffset);
assert( pOutput->GetLength() >= iOutputLength + iOutputOffset );
assert( pInput->GetLength() >= iInputLength + iInputStartOffset );
if( iOutputLength < 1 )
ITA_EXCEPT_INVALID_PARAMETER( "Requested output length for interpolation must be at least 1" );
if( iInputLength < 1 )
ITA_EXCEPT_INVALID_PARAMETER( "Provided input length for interpolation must be at least 1" );
// Interpolation ist nur mglich, wenn der Eingabe-Offset auf dem Eingabepuffer
// grer oder gleich 1 ist, da sonst keine Sttzwerte vorhanden sind.
......
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