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 1371d5d4 authored by Jonas Stienen's avatar Jonas Stienen
Browse files

Updating refactoring changes for uniform paritioned convolution

parent e2388d25
......@@ -40,8 +40,8 @@ public:
m_pGenerator = new CVAThirdOctaveFIRFilterGenerator( dSamplerate, m_iFilterLength );
m_pConvolver = new ITAUPConvolution( iBlocklength, m_iFilterLength );
m_pConvolver->setFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
m_pConvolver->setFilterCrossfadeLength( 32 );
m_pConvolver->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
m_pConvolver->SetFilterCrossfadeLength( 32 );
SetIdentity( false );
}
......@@ -55,23 +55,23 @@ public:
inline virtual void SetIdentity( bool bSmoothChangeover )
{
ITAUPFilter* 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 ? ITAUPConvolution::AUTO : ITAUPConvolution::SWITCH ) );
pFilter->release(); // Auto-release
pFilter->Load( m_pfFilter, m_iFilterLength );
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 );
ITAUPFilter* pFilter = m_pConvolver->requestFilter();
pFilter->load( m_pfFilter, m_iFilterLength );
m_pConvolver->exchangeFilter( pFilter, ( bSmoothChangeover ? ITAUPConvolution::AUTO : ITAUPConvolution::SWITCH ) );
pFilter->release(); // Auto-release
ITAUPFilter* pFilter = m_pConvolver->RequestFilter();
pFilter->Load( m_pfFilter, m_iFilterLength );
m_pConvolver->ExchangeFilter( pFilter, ( bSmoothChangeover ? ITAUPConvolution::AUTO : ITAUPConvolution::SWITCH ) );
pFilter->Release(); // Auto-release
}
inline int GetLatency() const
......@@ -87,7 +87,7 @@ public:
inline virtual void Process( const float* pfInputSamples, float* pfOutputSamples )
{
m_pConvolver->process( pfInputSamples, m_iBlocklength, pfOutputSamples, m_iBlocklength );
m_pConvolver->Process( pfInputSamples, m_iBlocklength, pfOutputSamples, m_iBlocklength );
}
private:
......
......@@ -2,14 +2,14 @@
*
* VVV VVV A
* VVV VVV AAA Virtual Acoustics
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA
* VVVVVV AAA (c) Copyright Institut fr Technische Akustik (ITA)
* VVVV AAA RWTH Aachen (http://www.akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
*
* Datei: VASampleAndHoldMotionModel.h
* Datei: VASampleAndHoldMotionModel.h
*
* Zweck: Rudimentres Bewegungsmodell
*
......@@ -17,7 +17,7 @@
*
* ---------------------------------------------------------------------------------
*/
// $Id: VAMotionModel.h 3099 2013-03-18 17:48:12Z stienen $
#ifndef __VA_SAMPLEANDHOLDMOTIONMODEL__
......@@ -29,49 +29,54 @@
#include <ITADataLog.h>
//! Implementierung eines Bewegungsmodells mit Sample-and-Hold Funktionalitt
class CVASampleAndHoldMotionModel : public IVAMotionModel {
class CVASampleAndHoldMotionModel : public IVAMotionModel
{
public:
CVASampleAndHoldMotionModel() : m_pLastState(nullptr), m_dStartTime(0)
inline CVASampleAndHoldMotionModel()
: m_pLastState( nullptr )
, m_dStartTime( 0 )
{
char buf1[ 255 ];
sprintf( buf1, "SampleAndHoldMotionModel_Estimation_0x%08Xh.log", this );
m_oEstimationDataLog.setOutputFile( buf1 );
char buf2[ 255 ];
sprintf( buf2, "SampleAndHoldMotionModel_Input_0x%08Xh.log", this );
m_oInputDataLog.setOutputFile( buf2 );
};
inline ~CVASampleAndHoldMotionModel()
{
char buf1[255];
sprintf(buf1, "SampleAndHoldMotionModel_Estimation_0x%08Xh.log", this);
m_oEstimationDataLog.setOutputFile(buf1);
char buf2[255];
sprintf(buf2, "SampleAndHoldMotionModel_Input_0x%08Xh.log", this);
m_oInputDataLog.setOutputFile(buf2);
}
~CVASampleAndHoldMotionModel() {
if (m_pLastState) m_pLastState->RemoveReference();
}
void InputMotionKey(const CVAMotionState* pNewState) {
if (m_dStartTime == 0) m_dStartTime = pNewState->GetModificationTime();
if (m_pLastState) m_pLastState->RemoveReference();
if( m_pLastState ) m_pLastState->RemoveReference();
};
inline void InputMotionKey( const CVAMotionState* pNewState )
{
if( m_dStartTime == 0 ) m_dStartTime = pNewState->GetModificationTime();
if( m_pLastState ) m_pLastState->RemoveReference();
m_pLastState = pNewState;
if (pNewState) pNewState->AddReference();
if( pNewState ) pNewState->AddReference();
MotionLogDataInput oLogItem;
oLogItem.dTime = pNewState->GetModificationTime() - m_dStartTime; // Bessere Auflsung
oLogItem.vPos = pNewState->GetPosition();
m_oInputDataLog.log(oLogItem);
}
m_oInputDataLog.log( oLogItem );
};
bool EstimatePosition( double dTime, VAVec3& vPos )
inline bool EstimatePosition( double dTime, VAVec3& vPos )
{
if( m_pLastState == nullptr )
return false;
vPos = m_pLastState->GetPosition();
MotionLogDataOutput oLogItem;
oLogItem.dTime = dTime - m_dStartTime;
oLogItem.vPos = vPos;
m_oEstimationDataLog.log(oLogItem);
m_oEstimationDataLog.log( oLogItem );
return true;
}
};
bool EstimateOrientation( double, VAVec3& vView, VAVec3& vUp )
inline bool EstimateOrientation( double, VAVec3& vView, VAVec3& vUp )
{
if( m_pLastState )
{
......@@ -80,9 +85,9 @@ public:
return true;
}
return false;
}
};
bool EstimateOrientation( double, VAOrientYPR& oOrient )
inline bool EstimateOrientation( double, VAOrientYPR& oOrient )
{
if( m_pLastState )
{
......@@ -90,23 +95,24 @@ public:
return true;
}
return false;
}
};
void Reset()
inline void Reset()
{
m_oInputDataLog.clear();
m_oEstimationDataLog.clear();
}
};
private:
const CVAMotionState* m_pLastState;
double m_dStartTime;
//! Implementierungsklasse fr Logger-Datum
class MotionLogDataOutput : ITALogDataBase {
class MotionLogDataOutput : ITALogDataBase
{
public:
static std::ostream& outputDesc(std::ostream& os);
std::ostream& outputData(std::ostream& os) const;
static std::ostream& outputDesc( std::ostream& os );
std::ostream& outputData( std::ostream& os ) const;
double dTime;
VAVec3 vPos;
......@@ -115,10 +121,11 @@ private:
ITABufferedDataLogger<MotionLogDataOutput> m_oEstimationDataLog; //!< Logger Datum fr VDL spezifische Prozess-Information
//! Implementierungsklasse fr Logger-Datum
class MotionLogDataInput : ITALogDataBase {
class MotionLogDataInput : ITALogDataBase
{
public:
static std::ostream& outputDesc(std::ostream& os);
std::ostream& outputData(std::ostream& os) const;
static std::ostream& outputDesc( std::ostream& os );
std::ostream& outputData( std::ostream& os ) const;
double dTime;
VAVec3 vPos;
......
......@@ -767,10 +767,10 @@ void CVABinauralAirTrafficNoiseAudioRenderer::ProcessStream( const ITAStreamInfo
fRefSoundPathSoundSourceGain = 0.0f;
}
pPath->oDirSoundPath.pFIRConvolverChL->setGain( fDirSoundPathSoundSourceGain );
pPath->oRefSoundPath.pFIRConvolverChL->setGain( fRefSoundPathSoundSourceGain );
pPath->oDirSoundPath.pFIRConvolverChR->setGain( fDirSoundPathSoundSourceGain );
pPath->oRefSoundPath.pFIRConvolverChR->setGain( fRefSoundPathSoundSourceGain );
pPath->oDirSoundPath.pFIRConvolverChL->SetGain( fDirSoundPathSoundSourceGain );
pPath->oRefSoundPath.pFIRConvolverChL->SetGain( fRefSoundPathSoundSourceGain );
pPath->oDirSoundPath.pFIRConvolverChR->SetGain( fDirSoundPathSoundSourceGain );
pPath->oRefSoundPath.pFIRConvolverChR->SetGain( fRefSoundPathSoundSourceGain );
// Assemble and set third octave gains
pPath->oDirSoundPath.oThirdOctaveFilterMagnitudes = pPath->oDirSoundPath.oAirAttenuationMagnitudes;
......@@ -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(), 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 );
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++;
}
......@@ -1181,36 +1181,36 @@ CVABATNSoundPath::CVABATNSoundPath( double dSamplerate, int iBlocklength, int iH
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 ) );
oRefSoundPath.pFIRConvolverChR->setFilterCrossfadeLength( (std::min)( iBlocklength, 32 ) );
oDirSoundPath.pFIRConvolverChL->setGain( 0.0f, true );
oRefSoundPath.pFIRConvolverChL->setGain( 0.0f, true );
oDirSoundPath.pFIRConvolverChR->setGain( 0.0f, true );
oRefSoundPath.pFIRConvolverChR->setGain( 0.0f, true );
ITAUPFilter* pDHRIRFilterChL = oDirSoundPath.pFIRConvolverChL->requestFilter();
ITAUPFilter* pRHRIRFilterChL = oRefSoundPath.pFIRConvolverChL->requestFilter();
ITAUPFilter* pDHRIRFilterChR = oDirSoundPath.pFIRConvolverChR->requestFilter();
ITAUPFilter* pRHRIRFilterChR = oRefSoundPath.pFIRConvolverChR->requestFilter();
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 ) );
oRefSoundPath.pFIRConvolverChR->SetFilterCrossfadeLength( (std::min)( iBlocklength, 32 ) );
oDirSoundPath.pFIRConvolverChL->SetGain( 0.0f, true );
oRefSoundPath.pFIRConvolverChL->SetGain( 0.0f, true );
oDirSoundPath.pFIRConvolverChR->SetGain( 0.0f, true );
oRefSoundPath.pFIRConvolverChR->SetGain( 0.0f, true );
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();
pRHRIRFilterChR->identity();
oDirSoundPath.pFIRConvolverChL->exchangeFilter( pDHRIRFilterChL );
oRefSoundPath.pFIRConvolverChL->exchangeFilter( pRHRIRFilterChL );
oDirSoundPath.pFIRConvolverChR->exchangeFilter( pDHRIRFilterChR );
oRefSoundPath.pFIRConvolverChR->exchangeFilter( pRHRIRFilterChR );
oDirSoundPath.pFIRConvolverChL->ExchangeFilter( pDHRIRFilterChL );
oRefSoundPath.pFIRConvolverChL->ExchangeFilter( pRHRIRFilterChL );
oDirSoundPath.pFIRConvolverChR->ExchangeFilter( pDHRIRFilterChR );
oRefSoundPath.pFIRConvolverChR->ExchangeFilter( pRHRIRFilterChR );
// Auto-release filter after it is not used anymore
oDirSoundPath.pFIRConvolverChL->releaseFilter( pDHRIRFilterChL );
oRefSoundPath.pFIRConvolverChL->releaseFilter( pRHRIRFilterChL );
oDirSoundPath.pFIRConvolverChR->releaseFilter( pDHRIRFilterChR );
oRefSoundPath.pFIRConvolverChR->releaseFilter( pRHRIRFilterChR );
oDirSoundPath.pFIRConvolverChL->ReleaseFilter( pDHRIRFilterChL );
oRefSoundPath.pFIRConvolverChL->ReleaseFilter( pRHRIRFilterChL );
oDirSoundPath.pFIRConvolverChR->ReleaseFilter( pDHRIRFilterChR );
oRefSoundPath.pFIRConvolverChR->ReleaseFilter( pRHRIRFilterChR );
m_sfHRIRTemp.init( 2, iHRIRFilterLength, false );
......@@ -1407,8 +1407,8 @@ void CVABATNSoundPath::UpdateHRIR()
if( ( oDirSoundPath.oHRIRStateCur != oDirSoundPath.oHRIRStateNew ) || bForeUpdate )
{
ITAUPFilter* pHRIRFilterChL = oDirSoundPath.pFIRConvolverChL->getFilterPool()->requestFilter();
ITAUPFilter* pHRIRFilterChR = oDirSoundPath.pFIRConvolverChR->getFilterPool()->requestFilter();
ITAUPFilter* pHRIRFilterChL = oDirSoundPath.pFIRConvolverChL->GetFilterPool()->RequestFilter();
ITAUPFilter* pHRIRFilterChR = oDirSoundPath.pFIRConvolverChR->GetFilterPool()->RequestFilter();
if( pDirSoundPathHRIRDataNew == nullptr )
{
......@@ -1423,10 +1423,10 @@ void CVABATNSoundPath::UpdateHRIR()
m_sfHRIRTemp.init( 2, iNewFilterLength, false );
}
if( iNewFilterLength > oDirSoundPath.pFIRConvolverChL->getMaxFilterlength() )
if( iNewFilterLength > oDirSoundPath.pFIRConvolverChL->GetMaxFilterlength() )
{
VA_WARN( "CVABATNSoundPath", "HRIR too long for convolver, cropping. Increase HRIR filter length in BinauralFreefieldAudioRenderer configuration." );
iNewFilterLength = oDirSoundPath.pFIRConvolverChL->getMaxFilterlength();
iNewFilterLength = oDirSoundPath.pFIRConvolverChL->GetMaxFilterlength();
}
if( pDirSoundPathHRIRDataNew->GetProperties()->bSpaceDiscrete )
......@@ -1440,14 +1440,14 @@ void CVABATNSoundPath::UpdateHRIR()
float( oDirSoundPath.oRelations.dAzimuthL2S ), float( oDirSoundPath.oRelations.dElevationL2S ), float( oDirSoundPath.oRelations.dDistance ) );
}
pHRIRFilterChL->load( m_sfHRIRTemp[0].data(), iNewFilterLength );
pHRIRFilterChR->load( m_sfHRIRTemp[1].data(), iNewFilterLength );
pHRIRFilterChL->Load( m_sfHRIRTemp[0].data(), iNewFilterLength );
pHRIRFilterChR->Load( m_sfHRIRTemp[1].data(), iNewFilterLength );
}
oDirSoundPath.pFIRConvolverChL->exchangeFilter( pHRIRFilterChL );
oDirSoundPath.pFIRConvolverChR->exchangeFilter( pHRIRFilterChR );
oDirSoundPath.pFIRConvolverChL->releaseFilter( pHRIRFilterChL );
oDirSoundPath.pFIRConvolverChR->releaseFilter( pHRIRFilterChR );
oDirSoundPath.pFIRConvolverChL->ExchangeFilter( pHRIRFilterChL );
oDirSoundPath.pFIRConvolverChR->ExchangeFilter( pHRIRFilterChR );
oDirSoundPath.pFIRConvolverChL->ReleaseFilter( pHRIRFilterChL );
oDirSoundPath.pFIRConvolverChR->ReleaseFilter( pHRIRFilterChR );
// Ack
oDirSoundPath.oHRIRStateCur = oDirSoundPath.oHRIRStateNew;
......@@ -1468,8 +1468,8 @@ void CVABATNSoundPath::UpdateHRIR()
if( ( oRefSoundPath.oHRIRStateCur != oRefSoundPath.oHRIRStateNew ) || bForeUpdate )
{
ITAUPFilter* pHRIRFilterChL = oRefSoundPath.pFIRConvolverChL->getFilterPool()->requestFilter();
ITAUPFilter* pHRIRFilterChR = oRefSoundPath.pFIRConvolverChR->getFilterPool()->requestFilter();
ITAUPFilter* pHRIRFilterChL = oRefSoundPath.pFIRConvolverChL->GetFilterPool()->RequestFilter();
ITAUPFilter* pHRIRFilterChR = oRefSoundPath.pFIRConvolverChR->GetFilterPool()->RequestFilter();
if( pRefSoundPathHRIRDataNew == nullptr )
{
......@@ -1484,10 +1484,10 @@ void CVABATNSoundPath::UpdateHRIR()
m_sfHRIRTemp.init( 2, iNewFilterLength, false );
}
if( iNewFilterLength > oRefSoundPath.pFIRConvolverChL->getMaxFilterlength() )
if( iNewFilterLength > oRefSoundPath.pFIRConvolverChL->GetMaxFilterlength() )
{
VA_WARN( "CVABATNSoundPath", "HRIR too long for convolver, cropping. Increase HRIR filter length in BinauralFreefieldAudioRenderer configuration." );
iNewFilterLength = oRefSoundPath.pFIRConvolverChL->getMaxFilterlength();
iNewFilterLength = oRefSoundPath.pFIRConvolverChL->GetMaxFilterlength();
}
if( pRefSoundPathHRIRDataNew->GetProperties()->bSpaceDiscrete )
......@@ -1501,14 +1501,14 @@ void CVABATNSoundPath::UpdateHRIR()
float( oRefSoundPath.oRelations.dAzimuthL2S ), float( oRefSoundPath.oRelations.dElevationL2S ), float( oRefSoundPath.oRelations.dDistance ) );
}
pHRIRFilterChL->load( m_sfHRIRTemp[0].data(), iNewFilterLength );
pHRIRFilterChR->load( m_sfHRIRTemp[1].data(), iNewFilterLength );
pHRIRFilterChL->Load( m_sfHRIRTemp[0].data(), iNewFilterLength );
pHRIRFilterChR->Load( m_sfHRIRTemp[1].data(), iNewFilterLength );
}
oRefSoundPath.pFIRConvolverChL->exchangeFilter( pHRIRFilterChL );
oRefSoundPath.pFIRConvolverChR->exchangeFilter( pHRIRFilterChR );
oRefSoundPath.pFIRConvolverChL->releaseFilter( pHRIRFilterChL );
oRefSoundPath.pFIRConvolverChR->releaseFilter( pHRIRFilterChR );
oRefSoundPath.pFIRConvolverChL->ExchangeFilter( pHRIRFilterChL );
oRefSoundPath.pFIRConvolverChR->ExchangeFilter( pHRIRFilterChR );
oRefSoundPath.pFIRConvolverChL->ReleaseFilter( pHRIRFilterChL );
oRefSoundPath.pFIRConvolverChR->ReleaseFilter( pHRIRFilterChR );
// Ack
oRefSoundPath.oHRIRStateCur = oRefSoundPath.oHRIRStateNew;
......
......@@ -721,8 +721,8 @@ void CVABinauralFreeFieldAudioRenderer::ProcessStream( const ITAStreamInfo* pStr
float fSoundSourceGain = float( dDistanceDecrease * pSourceState->GetVolume() );
if( pPath->pSource->pData->bMuted || ( bDSEnabled == false ) )
fSoundSourceGain = 0.0f;
pPath->pFIRConvolverChL->setGain( fSoundSourceGain );
pPath->pFIRConvolverChR->setGain( fSoundSourceGain );
pPath->pFIRConvolverChL->SetGain( fSoundSourceGain );
pPath->pFIRConvolverChR->SetGain( fSoundSourceGain );
// --= DSP =--
......@@ -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(), ITAUPConvolution::OUTPUT_MIX );
pPath->pFIRConvolverChR->process( ctxAudio.m_sbTempR.data(), ( *pPath->pListener->psfOutput )[ 1 ].data(), ITAUPConvolution::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++;
}
......@@ -1133,24 +1133,24 @@ CVABFFSoundPath::CVABFFSoundPath( double dSamplerate, int iBlocklength, int iHRI
pVariableDelayLineChR = new CVAVariableDelayLine( dSamplerate, iBlocklength, fReserverdMaxDelaySamples, m_iDefaultVDLSwitchingAlgorithm);
pFIRConvolverChL = new ITAUPConvolution( iBlocklength, iHRIRFilterLength );
pFIRConvolverChL->setFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pFIRConvolverChL->setFilterCrossfadeLength( (std::min)( iBlocklength, 32 ) );
pFIRConvolverChL->setGain( 0.0f, true );
ITAUPFilter* pHRIRFilterChL = pFIRConvolverChL->requestFilter();
pFIRConvolverChL->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pFIRConvolverChL->SetFilterCrossfadeLength( (std::min)( iBlocklength, 32 ) );
pFIRConvolverChL->SetGain( 0.0f, true );
ITAUPFilter* pHRIRFilterChL = pFIRConvolverChL->RequestFilter();
pHRIRFilterChL->identity();
pFIRConvolverChL->exchangeFilter( pHRIRFilterChL );
pFIRConvolverChL->ExchangeFilter( pHRIRFilterChL );
pFIRConvolverChR = new ITAUPConvolution( iBlocklength, iHRIRFilterLength );
pFIRConvolverChR->setFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pFIRConvolverChR->setFilterCrossfadeLength( (std::min)( iBlocklength, 32 ) );
pFIRConvolverChR->setGain( 0.0f, true );
ITAUPFilter* pHRIRFilterChR = pFIRConvolverChR->requestFilter();
pFIRConvolverChR->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pFIRConvolverChR->SetFilterCrossfadeLength( (std::min)( iBlocklength, 32 ) );
pFIRConvolverChR->SetGain( 0.0f, true );
ITAUPFilter* pHRIRFilterChR = pFIRConvolverChR->RequestFilter();
pHRIRFilterChR->identity();
pFIRConvolverChL->exchangeFilter( pHRIRFilterChR );
pFIRConvolverChL->ExchangeFilter( pHRIRFilterChR );
// Auto-release filter after it is not used anymore
pFIRConvolverChL->releaseFilter( pHRIRFilterChL );
pFIRConvolverChR->releaseFilter( pHRIRFilterChR );
pFIRConvolverChL->ReleaseFilter( pHRIRFilterChL );
pFIRConvolverChR->ReleaseFilter( pHRIRFilterChR );
m_sfHRIRTemp.init( 2, iHRIRFilterLength, false );
......@@ -1256,8 +1256,8 @@ void CVABFFSoundPath::UpdateHRIR( const CVAListenerState::CVAAnthropometricParam
if( ( oHRIRStateCur != oHRIRStateNew ) || bForeUpdate )
{
ITAUPFilter* pHRIRFilterChL = pFIRConvolverChL->getFilterPool()->requestFilter();
ITAUPFilter* pHRIRFilterChR = pFIRConvolverChR->getFilterPool()->requestFilter();
ITAUPFilter* pHRIRFilterChL = pFIRConvolverChL->GetFilterPool()->RequestFilter();
ITAUPFilter* pHRIRFilterChR = pFIRConvolverChR->GetFilterPool()->RequestFilter();
if( pHRIRDataNew == nullptr )
{
......@@ -1272,10 +1272,10 @@ void CVABFFSoundPath::UpdateHRIR( const CVAListenerState::CVAAnthropometricParam
m_sfHRIRTemp.init( 2, iNewFilterLength, false );
}
if( iNewFilterLength > pFIRConvolverChL->getMaxFilterlength() )
if( iNewFilterLength > pFIRConvolverChL->GetMaxFilterlength() )
{
VA_WARN( "CVABFFSoundPath", "HRIR too long for convolver, cropping. Increase HRIR filter length in BinauralFreefieldAudioRenderer configuration." );
iNewFilterLength = pFIRConvolverChL->getMaxFilterlength();
iNewFilterLength = pFIRConvolverChL->GetMaxFilterlength();
}
if( pHRIRDataNew->GetProperties()->bSpaceDiscrete )
......@@ -1289,14 +1289,14 @@ void CVABFFSoundPath::UpdateHRIR( const CVAListenerState::CVAAnthropometricParam
float( oRelations.dElevationL2S ), float( oRelations.dDistance ) );
}
pHRIRFilterChL->load( m_sfHRIRTemp[0].data(), iNewFilterLength );
pHRIRFilterChR->load( m_sfHRIRTemp[1].data(), iNewFilterLength );
pHRIRFilterChL->Load( m_sfHRIRTemp[0].data(), iNewFilterLength );
pHRIRFilterChR->Load( m_sfHRIRTemp[1].data(), iNewFilterLength );
}
pFIRConvolverChL->exchangeFilter( pHRIRFilterChL );
pFIRConvolverChR->exchangeFilter( pHRIRFilterChR );
pFIRConvolverChL->releaseFilter( pHRIRFilterChL );
pFIRConvolverChR->releaseFilter( pHRIRFilterChR );
pFIRConvolverChL->ExchangeFilter( pHRIRFilterChL );
pFIRConvolverChR->ExchangeFilter( pHRIRFilterChR );
pFIRConvolverChL->ReleaseFilter( pHRIRFilterChL );
pFIRConvolverChR->ReleaseFilter( pHRIRFilterChR );
// Ack
oHRIRStateCur = oHRIRStateNew;
......
......@@ -535,22 +535,22 @@ ComplexSoundPath::ComplexSoundPath( double dSamplerate, int iBlocklength, int iR
: m_pRenderer( nullptr )
{
// Falter
int iRIRConvolverLength = pParentFilterPool->getMaxFilterlength();
int iRIRConvolverLength = pParentFilterPool->GetMaxFilterlength();
pRIRConvolverCh0 = new ITAUPConvolution( iBlocklength, iRIRConvolverLength, pParentFilterPool );
pRIRConvolverCh0->setFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pRIRConvolverCh0->setFilterCrossfadeLength( (std::min)( iBlocklength, 32 ) );
ITAUPFilter* pRIRFilterCh0 = pRIRConvolverCh0->requestFilter();
pRIRFilterCh0->zeros();
pRIRConvolverCh0->exchangeFilter( pRIRFilterCh0 );
pRIRConvolverCh0->releaseFilter( pRIRFilterCh0 );
pRIRConvolverCh0->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pRIRConvolverCh0->SetFilterCrossfadeLength( (std::min)( iBlocklength, 32 ) );
ITAUPFilter* pRIRFilterCh0 = pRIRConvolverCh0->RequestFilter();
pRIRFilterCh0->Zeros();
pRIRConvolverCh0->ExchangeFilter( pRIRFilterCh0 );
pRIRConvolverCh0->ReleaseFilter( pRIRFilterCh0 );
pRIRConvolverCh1 = new ITAUPConvolution( iBlocklength, iRIRConvolverLength, pParentFilterPool );
pRIRConvolverCh1->setFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pRIRConvolverCh1->setFilterCrossfadeLength( (std::min)( iBlocklength, 32 ) );
ITAUPFilter* pRIRFilterCh1 = pRIRConvolverCh1->requestFilter();
pRIRFilterCh1->zeros();
pRIRConvolverCh1->exchangeFilter( pRIRFilterCh1 );
pRIRConvolverCh1->releaseFilter( pRIRFilterCh1 );
pRIRConvolverCh1->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pRIRConvolverCh1->SetFilterCrossfadeLength( (std::min)( iBlocklength, 32 ) );
ITAUPFilter* pRIRFilterCh1 = pRIRConvolverCh1->RequestFilter();
pRIRFilterCh1->Zeros();
pRIRConvolverCh1->ExchangeFilter( pRIRFilterCh1 );
pRIRConvolverCh1->ReleaseFilter( pRIRFilterCh1 );
// Variable Verzgerungsleitung fr die Mediumsausbreitung
float fReserverdMaxDelaySamples = (float) ( 3 * dSamplerate ); // 3 Sekunden ~ 1km Entfernung
......@@ -875,25 +875,25 @@ void ComplexSoundPath::ExchangeFilter()
m_csRIRDiffuseDecayAssembly.leave();
}
ITAUPFilter* pRIRFilterCh0 = pRIRConvolverCh0->requestFilter();
ITAUPFilter* pRIRFilterCh1 = pRIRConvolverCh1->requestFilter();
ITAUPFilter* pRIRFilterCh0 = pRIRConvolverCh0->RequestFilter();
ITAUPFilter* pRIRFilterCh1 = pRIRConvolverCh1->RequestFilter();
float* pfRIRDataCh0 = sfRIRTemp[0].data();
float* pfRIRDataCh1 = sfRIRTemp[1].data();
int iCount = (std::min)( sfRIRTemp.length(), pRIRConvolverCh0->getMaxFilterlength() );
pRIRFilterCh0->load( pfRIRDataCh0, iCount );
pRIRFilterCh1->load( pfRIRDataCh1, iCount );
int iCount = (std::min)( sfRIRTemp.length(), pRIRConvolverCh0->GetMaxFilterlength() );
pRIRFilterCh0->Load( pfRIRDataCh0, iCount );
pRIRFilterCh1->Load( pfRIRDataCh1, iCount );
pRIRConvolverCh0->exchangeFilter( pRIRFilterCh0 );
pRIRConvolverCh1->exchangeFilter( pRIRFilterCh1 );
pRIRConvolverCh0->ExchangeFilter( pRIRFilterCh0 );
pRIRConvolverCh1->ExchangeFilter( pRIRFilterCh1 );
pRIRConvolverCh0->releaseFilter( pRIRFilterCh0 );
pRIRConvolverCh1->releaseFilter( pRIRFilterCh1 );
pRIRConvolverCh0->ReleaseFilter( pRIRFilterCh0 );
pRIRConvolverCh1->ReleaseFilter( pRIRFilterCh1 );
bool bPathMuted = pSource->pData->bMuted || !bEntitiesInSameRoom;
pRIRConvolverCh0->setGain( bPathMuted ? 0.0f : 1.0f );