Aufgrund einer Wartung wird GitLab am 25.01 zwischen 8:00 und 9:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 25.01 between 8:00 and 9:00 am.

Commit e2388d25 authored by Jonas Stienen's avatar Jonas Stienen
Browse files

Applying interface changes and refactoring for partitioned convolution

parent 68a36abf
......@@ -17,8 +17,8 @@
#include "VAThirdOctaveFilterbank.h"
#include "VAThirdOctaveFIRFilterGenerator.h"
#include <DSMBCConvolver.h>
#include <DSMBCFilter.h>
#include <ITAUPConvolution.h>
#include <ITAUPFilter.h>
#include <ITAFastMath.h>
#include <cassert>
......@@ -39,8 +39,8 @@ public:
m_pGenerator = new CVAThirdOctaveFIRFilterGenerator( dSamplerate, m_iFilterLength );
m_pConvolver = new DSMBCConvolver( iBlocklength, m_iFilterLength );
m_pConvolver->setFilterExchangeMode( DSMBCConvolver::CROSSFADE_COSINE_SQUARE );
m_pConvolver = new ITAUPConvolution( iBlocklength, m_iFilterLength );
m_pConvolver->setFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
m_pConvolver->setFilterCrossfadeLength( 32 );
SetIdentity( false );
......@@ -55,22 +55,22 @@ public:
inline virtual void SetIdentity( bool bSmoothChangeover )
{
DSMBCFilter* pFilter = m_pConvolver->requestFilter();
ITAUPFilter* pFilter = m_pConvolver->requestFilter();
int iLatency = m_pGenerator->GetLatency();
assert( iLatency < m_iFilterLength );
fm_zero( m_pfFilter, m_iFilterLength );
m_pfFilter[ iLatency ] = 1;
pFilter->load( m_pfFilter, m_iFilterLength );
m_pConvolver->exchangeFilter( pFilter, ( bSmoothChangeover ? DSMBCConvolver::AUTO : DSMBCConvolver::SWITCH ) );
m_pConvolver->exchangeFilter( pFilter, ( bSmoothChangeover ? ITAUPConvolution::AUTO : ITAUPConvolution::SWITCH ) );
pFilter->release(); // Auto-release
}
inline virtual void SetGains( const CVAThirdOctaveMagnitudes& oGains, bool bSmoothChangeover = true )
{
m_pGenerator->GenerateFilter( oGains, m_pfFilter );
DSMBCFilter* pFilter = m_pConvolver->requestFilter();
ITAUPFilter* pFilter = m_pConvolver->requestFilter();
pFilter->load( m_pfFilter, m_iFilterLength );
m_pConvolver->exchangeFilter( pFilter, ( bSmoothChangeover ? DSMBCConvolver::AUTO : DSMBCConvolver::SWITCH ) );
m_pConvolver->exchangeFilter( pFilter, ( bSmoothChangeover ? ITAUPConvolution::AUTO : ITAUPConvolution::SWITCH ) );
pFilter->release(); // Auto-release
}
......@@ -95,7 +95,7 @@ private:
int m_iFilterLength;
float* m_pfFilter;
CVAThirdOctaveFIRFilterGenerator* m_pGenerator;
DSMBCConvolver* m_pConvolver;
ITAUPConvolution* m_pConvolver;
};
#endif // IW_VA_THIRDOCTAVEFILTERBANK_FIR
......@@ -26,9 +26,9 @@
// ITA includes
#include <DAFF.h>
#include <DSMBCConvolver.h>
#include <DSMBCFilter.h>
#include <DSMBCFilterPool.h>
#include <ITAUPConvolution.h>
#include <ITAUPFilter.h>
#include <ITAUPFilterPool.h>
#include <ITAAtomicPrimitives.h>
#include <ITAClock.h>
#include <ITACriticalSection.h>
......@@ -134,8 +134,8 @@ public:
CVAVariableDelayLine* pVariableDelayLine; //!< DSP-Element zur Bercksichtigung der Mediumsausbreitung in instationren Schallfeldern (inkl. Doppler-Effekt, falls aktiviert)
DSMBCConvolver* pFIRConvolverChL; //!< DSP-Element zur Faltung mit der Kopfbezogenen bertragungsfunktion im Zeitbereich (HRIR) - Links
DSMBCConvolver* pFIRConvolverChR; //!< DSP-Element zur Faltung mit der Kopfbezogenen bertragungsfunktion im Zeitbereich (HRIR) - Rechts
ITAUPConvolution* pFIRConvolverChL; //!< DSP-Element zur Faltung mit der Kopfbezogenen bertragungsfunktion im Zeitbereich (HRIR) - Links
ITAUPConvolution* pFIRConvolverChR; //!< DSP-Element zur Faltung mit der Kopfbezogenen bertragungsfunktion im Zeitbereich (HRIR) - Rechts
};
PropPath oDirSoundPath; //!< Direct sound propagation path
......@@ -794,10 +794,10 @@ void CVABinauralAirTrafficNoiseAudioRenderer::ProcessStream( const ITAStreamInfo
pPath->oDirSoundPath.pThirdOctaveFilterBank->Process( ctxAudio.m_sbTempBufD.data(), ctxAudio.m_sbTempBufD.data() ); // inplace
pPath->oRefSoundPath.pThirdOctaveFilterBank->Process( ctxAudio.m_sbTempBufR.data(), ctxAudio.m_sbTempBufR.data() ); // inplace
pPath->oDirSoundPath.pFIRConvolverChL->process( ctxAudio.m_sbTempBufD.data(), ( *pPath->pListener->psfOutput )[0].data(), DSMBCConvolver::OUTPUT_MIX );
pPath->oRefSoundPath.pFIRConvolverChL->process( ctxAudio.m_sbTempBufR.data(), ( *pPath->pListener->psfOutput )[0].data(), DSMBCConvolver::OUTPUT_MIX );
pPath->oDirSoundPath.pFIRConvolverChR->process( ctxAudio.m_sbTempBufD.data(), ( *pPath->pListener->psfOutput )[1].data(), DSMBCConvolver::OUTPUT_MIX );
pPath->oRefSoundPath.pFIRConvolverChR->process( ctxAudio.m_sbTempBufR.data(), ( *pPath->pListener->psfOutput )[1].data(), DSMBCConvolver::OUTPUT_MIX );
pPath->oDirSoundPath.pFIRConvolverChL->process( ctxAudio.m_sbTempBufD.data(), ( *pPath->pListener->psfOutput )[0].data(), ITAUPConvolution::OUTPUT_MIX );
pPath->oRefSoundPath.pFIRConvolverChL->process( ctxAudio.m_sbTempBufR.data(), ( *pPath->pListener->psfOutput )[0].data(), ITAUPConvolution::OUTPUT_MIX );
pPath->oDirSoundPath.pFIRConvolverChR->process( ctxAudio.m_sbTempBufD.data(), ( *pPath->pListener->psfOutput )[1].data(), ITAUPConvolution::OUTPUT_MIX );
pPath->oRefSoundPath.pFIRConvolverChR->process( ctxAudio.m_sbTempBufR.data(), ( *pPath->pListener->psfOutput )[1].data(), ITAUPConvolution::OUTPUT_MIX );
spit++;
}
......@@ -1177,14 +1177,14 @@ CVABATNSoundPath::CVABATNSoundPath( double dSamplerate, int iBlocklength, int iH
oDirSoundPath.pVariableDelayLine = new CVAVariableDelayLine( dSamplerate, iBlocklength, fReserverdMaxDelaySamples, m_iDefaultVDLSwitchingAlgorithm);
oRefSoundPath.pVariableDelayLine = new CVAVariableDelayLine( dSamplerate, iBlocklength, fReserverdMaxDelaySamples, m_iDefaultVDLSwitchingAlgorithm);
oDirSoundPath.pFIRConvolverChL = new DSMBCConvolver( iBlocklength, iHRIRFilterLength );
oRefSoundPath.pFIRConvolverChL = new DSMBCConvolver( iBlocklength, iHRIRFilterLength );
oDirSoundPath.pFIRConvolverChR = new DSMBCConvolver( iBlocklength, iHRIRFilterLength );
oRefSoundPath.pFIRConvolverChR = new DSMBCConvolver( iBlocklength, iHRIRFilterLength );
oDirSoundPath.pFIRConvolverChL->setFilterExchangeMode( DSMBCConvolver::CROSSFADE_COSINE_SQUARE );
oRefSoundPath.pFIRConvolverChL->setFilterExchangeMode( DSMBCConvolver::CROSSFADE_COSINE_SQUARE );
oDirSoundPath.pFIRConvolverChR->setFilterExchangeMode( DSMBCConvolver::CROSSFADE_COSINE_SQUARE );
oRefSoundPath.pFIRConvolverChR->setFilterExchangeMode( DSMBCConvolver::CROSSFADE_COSINE_SQUARE );
oDirSoundPath.pFIRConvolverChL = new ITAUPConvolution( iBlocklength, iHRIRFilterLength );
oRefSoundPath.pFIRConvolverChL = new ITAUPConvolution( iBlocklength, iHRIRFilterLength );
oDirSoundPath.pFIRConvolverChR = new ITAUPConvolution( iBlocklength, iHRIRFilterLength );
oRefSoundPath.pFIRConvolverChR = new ITAUPConvolution( iBlocklength, iHRIRFilterLength );
oDirSoundPath.pFIRConvolverChL->setFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
oRefSoundPath.pFIRConvolverChL->setFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
oDirSoundPath.pFIRConvolverChR->setFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
oRefSoundPath.pFIRConvolverChR->setFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
oDirSoundPath.pFIRConvolverChL->setFilterCrossfadeLength( (std::min)( iBlocklength, 32 ) );
oRefSoundPath.pFIRConvolverChL->setFilterCrossfadeLength( (std::min)( iBlocklength, 32 ) );
oDirSoundPath.pFIRConvolverChR->setFilterCrossfadeLength( (std::min)( iBlocklength, 32 ) );
......@@ -1193,10 +1193,10 @@ CVABATNSoundPath::CVABATNSoundPath( double dSamplerate, int iBlocklength, int iH
oRefSoundPath.pFIRConvolverChL->setGain( 0.0f, true );
oDirSoundPath.pFIRConvolverChR->setGain( 0.0f, true );
oRefSoundPath.pFIRConvolverChR->setGain( 0.0f, true );
DSMBCFilter* pDHRIRFilterChL = oDirSoundPath.pFIRConvolverChL->requestFilter();
DSMBCFilter* pRHRIRFilterChL = oRefSoundPath.pFIRConvolverChL->requestFilter();
DSMBCFilter* pDHRIRFilterChR = oDirSoundPath.pFIRConvolverChR->requestFilter();
DSMBCFilter* pRHRIRFilterChR = oRefSoundPath.pFIRConvolverChR->requestFilter();
ITAUPFilter* pDHRIRFilterChL = oDirSoundPath.pFIRConvolverChL->requestFilter();
ITAUPFilter* pRHRIRFilterChL = oRefSoundPath.pFIRConvolverChL->requestFilter();
ITAUPFilter* pDHRIRFilterChR = oDirSoundPath.pFIRConvolverChR->requestFilter();
ITAUPFilter* pRHRIRFilterChR = oRefSoundPath.pFIRConvolverChR->requestFilter();
pDHRIRFilterChL->identity();
pRHRIRFilterChL->identity();
pDHRIRFilterChR->identity();
......@@ -1407,8 +1407,8 @@ void CVABATNSoundPath::UpdateHRIR()
if( ( oDirSoundPath.oHRIRStateCur != oDirSoundPath.oHRIRStateNew ) || bForeUpdate )
{
DSMBCFilter* pHRIRFilterChL = oDirSoundPath.pFIRConvolverChL->getFilterPool()->requestFilter();
DSMBCFilter* pHRIRFilterChR = oDirSoundPath.pFIRConvolverChR->getFilterPool()->requestFilter();
ITAUPFilter* pHRIRFilterChL = oDirSoundPath.pFIRConvolverChL->getFilterPool()->requestFilter();
ITAUPFilter* pHRIRFilterChR = oDirSoundPath.pFIRConvolverChR->getFilterPool()->requestFilter();
if( pDirSoundPathHRIRDataNew == nullptr )
{
......@@ -1468,8 +1468,8 @@ void CVABATNSoundPath::UpdateHRIR()
if( ( oRefSoundPath.oHRIRStateCur != oRefSoundPath.oHRIRStateNew ) || bForeUpdate )
{
DSMBCFilter* pHRIRFilterChL = oRefSoundPath.pFIRConvolverChL->getFilterPool()->requestFilter();
DSMBCFilter* pHRIRFilterChR = oRefSoundPath.pFIRConvolverChR->getFilterPool()->requestFilter();
ITAUPFilter* pHRIRFilterChL = oRefSoundPath.pFIRConvolverChL->getFilterPool()->requestFilter();
ITAUPFilter* pHRIRFilterChR = oRefSoundPath.pFIRConvolverChR->getFilterPool()->requestFilter();
if( pRefSoundPathHRIRDataNew == nullptr )
{
......
......@@ -22,9 +22,9 @@
// ITA includes
#include <DAFF.h>
#include <DSMBCConvolver.h>
#include <DSMBCFilter.h>
#include <DSMBCFilterPool.h>
#include <ITAUPConvolution.h>
#include <ITAUPFilter.h>
#include <ITAUPFilterPool.h>
#include <ITAAtomicPrimitives.h>
#include <ITAClock.h>
#include <ITACriticalSection.h>
......@@ -813,8 +813,8 @@ void CVABinauralArtificialReverbAudioRenderer::ProcessStream( const ITAStreamInf
const float* pfIn = pListener->psbInput->data();
float* pfOutL = ( *pListener->psfOutput )[0].data();
float* pfOutR = ( *pListener->psfOutput )[1].data();
pListener->pConvolverL->process( pfIn, pfOutL, DSMBCConvolver::OUTPUT_OVERWRITE );
pListener->pConvolverR->process( pfIn, pfOutR, DSMBCConvolver::OUTPUT_OVERWRITE );
pListener->pConvolverL->process( pfIn, pfOutL, ITAUPConvolution::OUTPUT_OVERWRITE );
pListener->pConvolverR->process( pfIn, pfOutR, ITAUPConvolution::OUTPUT_OVERWRITE );
pListener->psbInput->Zero(); // clear input for next block
......@@ -977,12 +977,12 @@ CVABinauralArtificialReverbAudioRenderer::Listener* CVABinauralArtificialReverbA
pListener->psfOutput = new ITASampleFrame( 2, GetBlocklength(), true );
pListener->psbInput = new ITASampleBuffer( GetBlocklength(), true );
pListener->pConvolverL = new DSMBCConvolver( GetBlocklength(), m_iMaxReverbFilterLengthSamples );
pListener->pConvolverL->setFilterExchangeMode(DSMBCConvolver::CROSSFADE_COSINE_SQUARE);
pListener->pConvolverL = new ITAUPConvolution( GetBlocklength(), m_iMaxReverbFilterLengthSamples );
pListener->pConvolverL->setFilterExchangeMode(ITAUPConvolution::CROSSFADE_COSINE_SQUARE);
pListener->pConvolverL->setFilterCrossfadeLength( (std::min)( int( GetBlocklength() ), 32 ) );
pListener->pConvolverR = new DSMBCConvolver( GetBlocklength(), m_iMaxReverbFilterLengthSamples );
pListener->pConvolverR->setFilterExchangeMode(DSMBCConvolver::CROSSFADE_COSINE_SQUARE);
pListener->pConvolverR = new ITAUPConvolution( GetBlocklength(), m_iMaxReverbFilterLengthSamples );
pListener->pConvolverR->setFilterExchangeMode(ITAUPConvolution::CROSSFADE_COSINE_SQUARE);
pListener->pConvolverR->setFilterCrossfadeLength( (std::min)( int( GetBlocklength() ), 32 ) );
assert( pListener->pData );
......@@ -1417,8 +1417,8 @@ void CVABinauralArtificialReverbAudioRenderer::UpdateArtificialReverbFilter( Lis
VA_INFO( "CVABinauralArtificialReverbAudioRenderer", "Updating new artificial reverberation filter for listener '" << pListener->pData->sName << "'" );
DSMBCFilter* pBRIR_L = pListener->pConvolverL->requestFilter();
DSMBCFilter* pBRIR_R = pListener->pConvolverR->requestFilter();
ITAUPFilter* pBRIR_L = pListener->pConvolverL->requestFilter();
ITAUPFilter* pBRIR_R = pListener->pConvolverR->requestFilter();
pBRIR_L->load( ( sfBRIR )[0].data(), m_iMaxReverbFilterLengthSamples );
pBRIR_R->load( ( sfBRIR )[1].data(), m_iMaxReverbFilterLengthSamples );
......
......@@ -60,7 +60,7 @@ class CVASignalSourceManager;
class CVASoundSourceDesc;
// External forward declarations
class DSMBCConvolver;
class ITAUPConvolution;
// Internal forward declarations
class CBARPath;
......@@ -109,8 +109,8 @@ protected:
ITASampleBuffer* psbInput; //!< Accumulated listener input signals
ITASampleFrame* psfOutput; //!< Accumulated listener output signal (+reverb)
DSMBCConvolver* pConvolverL; //!< Artificial reverb filtering DSP element (left)
DSMBCConvolver* pConvolverR; //!< Artificial reverb filtering DSP element (right)
ITAUPConvolution* pConvolverL; //!< Artificial reverb filtering DSP element (left)
ITAUPConvolution* pConvolverR; //!< Artificial reverb filtering DSP element (right)
IVAHRIRDataset* pCurHRIR;
IVAHRIRDataset* pNewHRIR;
......
......@@ -24,9 +24,9 @@
// ITA includes
#include <DAFF.h>
#include <DSMBCConvolver.h>
#include <DSMBCFilter.h>
#include <DSMBCFilterPool.h>
#include <ITAUPConvolution.h>
#include <ITAUPFilter.h>
#include <ITAUPFilterPool.h>
#include <ITAAtomicPrimitives.h>
#include <ITAClock.h>
#include <ITACriticalSection.h>
......@@ -125,8 +125,8 @@ public:
CVAThirdOctaveFilterbank* pThirdOctaveFilterBank;
CVAVariableDelayLine* pVariableDelayLineChL;
CVAVariableDelayLine* pVariableDelayLineChR;
DSMBCConvolver* pFIRConvolverChL;
DSMBCConvolver* pFIRConvolverChR;
ITAUPConvolution* pFIRConvolverChL;
ITAUPConvolution* pFIRConvolverChR;
void PreRequest()
{
......@@ -734,8 +734,8 @@ void CVABinauralFreeFieldAudioRenderer::ProcessStream( const ITAStreamInfo* pStr
pPath->pThirdOctaveFilterBank->Process( psbInput->data(), ctxAudio.m_sbTempL.data() );
pPath->pVariableDelayLineChR->Process( &( ctxAudio.m_sbTempL ), &( ctxAudio.m_sbTempR ) );
pPath->pVariableDelayLineChL->Process( &( ctxAudio.m_sbTempL ), &( ctxAudio.m_sbTempL ) ); // inplace
pPath->pFIRConvolverChL->process( ctxAudio.m_sbTempL.data(), ( *pPath->pListener->psfOutput )[ 0 ].data(), DSMBCConvolver::OUTPUT_MIX );
pPath->pFIRConvolverChR->process( ctxAudio.m_sbTempR.data(), ( *pPath->pListener->psfOutput )[ 1 ].data(), DSMBCConvolver::OUTPUT_MIX );
pPath->pFIRConvolverChL->process( ctxAudio.m_sbTempL.data(), ( *pPath->pListener->psfOutput )[ 0 ].data(), ITAUPConvolution::OUTPUT_MIX );
pPath->pFIRConvolverChR->process( ctxAudio.m_sbTempR.data(), ( *pPath->pListener->psfOutput )[ 1 ].data(), ITAUPConvolution::OUTPUT_MIX );
spit++;
}
......@@ -1132,19 +1132,19 @@ CVABFFSoundPath::CVABFFSoundPath( double dSamplerate, int iBlocklength, int iHRI
pVariableDelayLineChL = new CVAVariableDelayLine( dSamplerate, iBlocklength, fReserverdMaxDelaySamples, m_iDefaultVDLSwitchingAlgorithm);
pVariableDelayLineChR = new CVAVariableDelayLine( dSamplerate, iBlocklength, fReserverdMaxDelaySamples, m_iDefaultVDLSwitchingAlgorithm);
pFIRConvolverChL = new DSMBCConvolver( iBlocklength, iHRIRFilterLength );
pFIRConvolverChL->setFilterExchangeMode( DSMBCConvolver::CROSSFADE_COSINE_SQUARE );
pFIRConvolverChL = new ITAUPConvolution( iBlocklength, iHRIRFilterLength );
pFIRConvolverChL->setFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pFIRConvolverChL->setFilterCrossfadeLength( (std::min)( iBlocklength, 32 ) );
pFIRConvolverChL->setGain( 0.0f, true );
DSMBCFilter* pHRIRFilterChL = pFIRConvolverChL->requestFilter();
ITAUPFilter* pHRIRFilterChL = pFIRConvolverChL->requestFilter();
pHRIRFilterChL->identity();
pFIRConvolverChL->exchangeFilter( pHRIRFilterChL );
pFIRConvolverChR = new DSMBCConvolver( iBlocklength, iHRIRFilterLength );
pFIRConvolverChR->setFilterExchangeMode( DSMBCConvolver::CROSSFADE_COSINE_SQUARE );
pFIRConvolverChR = new ITAUPConvolution( iBlocklength, iHRIRFilterLength );
pFIRConvolverChR->setFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pFIRConvolverChR->setFilterCrossfadeLength( (std::min)( iBlocklength, 32 ) );
pFIRConvolverChR->setGain( 0.0f, true );
DSMBCFilter* pHRIRFilterChR = pFIRConvolverChR->requestFilter();
ITAUPFilter* pHRIRFilterChR = pFIRConvolverChR->requestFilter();
pHRIRFilterChR->identity();
pFIRConvolverChL->exchangeFilter( pHRIRFilterChR );
......@@ -1256,8 +1256,8 @@ void CVABFFSoundPath::UpdateHRIR( const CVAListenerState::CVAAnthropometricParam
if( ( oHRIRStateCur != oHRIRStateNew ) || bForeUpdate )
{
DSMBCFilter* pHRIRFilterChL = pFIRConvolverChL->getFilterPool()->requestFilter();
DSMBCFilter* pHRIRFilterChR = pFIRConvolverChR->getFilterPool()->requestFilter();
ITAUPFilter* pHRIRFilterChL = pFIRConvolverChL->getFilterPool()->requestFilter();
ITAUPFilter* pHRIRFilterChR = pFIRConvolverChR->getFilterPool()->requestFilter();
if( pHRIRDataNew == nullptr )
{
......
......@@ -31,9 +31,9 @@
#include "../../../Utils/VAUtils.h"
#include <DAFF.h>
#include <DSMBCConvolver.h>
#include <DSMBCFilter.h>
#include <DSMBCFilterPool.h>
#include <ITAUPConvolution.h>
#include <ITAUPFilter.h>
#include <ITAUPFilterPool.h>
#include <ITAFastMath.h>
#include <ITAAtomicPrimitives.h>
#include <ITAAudiofileWriter.h>
......@@ -448,8 +448,8 @@ public:
//CVAThirdOctaveFilterbank* pDirectivyFilterBank; //!< DSP-Element zur Filterung von Third-Octave Datenstzen der Richtcharakteristik
CVAVariableDelayLine* pMediumPropagationVDL; //!< DSP-Element zur Bercksichtigung der Mediumsausbreitung in instationren Schallfeldern (inkl. Doppler-Effekt, falls aktiviert)
DSMBCConvolver* pRIRConvolverCh0; //!< DSP-Element zur Faltung der Raum-Impulsantwort (RIR) - Links
DSMBCConvolver* pRIRConvolverCh1; //!< DSP-Element zur altung der Raum-Impulsantwort (RIR) - Rechts
ITAUPConvolution* pRIRConvolverCh0; //!< DSP-Element zur Faltung der Raum-Impulsantwort (RIR) - Links
ITAUPConvolution* pRIRConvolverCh1; //!< DSP-Element zur altung der Raum-Impulsantwort (RIR) - Rechts
ITASampleFrame sfRIRDirectSoundPart; //!< Intern verwendeter Zwischenspeicher fr den Direktschallanteil der Raumimpulsantworten
ITASampleFrame sfRIREarlyReflectionsPart; //!< Intern verwendeter Zwischenspeicher fr die frhen Reflexionen der Raumimpulsantworten
......@@ -482,7 +482,7 @@ private:
ComplexSoundPath();
//! Konstruktor
ComplexSoundPath( double dSamplerate, int iBlocklength, int iFilterLength, DSMBCFilterPool* pParentFilterPool );
ComplexSoundPath( double dSamplerate, int iBlocklength, int iFilterLength, ITAUPFilterPool* pParentFilterPool );
int m_iDefaultVDLSwitchingAlgorithm; //!< Umsetzung der Verzgerungsnderung
bool m_bCurDopplerStatusEnabled; //!< Aktueller Status fr Doppler-Effekte
......@@ -508,7 +508,7 @@ class ComplexSoundPathFactory : public IVAPoolObjectFactory
public:
//! Konstruktor
ComplexSoundPathFactory(double dSamplerate, int iBlocklength, int iRIRFilterLength, DSMBCFilterPool* pParentFilterPool )
ComplexSoundPathFactory(double dSamplerate, int iBlocklength, int iRIRFilterLength, ITAUPFilterPool* pParentFilterPool )
: m_dSamplerate( dSamplerate )
, m_iBlocklength( iBlocklength )
, m_iRIRFilterLength( iRIRFilterLength )
......@@ -525,29 +525,29 @@ private:
double m_dSamplerate; //!< Abtastrate
int m_iBlocklength; //!< Blocklnge
int m_iRIRFilterLength; //!< Filterlnge der Raumimpulsantwort
DSMBCFilterPool* m_pParentFilterPool; //!< Pool fr Raumimpulsantworten
ITAUPFilterPool* m_pParentFilterPool; //!< Pool fr Raumimpulsantworten
};
// --= Klasse ComplexSoundPath =--
ComplexSoundPath::ComplexSoundPath( double dSamplerate, int iBlocklength, int iRIRFilterLength, DSMBCFilterPool* pParentFilterPool )
ComplexSoundPath::ComplexSoundPath( double dSamplerate, int iBlocklength, int iRIRFilterLength, ITAUPFilterPool* pParentFilterPool )
: m_pRenderer( nullptr )
{
// Falter
int iRIRConvolverLength = pParentFilterPool->getMaxFilterlength();
pRIRConvolverCh0 = new DSMBCConvolver( iBlocklength, iRIRConvolverLength, pParentFilterPool );
pRIRConvolverCh0->setFilterExchangeMode( DSMBCConvolver::CROSSFADE_COSINE_SQUARE );
pRIRConvolverCh0 = new ITAUPConvolution( iBlocklength, iRIRConvolverLength, pParentFilterPool );
pRIRConvolverCh0->setFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pRIRConvolverCh0->setFilterCrossfadeLength( (std::min)( iBlocklength, 32 ) );
DSMBCFilter* pRIRFilterCh0 = pRIRConvolverCh0->requestFilter();
ITAUPFilter* pRIRFilterCh0 = pRIRConvolverCh0->requestFilter();
pRIRFilterCh0->zeros();
pRIRConvolverCh0->exchangeFilter( pRIRFilterCh0 );
pRIRConvolverCh0->releaseFilter( pRIRFilterCh0 );
pRIRConvolverCh1 = new DSMBCConvolver( iBlocklength, iRIRConvolverLength, pParentFilterPool );
pRIRConvolverCh1->setFilterExchangeMode( DSMBCConvolver::CROSSFADE_COSINE_SQUARE );
pRIRConvolverCh1 = new ITAUPConvolution( iBlocklength, iRIRConvolverLength, pParentFilterPool );
pRIRConvolverCh1->setFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pRIRConvolverCh1->setFilterCrossfadeLength( (std::min)( iBlocklength, 32 ) );
DSMBCFilter* pRIRFilterCh1 = pRIRConvolverCh1->requestFilter();
ITAUPFilter* pRIRFilterCh1 = pRIRConvolverCh1->requestFilter();
pRIRFilterCh1->zeros();
pRIRConvolverCh1->exchangeFilter( pRIRFilterCh1 );
pRIRConvolverCh1->releaseFilter( pRIRFilterCh1 );
......@@ -875,8 +875,8 @@ void ComplexSoundPath::ExchangeFilter()
m_csRIRDiffuseDecayAssembly.leave();
}
DSMBCFilter* pRIRFilterCh0 = pRIRConvolverCh0->requestFilter();
DSMBCFilter* pRIRFilterCh1 = pRIRConvolverCh1->requestFilter();
ITAUPFilter* pRIRFilterCh0 = pRIRConvolverCh0->requestFilter();
ITAUPFilter* pRIRFilterCh1 = pRIRConvolverCh1->requestFilter();
float* pfRIRDataCh0 = sfRIRTemp[0].data();
float* pfRIRDataCh1 = sfRIRTemp[1].data();
......@@ -1142,7 +1142,7 @@ CVARoomAcousticsAudioRenderer::CVARoomAcousticsAudioRenderer(const CVAAudioRende
// Lnge der Faltungsmaschine
int iConvolverLength = 22100;
m_pRIRFilterPool = new DSMBCFilterPool( GetBlocklength(), iConvolverLength, 32 );
m_pRIRFilterPool = new ITAUPFilterPool( GetBlocklength(), iConvolverLength, 32 );
int iRIRLength = (int)( 9 * GetSampleRate() );
m_pComplexSoundPathFactory = new ComplexSoundPathFactory( GetSampleRate(), GetBlocklength(), iRIRLength, m_pRIRFilterPool );
......@@ -1829,12 +1829,12 @@ void CVARoomAcousticsAudioRenderer::ProcessStream( const ITAStreamInfo* pStreamI
}
pPath->pMediumPropagationVDL->Process( psbInput, &m_psbVDLTempOut );
pPath->pRIRConvolverCh0->process( m_psbVDLTempOut.data(), pfOutputCh0, DSMBCConvolver::OUTPUT_MIX );
pPath->pRIRConvolverCh1->process( m_psbVDLTempOut.data(), pfOutputCh1, DSMBCConvolver::OUTPUT_MIX );
pPath->pRIRConvolverCh0->process( m_psbVDLTempOut.data(), pfOutputCh0, ITAUPConvolution::OUTPUT_MIX );
pPath->pRIRConvolverCh1->process( m_psbVDLTempOut.data(), pfOutputCh1, ITAUPConvolution::OUTPUT_MIX );
// Direct in, no VDL
//pPath->pRIRConvolverCh0->process(psbInput->data(), pfOutputCh0, DSMBCConvolver::OUTPUT_MIX );
//pPath->pRIRConvolverCh1->process(psbInput->data(), pfOutputCh1, DSMBCConvolver::OUTPUT_MIX );
//pPath->pRIRConvolverCh0->process(psbInput->data(), pfOutputCh0, ITAUPConvolution::OUTPUT_MIX );
//pPath->pRIRConvolverCh1->process(psbInput->data(), pfOutputCh1, ITAUPConvolution::OUTPUT_MIX );
pPath->oProfiler.dLastConvProcessing = pPath->oProfiler.swConvolve.stop();
m_swConvolveStream.stop();
......
......@@ -68,7 +68,7 @@ class CVARavenLocalScheduler;
class CVARoomAcousticsSimulationTaskCreator;
class ComplexSoundPath;
class ComplexSoundPathFactory;
class DSMBCFilterPool;
class ITAUPFilterPool;
class Listener;
//class Portal;
class Source;
......@@ -203,7 +203,7 @@ private:
IVAObjectPool* m_pSourcePool; //!< Speichermanagement fr Quellen
IVAObjectPool* m_pListenerPool; //!< Speichermanagement fr Hrer
DSMBCFilterPool* m_pRIRFilterPool; //!< Speichermanagement fr Raumimpulsantworten/Simulationsergebnisse
ITAUPFilterPool* m_pRIRFilterPool; //!< Speichermanagement fr Raumimpulsantworten/Simulationsergebnisse
CVAThirdOctaveFIRFilterGenerator* m_pThirdOctaveFIRFilterGenerator; //!< Filter-Generator fr Impulsantworten aus Terzbandsprektren
ITACriticalSection m_csFilterGenerator; //!< Geteilte Resource "Filter-Generator" vor reentrance schtzen
......
......@@ -12,9 +12,9 @@
#include <VAReferenceableObject.h>
// ITA includes
#include <DSMBCConvolver.h>
#include <DSMBCFilter.h>
#include <DSMBCFilterPool.h>
#include <ITAUPConvolution.h>
#include <ITAUPFilter.h>
#include <ITAUPFilterPool.h>
#include <ITAAtomicPrimitives.h>
#include <ITADataSourceRealization.h>
......@@ -38,7 +38,7 @@ public:
CVAPTGenericPathAudioRenderer::CVAPTGPListener* pListener;
ITAAtomicBool bDelete;
std::vector< DSMBCConvolver* > vpFIRConvolver; // N-channel convolver
std::vector< ITAUPConvolution* > vpFIRConvolver; // N-channel convolver
void PreRequest()
{
pSource = nullptr;
......@@ -121,11 +121,11 @@ CVAPTGenericSoundPath::CVAPTGenericSoundPath( double dSamplerate, int iBlockleng
for( int n=0; n<iNumChannels; n++ )
{
DSMBCConvolver* pFIRConvolver = new DSMBCConvolver( iBlocklength, iIRFilterLength );
pFIRConvolver->setFilterExchangeMode( DSMBCConvolver::CROSSFADE_COSINE_SQUARE );
ITAUPConvolution* pFIRConvolver = new ITAUPConvolution( iBlocklength, iIRFilterLength );
pFIRConvolver->setFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pFIRConvolver->setFilterCrossfadeLength( (std::min)( iBlocklength, 32 ) );
pFIRConvolver->setGain( 1.0f, true );
DSMBCFilter* pHRIRFilterChL = pFIRConvolver->requestFilter();
ITAUPFilter* pHRIRFilterChL = pFIRConvolver->requestFilter();
pHRIRFilterChL->zeros();
pFIRConvolver->exchangeFilter( pHRIRFilterChL );
pFIRConvolver->releaseFilter( pHRIRFilterChL );
......@@ -685,8 +685,8 @@ void CVAPTGenericPathAudioRenderer::UpdateGenericSoundPath( int iListenerID, int
{
for( int n=0; n<m_iNumChannels; n++ )
{
DSMBCConvolver* pConvolver( pPath->vpFIRConvolver[n] );
DSMBCFilter* pFilter = pConvolver->requestFilter();
ITAUPConvolution* pConvolver( pPath->vpFIRConvolver[n] );
ITAUPFilter* pFilter = pConvolver->requestFilter();
pFilter->zeros();
int iLength = (std::min)( m_iIRFilterLengthSamples, sfIR.length() );
pFilter->load( sfIR[n].data(), iLength );
......@@ -719,8 +719,8 @@ void CVAPTGenericPathAudioRenderer::UpdateGenericSoundPath( int iListenerID, int
CVAPTGenericSoundPath* pPath( *spcit++ );
if( pPath->pListener->pData->iID == iListenerID && pPath->pSource->pData->iID == iSourceID )
{
DSMBCConvolver* pConvolver( pPath->vpFIRConvolver[iChannelIndex] );
DSMBCFilter* pFilter = pConvolver->requestFilter();
ITAUPConvolution* pConvolver( pPath->vpFIRConvolver[iChannelIndex] );
ITAUPFilter* pFilter = pConvolver->requestFilter();
pFilter->zeros();
int iLength = (std::min)( m_iIRFilterLengthSamples, sbIR.length() );
pFilter->load( sbIR.data(), iLength );
......@@ -793,9 +793,9 @@ void CVAPTGenericPathAudioRenderer::HandleProcessStream( ITADatasourceRealizatio
for( int n=0; n < m_iNumChannels; n++ )
{
DSMBCConvolver* pConvolver = pPath->vpFIRConvolver[n];
ITAUPConvolution* pConvolver = pPath->vpFIRConvolver[n];
pConvolver->setGain( fSoundSourceGain );
pConvolver->process( psbInput->data(), ( *pPath->pListener->psfOutput )[n].data(), DSMBCConvolver::OUTPUT_MIX );
pConvolver->process( psbInput->data(), ( *pPath->pListener->psfOutput )[n].data(), ITAUPConvolution::OUTPUT_MIX );
}
spit++;
......
......@@ -24,9 +24,9 @@
// ITA includes
#include <DAFF.h>
#include <DSMBCConvolver.h>
#include <DSMBCFilter.h>
#include <DSMBCFilterPool.h>
#include <ITAUPConvolution.h>
#include <ITAUPFilter.h>
#include <ITAUPFilterPool.h>
#include <ITAAtomicPrimitives.h>
#include <ITAClock.h>
#include <ITACriticalSection.h>
......@@ -124,10 +124,10 @@ public:
CVAThirdOctaveFilterbank* pThirdOctaveFilterBank;
CVAVariableDelayLine* pVariableDelayLine;
DSMBCConvolver* pFIRConvolverChL1;
DSMBCConvolver* pFIRConvolverChL2;
DSMBCConvolver* pFIRConvolverChR1;
DSMBCConvolver* pFIRConvolverChR2;
ITAUPConvolution* pFIRConvolverChL1;
ITAUPConvolution* pFIRConvolverChL2;
ITAUPConvolution* pFIRConvolverChR1;
ITAUPConvolution* pFIRConvolverChR2;
void PreRequest()
{
......@@ -721,10 +721,10 @@ void CVAPTHearingAidRenderer::ProcessStream( const ITAStreamInfo* pStreamInfo )
pPath->pVariableDelayLine->Process( psbInput, &(ctxAudio.m_sbTemp) );
pPath->pThirdOctaveFilterBank->Process( ctxAudio.m_sbTemp.data(), ctxAudio.m_sbTemp.data() ); // inplace
pPath->pFIRConvolverChL1->process( ctxAudio.m_sbTemp.data(), ( *pPath->pListener->psfOutput )[0].data(), DSMBCConvolver::OUTPUT_MIX );
pPath->pFIRConvolverChR1->process( ctxAudio.m_sbTemp.data(), ( *pPath->pListener->psfOutput )[1].data(), DSMBCConvolver::OUTPUT_MIX );
pPath->pFIRConvolverChL2->process( ctxAudio.m_sbTemp.data(), ( *pPath->pListener->psfOutput )[2].data(), DSMBCConvolver::OUTPUT_MIX );
pPath->pFIRConvolverChR2->process( ctxAudio.m_sbTemp.data(), ( *pPath->pListener->psfOutput )[3].data(), DSMBCConvolver::OUTPUT_MIX );
pPath->pFIRConvolverChL1->process( ctxAudio.m_sbTemp.data(), ( *pPath->pListener->psfOutput )[0].data(), ITAUPConvolution::OUTPUT_MIX );
pPath->pFIRConvolverChR1->process( ctxAudio.m_sbTemp.data(), ( *pPath->pListener->psfOutput )[1].data(), ITAUPConvolution::OUTPUT_MIX );
pPath->pFIRConvolverChL2->process( ctxAudio.m_sbTemp.data(), ( *pPath->pListener->psfOutput )[2].data(), ITAUPConvolution::OUTPUT_MIX );
pPath->pFIRConvolverChR2->process( ctxAudio.m_sbTemp.data(), ( *pPath->pListener->psfOutput )[3].data(), ITAUPConvolution::OUTPUT_MIX );
spit++;
}
......@@ -1191,35 +1191,35 @@ CVAPTHASoundPath::CVAPTHASoundPath( double dSamplerate, int iBlocklength, int iH
m_iDefaultVDLSwitchingAlgorithm = CVAVariableDelayLine::CUBIC_SPLINE_INTERPOLATION;
pVariableDelayLine = new CVAVariableDelayLine(dSamplerate, iBlocklength, fReserverdMaxDelaySamples, m_iDefaultVDLSwitchingAlgorithm);
pFIRConvolverChL1 = new DSMBCConvolver(iBlocklength, iHRIRFilterLength);
pFIRConvolverChL1->setFilterExchangeMode(DSMBCConvolver::CROSSFADE_COSINE_SQUARE);
pFIRConvolverChL1 = new ITAUPConvolution(iBlocklength, iHRIRFilterLength);
pFIRConvolverChL1->setFilterExchangeMode(ITAUPConvolution::CROSSFADE_COSINE_SQUARE);
pFIRConvolverChL1->setFilterCrossfadeLength((std::min)(iBlocklength, 32));
pFIRConvolverChL1->setGain(0, true);
DSMBCFilter* pHRIRFilterChL1 = pFIRConvolverChL1->requestFilter();
ITAUPFilter* pHRIRFilterChL1 = pFIRConvolverChL1->requestFilter();
pHRIRFilterChL1->identity();
pFIRConvolverChL1->exchangeFilter( pHRIRFilterChL1 );
pFIRConvolverChL2 = new DSMBCConvolver(iBlocklength, iHRIRFilterLength);
pFIRConvolverChL2->setFilterExchangeMode(DSMBCConvolver::CROSSFADE_COSINE_SQUARE);
pFIRConvolverChL2 = new ITAUPConvolution(iBlocklength, iHRIRFilterLength);
pFIRConvolverChL2->setFilterExchangeMode(ITAUPConvolution::CROSSFADE_COSINE_SQUARE);
pFIRConvolverChL2->setFilterCrossfadeLength((std::min)(iBlocklength, 32));