Commit 0f1bc449 authored by Michael Kohnen's avatar Michael Kohnen
Browse files

Refactoring

parent 7aab7842
......@@ -200,17 +200,17 @@ void CVAAmbisonicsBinauralMixdownReproduction::UpdateScene( CVASceneState* pNewS
ITAUPFilter* pFilterChR = m_pdsStreamFilter->pFilterPool->RequestFilter();
int iLoadFilter = (std::min)( m_iHRIRFilterLength, iHRIRFilterLength );
pFilterChL->zeros();
pFilterChL->load( m_sfHRIRTemp[0].data(), iLoadFilter );
pFilterChR->zeros();
pFilterChR->load( m_sfHRIRTemp[1].data(), iLoadFilter );
pFilterChL->Zeros();
pFilterChL->Load( m_sfHRIRTemp[0].data(), iLoadFilter );
pFilterChR->Zeros();
pFilterChR->Load( m_sfHRIRTemp[1].data(), iLoadFilter );
// Update
m_pdsStreamFilter->vpConvolver[iIndexLeft]->ExchangeFilter( pFilterChL );
m_pdsStreamFilter->vpConvolver[iIndexRight]->ExchangeFilter( pFilterChR );
pFilterChL->release();
pFilterChR->release();
pFilterChL->Release();
pFilterChR->Release();
}
m_pdsStreamFilter->pTrigger->trigger();
......@@ -234,15 +234,15 @@ CMixdownStreamFilter::CMixdownStreamFilter( int iNumLoudspeaker, double dSampleR
for( int i=0; i< 2 * iNumLoudspeaker; i++ )
{
ITAUPConvolution* pConvolver = new ITAUPConvolution( (int) GetBlocklength(), iMaxFilterLength, pFilterPool );
pConvolver->setFilterExchangeTrigger( pTrigger );
pConvolver->setFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pConvolver->setFilterCrossfadeLength( (int) GetBlocklength() );
pConvolver->SetFilterExchangeTrigger( pTrigger );
pConvolver->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pConvolver->SetFilterCrossfadeLength( (int) GetBlocklength() );
pConvolver->ExchangeFilter( pDirac );
vpConvolver.push_back( pConvolver );
}
pDirac->release();
pDirac->Release();
pTrigger->trigger();
}
......@@ -268,8 +268,8 @@ void CMixdownStreamFilter::ProcessStream( const ITAStreamInfo* pStreamInfo )
int iIndexRight = 2*i+1;
const float* pfInputData = pdsInput->GetBlockPointer( i, pStreamInfo );
int iWriteMode = ( i == 0 ) ? ITAUPConvolution::OUTPUT_OVERWRITE : ITAUPConvolution::OUTPUT_MIX;
vpConvolver[iIndexLeft]->process( pfInputData, pfBinauralOutputDataChL, iWriteMode );
vpConvolver[iIndexRight]->process( pfInputData, pfBinauralOutputDataChR, iWriteMode );
vpConvolver[iIndexLeft]->Process( pfInputData, pfBinauralOutputDataChL, iWriteMode );
vpConvolver[iIndexRight]->Process( pfInputData, pfBinauralOutputDataChR, iWriteMode );
}
IncrementWritePointer();
......
......@@ -167,17 +167,17 @@ void CVABinauralMixdownReproduction::UpdateScene( CVASceneState* pNewState )
ITAUPFilter* pFilterChR = m_pdsStreamFilter->pFilterPool->RequestFilter();
int iLoadFilter = (std::min)( m_iHRIRFilterLength, iHRIRFilterLength );
pFilterChL->zeros();
pFilterChL->load( m_sfHRIRTemp[0].data(), iLoadFilter );
pFilterChR->zeros();
pFilterChR->load( m_sfHRIRTemp[1].data(), iLoadFilter );
pFilterChL->Zeros();
pFilterChL->Load( m_sfHRIRTemp[0].data(), iLoadFilter );
pFilterChR->Zeros();
pFilterChR->Load( m_sfHRIRTemp[1].data(), iLoadFilter );
// Update
m_pdsStreamFilter->vpConvolver[iIndexLeft]->ExchangeFilter( pFilterChL );
m_pdsStreamFilter->vpConvolver[iIndexRight]->ExchangeFilter( pFilterChR );
pFilterChL->release();
pFilterChR->release();
pFilterChL->Release();
pFilterChR->Release();
}
m_pdsStreamFilter->pTrigger->trigger();
......@@ -207,9 +207,9 @@ StreamFilter::StreamFilter( int iNumChannels, double dSampleRate, int iBlockLeng
for( int i=0; i<2*iNumChannels; i++ )
{
ITAUPConvolution* pConvolver = new ITAUPConvolution( (int) GetBlocklength(), iMaxFilterLength, pFilterPool );
pConvolver->setFilterExchangeTrigger( pTrigger );
pConvolver->setFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pConvolver->setFilterCrossfadeLength( (int) GetBlocklength() );
pConvolver->SetFilterExchangeTrigger( pTrigger );
pConvolver->SetFilterExchangeMode( ITAUPConvolution::CROSSFADE_COSINE_SQUARE );
pConvolver->SetFilterCrossfadeLength( (int) GetBlocklength() );
pConvolver->ExchangeFilter( pDirac );
vpConvolver.push_back( pConvolver );
......@@ -238,8 +238,8 @@ void StreamFilter::ProcessStream( const ITAStreamInfo* pStreamInfo )
int iIndexRight = 2*i+1;
const float* pfInputData = pdsInput->GetBlockPointer( i, pStreamInfo );
int iWriteMode = ( i == 0 ) ? ITAUPConvolution::OUTPUT_OVERWRITE : ITAUPConvolution::OUTPUT_MIX;
vpConvolver[iIndexLeft]->process( pfInputData, pfBinauralOutputDataChL, iWriteMode );
vpConvolver[iIndexRight]->process( pfInputData, pfBinauralOutputDataChR, iWriteMode );
vpConvolver[iIndexLeft]->Process( pfInputData, pfBinauralOutputDataChL, iWriteMode );
vpConvolver[iIndexRight]->Process( pfInputData, pfBinauralOutputDataChR, iWriteMode );
}
IncrementWritePointer();
......
Supports Markdown
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