Commit d46dba91 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Minor fixes after refactoring

parent 4aabc712
...@@ -27,13 +27,13 @@ ITANCTCStreamFilter::ITANCTCStreamFilter( const ITANCTCStreamFilter::Config& oC ...@@ -27,13 +27,13 @@ ITANCTCStreamFilter::ITANCTCStreamFilter( const ITANCTCStreamFilter::Config& oC
for( int n=0; n<oConfig.N; n++ ) for( int n=0; n<oConfig.N; n++ )
{ {
ITAUPConvolution* pConvolverL = new ITAUPConvolution( oConfig.iBlockLength, oConfig.iFilterLength, m_pFilterPool ); ITAUPConvolution* pConvolverL = new ITAUPConvolution( oConfig.iBlockLength, oConfig.iFilterLength, m_pFilterPool );
pConvolverL->setFilterExchangeMode( oConfig.iFilterExchangeMode ); pConvolverL->SetFilterExchangeMode( oConfig.iFilterExchangeMode );
pConvolverL->setFilterCrossfadeLength( oConfig.iFilterCrossfadeLength ); pConvolverL->SetFilterCrossfadeLength( oConfig.iFilterCrossfadeLength );
m_vpConvolvers.push_back( pConvolverL ); m_vpConvolvers.push_back( pConvolverL );
ITAUPConvolution* pConvolverR = new ITAUPConvolution( oConfig.iBlockLength, oConfig.iFilterLength, m_pFilterPool ); ITAUPConvolution* pConvolverR = new ITAUPConvolution( oConfig.iBlockLength, oConfig.iFilterLength, m_pFilterPool );
pConvolverR->setFilterExchangeMode( oConfig.iFilterExchangeMode ); pConvolverR->SetFilterExchangeMode( oConfig.iFilterExchangeMode );
pConvolverR->setFilterCrossfadeLength( oConfig.iFilterCrossfadeLength ); pConvolverR->SetFilterCrossfadeLength( oConfig.iFilterCrossfadeLength );
m_vpConvolvers.push_back( pConvolverR ); m_vpConvolvers.push_back( pConvolverR );
} }
...@@ -98,27 +98,27 @@ void ITANCTCStreamFilter::ExchangeFilters( const std::vector< ITAHDFTSpectra* >& ...@@ -98,27 +98,27 @@ void ITANCTCStreamFilter::ExchangeFilters( const std::vector< ITAHDFTSpectra* >&
// Left binaural signal // Left binaural signal
ITAUPConvolution* pConvolverL( m_vpConvolvers[iIdxLeft] ); ITAUPConvolution* pConvolverL( m_vpConvolvers[iIdxLeft] );
ITAUPFilter* pNewFilterL = m_pFilterPool->requestFilter(); ITAUPFilter* pNewFilterL = m_pFilterPool->RequestFilter();
sbSpectrum.write( oCTCFilterL.data(), sbSpectrum.length() ); sbSpectrum.write( oCTCFilterL.data(), sbSpectrum.length() );
fIn = sbSpectrum.data(); fIn = sbSpectrum.data();
fOut = sbImpulseResponse.data(); fOut = sbImpulseResponse.data();
ifft.execute( fIn, fOut ); ifft.execute( fIn, fOut );
sbImpulseResponse.div_scalar( float( sbImpulseResponse.length() ) ); sbImpulseResponse.div_scalar( float( sbImpulseResponse.length() ) );
pNewFilterL->load( sbImpulseResponse.data(), sbImpulseResponse.length() ); pNewFilterL->Load( sbImpulseResponse.data(), sbImpulseResponse.length() );
pConvolverL->exchangeFilter( pNewFilterL ); pConvolverL->ExchangeFilter( pNewFilterL );
pNewFilterL->release(); pNewFilterL->Release();
// Right binaural signal // Right binaural signal
ITAUPConvolution* pConvolverR( m_vpConvolvers[iIdxRight] ); ITAUPConvolution* pConvolverR( m_vpConvolvers[iIdxRight] );
ITAUPFilter* pNewFilterR = m_pFilterPool->requestFilter(); ITAUPFilter* pNewFilterR = m_pFilterPool->RequestFilter();
sbSpectrum.write( oCTCFilterR.data(), sbSpectrum.length() ); sbSpectrum.write( oCTCFilterR.data(), sbSpectrum.length() );
fIn = sbSpectrum.data(); fIn = sbSpectrum.data();
fOut = sbImpulseResponse.data(); fOut = sbImpulseResponse.data();
ifft.execute( fIn, fOut ); ifft.execute( fIn, fOut );
sbImpulseResponse.div_scalar( float( sbImpulseResponse.length() ) ); sbImpulseResponse.div_scalar( float( sbImpulseResponse.length() ) );
pNewFilterR->load( sbImpulseResponse.data(), sbImpulseResponse.length() ); pNewFilterR->Load( sbImpulseResponse.data(), sbImpulseResponse.length() );
pConvolverR->exchangeFilter( pNewFilterR ); pConvolverR->ExchangeFilter( pNewFilterR );
pNewFilterR->release(); pNewFilterR->Release();
} }
return; return;
...@@ -137,8 +137,8 @@ void ITANCTCStreamFilter::SetGains( const std::vector< float >& vfGains, bool bS ...@@ -137,8 +137,8 @@ void ITANCTCStreamFilter::SetGains( const std::vector< float >& vfGains, bool bS
ITAUPConvolution* pConvolverR( m_vpConvolvers[iIdxRight] ); ITAUPConvolution* pConvolverR( m_vpConvolvers[iIdxRight] );
const float& fGain( vfGains[n] ); const float& fGain( vfGains[n] );
pConvolverL->setGain( fGain, bSetImmediately ); pConvolverL->SetGain( fGain, bSetImmediately );
pConvolverR->setGain( fGain, bSetImmediately ); pConvolverR->SetGain( fGain, bSetImmediately );
} }
} }
...@@ -162,15 +162,15 @@ void ITANCTCStreamFilter::HandleProcessStream( ITADatasourceRealization*, const ...@@ -162,15 +162,15 @@ void ITANCTCStreamFilter::HandleProcessStream( ITADatasourceRealization*, const
ITAUPConvolution* pConvolverL( m_vpConvolvers[iIdxLeft] ); ITAUPConvolution* pConvolverL( m_vpConvolvers[iIdxLeft] );
ITAUPConvolution* pConvolverR( m_vpConvolvers[iIdxRight] ); ITAUPConvolution* pConvolverR( m_vpConvolvers[iIdxRight] );
pConvolverL->process( pfInputDataCh0, oConfig.iBlockLength, pfOutputData, oConfig.iBlockLength, ITAUPConvolution::OUTPUT_OVERWRITE ); pConvolverL->Process( pfInputDataCh0, oConfig.iBlockLength, pfOutputData, oConfig.iBlockLength, ITAUPConvolution::OUTPUT_OVERWRITE );
pConvolverR->process( pfInputDataCh1, oConfig.iBlockLength, pfOutputData, oConfig.iBlockLength, ITAUPConvolution::OUTPUT_MIX ); pConvolverR->Process( pfInputDataCh1, oConfig.iBlockLength, pfOutputData, oConfig.iBlockLength, ITAUPConvolution::OUTPUT_MIX );
} }
// Increment write pointer on output stream // Increment write pointer on output stream
m_pdsOutput->IncrementWritePointer(); m_pdsOutput->IncrementWritePointer();
} }
void ITANCTCStreamFilter::HandlePostIncrementBlockPointer( ITADatasourceRealization* pSender ) void ITANCTCStreamFilter::HandlePostIncrementBlockPointer( ITADatasourceRealization* )
{ {
m_pdsInput->IncrementBlockPointer(); m_pdsInput->IncrementBlockPointer();
} }
\ No newline at end of file
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