Applying refactoring name changes for uniform partitioned convolution

parent c395e918
......@@ -26,10 +26,10 @@
#include <ITADataSourceRealization.h>
// Forward declarations
class DSMBCConvolver;
class DSMBCFilter;
class DSMBCFilterPool;
class DSMBCTrigger;
class ITAUPConvolution;
class ITAUPFilter;
class ITAUPFilterPool;
class ITAUPTrigger;
class ITADatasource;
class ITAHDFTSpectra;
......@@ -47,7 +47,7 @@ public:
double dSampleRate; //!< Audio processing sample rate
int iBlockLength; //!< Audio processing block length
int iFilterLength; //!< Length of filter
int iFilterExchangeMode; //!< Exchange mode \see DSMBCConvolver
int iFilterExchangeMode; //!< Exchange mode \see ITAUPConvolution
int iFilterCrossfadeLength; //!< Filter exchange crossfade length
};
......@@ -82,10 +82,10 @@ private:
ITADatasource* m_pdsInput; //!< Input data source
ITADatasourceRealization* m_pdsOutput; //!< Output data source
DSMBCFilterPool* m_pFilterPool; //!< Filter Pool containing dropped, current and queued filters
DSMBCTrigger* m_pFilterExchangeTrigger; //!< Trigger for filter exchange
ITAUPFilterPool* m_pFilterPool; //!< Filter Pool containing dropped, current and queued filters
ITAUPTrigger* m_pFilterExchangeTrigger; //!< Trigger for filter exchange
std::vector< DSMBCConvolver* > m_vpConvolvers; //!< 2*N individual block convolver for each CTC filter, even number = left binaural signal
std::vector< ITAUPConvolution* > m_vpConvolvers; //!< 2*N individual block convolver for each CTC filter, even number = left binaural signal
};
#endif // INCLUDE_WATCHER_ITA_N_CTC_STREAMING_FILTER
\ No newline at end of file
......@@ -2,9 +2,10 @@
#include <assert.h>
#include <DSMBCConvolver.h>
#include <DSMBCFilter.h>
#include <DSMBCFilterPool.h>
#include <ITAUPConvolution.h>
#include <ITAUPFilter.h>
#include <ITAUPFilterPool.h>
#include <ITAUPTrigger.h>
#include <ITAAudiofileWriter.h>
#include <ITAException.h>
......@@ -16,21 +17,21 @@ ITANCTCStreamFilter::ITANCTCStreamFilter( const ITANCTCStreamFilter::Config& oC
: m_pdsInput( NULL )
, m_pdsOutput( NULL )
, m_pFilterPool( NULL )
, m_pFilterExchangeTrigger( new DSMBCTrigger )
, m_pFilterExchangeTrigger( new ITAUPTrigger )
, oConfig( oC )
{
// Create filter pool; pre-fetch 2*N filters... arbitrary, done dynamically later
m_pFilterPool = new DSMBCFilterPool( oConfig.iBlockLength, oConfig.iFilterLength, 2*oConfig.N );
m_pFilterPool = new ITAUPFilterPool( oConfig.iBlockLength, oConfig.iFilterLength, 2*oConfig.N );
// Create N two-channel convolvers
for( int n=0; n<oConfig.N; n++ )
{
DSMBCConvolver* pConvolverL = new DSMBCConvolver( oConfig.iBlockLength, oConfig.iFilterLength, m_pFilterPool );
ITAUPConvolution* pConvolverL = new ITAUPConvolution( oConfig.iBlockLength, oConfig.iFilterLength, m_pFilterPool );
pConvolverL->setFilterExchangeMode( oConfig.iFilterExchangeMode );
pConvolverL->setFilterCrossfadeLength( oConfig.iFilterCrossfadeLength );
m_vpConvolvers.push_back( pConvolverL );
DSMBCConvolver* pConvolverR = new DSMBCConvolver( oConfig.iBlockLength, oConfig.iFilterLength, m_pFilterPool );
ITAUPConvolution* pConvolverR = new ITAUPConvolution( oConfig.iBlockLength, oConfig.iFilterLength, m_pFilterPool );
pConvolverR->setFilterExchangeMode( oConfig.iFilterExchangeMode );
pConvolverR->setFilterCrossfadeLength( oConfig.iFilterCrossfadeLength );
m_vpConvolvers.push_back( pConvolverR );
......@@ -61,7 +62,7 @@ void ITANCTCStreamFilter::SetInputDatasource( ITADatasource* pdsInput )
if( pdsInput->GetNumberOfChannels() != 2 )
ITA_EXCEPT1(INVALID_PARAMETER, "Input datasource must be stereo");
if( pdsInput->GetBlocklength() != oConfig.iBlockLength )
if( int( pdsInput->GetBlocklength() ) != oConfig.iBlockLength )
ITA_EXCEPT1(INVALID_PARAMETER, "Datasource has different streaming blocklength");
m_pdsInput = pdsInput;
......@@ -96,8 +97,8 @@ void ITANCTCStreamFilter::ExchangeFilters( const std::vector< ITAHDFTSpectra* >&
int iIdxRight = iIdxLeft+1;
// Left binaural signal
DSMBCConvolver* pConvolverL( m_vpConvolvers[iIdxLeft] );
DSMBCFilter* pNewFilterL = m_pFilterPool->requestFilter();
ITAUPConvolution* pConvolverL( m_vpConvolvers[iIdxLeft] );
ITAUPFilter* pNewFilterL = m_pFilterPool->requestFilter();
sbSpectrum.write( oCTCFilterL.data(), sbSpectrum.length() );
fIn = sbSpectrum.data();
fOut = sbImpulseResponse.data();
......@@ -108,8 +109,8 @@ void ITANCTCStreamFilter::ExchangeFilters( const std::vector< ITAHDFTSpectra* >&
pNewFilterL->release();
// Right binaural signal
DSMBCConvolver* pConvolverR( m_vpConvolvers[iIdxRight] );
DSMBCFilter* pNewFilterR = m_pFilterPool->requestFilter();
ITAUPConvolution* pConvolverR( m_vpConvolvers[iIdxRight] );
ITAUPFilter* pNewFilterR = m_pFilterPool->requestFilter();
sbSpectrum.write( oCTCFilterR.data(), sbSpectrum.length() );
fIn = sbSpectrum.data();
fOut = sbImpulseResponse.data();
......@@ -132,8 +133,8 @@ void ITANCTCStreamFilter::SetGains( const std::vector< float >& vfGains, bool bS
{
int iIdxLeft = 2*n;
int iIdxRight = iIdxLeft+1;
DSMBCConvolver* pConvolverL( m_vpConvolvers[iIdxLeft] );
DSMBCConvolver* pConvolverR( m_vpConvolvers[iIdxRight] );
ITAUPConvolution* pConvolverL( m_vpConvolvers[iIdxLeft] );
ITAUPConvolution* pConvolverR( m_vpConvolvers[iIdxRight] );
const float& fGain( vfGains[n] );
pConvolverL->setGain( fGain, bSetImmediately );
......@@ -142,7 +143,7 @@ void ITANCTCStreamFilter::SetGains( const std::vector< float >& vfGains, bool bS
}
}
void ITANCTCStreamFilter::HandleProcessStream( ITADatasourceRealization* pSender, const ITAStreamInfo* pStreamInfo )
void ITANCTCStreamFilter::HandleProcessStream( ITADatasourceRealization*, const ITAStreamInfo* pStreamInfo )
{
if( !m_pdsInput )
ITA_EXCEPT1( MODAL_EXCEPTION, "Input data source not defined yet" );
......@@ -158,11 +159,11 @@ void ITANCTCStreamFilter::HandleProcessStream( ITADatasourceRealization* pSender
int iIdxLeft = 2*n;
int iIdxRight = iIdxLeft+1;
DSMBCConvolver* pConvolverL( m_vpConvolvers[iIdxLeft] );
DSMBCConvolver* pConvolverR( m_vpConvolvers[iIdxRight] );
ITAUPConvolution* pConvolverL( m_vpConvolvers[iIdxLeft] );
ITAUPConvolution* pConvolverR( m_vpConvolvers[iIdxRight] );
pConvolverL->process( pfInputDataCh0, oConfig.iBlockLength, pfOutputData, oConfig.iBlockLength, DSMBCConvolver::OUTPUT_OVERWRITE );
pConvolverR->process( pfInputDataCh1, oConfig.iBlockLength, pfOutputData, oConfig.iBlockLength, DSMBCConvolver::OUTPUT_MIX );
pConvolverL->process( pfInputDataCh0, oConfig.iBlockLength, pfOutputData, oConfig.iBlockLength, ITAUPConvolution::OUTPUT_OVERWRITE );
pConvolverR->process( pfInputDataCh1, oConfig.iBlockLength, pfOutputData, oConfig.iBlockLength, ITAUPConvolution::OUTPUT_MIX );
}
// Increment write pointer on output stream
......
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