Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
VACore
Commits
1371d5d4
Commit
1371d5d4
authored
May 18, 2017
by
Jonas Stienen
Browse files
Updating refactoring changes for uniform paritioned convolution
parent
e2388d25
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
src/Filtering/VAThirdOctaveFilterbankFIR.h
View file @
1371d5d4
...
...
@@ -40,8 +40,8 @@ public:
m_pGenerator
=
new
CVAThirdOctaveFIRFilterGenerator
(
dSamplerate
,
m_iFilterLength
);
m_pConvolver
=
new
ITAUPConvolution
(
iBlocklength
,
m_iFilterLength
);
m_pConvolver
->
s
etFilterExchangeMode
(
ITAUPConvolution
::
CROSSFADE_COSINE_SQUARE
);
m_pConvolver
->
s
etFilterCrossfadeLength
(
32
);
m_pConvolver
->
S
etFilterExchangeMode
(
ITAUPConvolution
::
CROSSFADE_COSINE_SQUARE
);
m_pConvolver
->
S
etFilterCrossfadeLength
(
32
);
SetIdentity
(
false
);
}
...
...
@@ -55,23 +55,23 @@ public:
inline
virtual
void
SetIdentity
(
bool
bSmoothChangeover
)
{
ITAUPFilter
*
pFilter
=
m_pConvolver
->
r
equestFilter
();
ITAUPFilter
*
pFilter
=
m_pConvolver
->
R
equestFilter
();
int
iLatency
=
m_pGenerator
->
GetLatency
();
assert
(
iLatency
<
m_iFilterLength
);
fm_zero
(
m_pfFilter
,
m_iFilterLength
);
m_pfFilter
[
iLatency
]
=
1
;
pFilter
->
l
oad
(
m_pfFilter
,
m_iFilterLength
);
m_pConvolver
->
e
xchangeFilter
(
pFilter
,
(
bSmoothChangeover
?
ITAUPConvolution
::
AUTO
:
ITAUPConvolution
::
SWITCH
)
);
pFilter
->
r
elease
();
// Auto-release
pFilter
->
L
oad
(
m_pfFilter
,
m_iFilterLength
);
m_pConvolver
->
E
xchangeFilter
(
pFilter
,
(
bSmoothChangeover
?
ITAUPConvolution
::
AUTO
:
ITAUPConvolution
::
SWITCH
)
);
pFilter
->
R
elease
();
// Auto-release
}
inline
virtual
void
SetGains
(
const
CVAThirdOctaveMagnitudes
&
oGains
,
bool
bSmoothChangeover
=
true
)
{
m_pGenerator
->
GenerateFilter
(
oGains
,
m_pfFilter
);
ITAUPFilter
*
pFilter
=
m_pConvolver
->
r
equestFilter
();
pFilter
->
l
oad
(
m_pfFilter
,
m_iFilterLength
);
m_pConvolver
->
e
xchangeFilter
(
pFilter
,
(
bSmoothChangeover
?
ITAUPConvolution
::
AUTO
:
ITAUPConvolution
::
SWITCH
)
);
pFilter
->
r
elease
();
// Auto-release
ITAUPFilter
*
pFilter
=
m_pConvolver
->
R
equestFilter
();
pFilter
->
L
oad
(
m_pfFilter
,
m_iFilterLength
);
m_pConvolver
->
E
xchangeFilter
(
pFilter
,
(
bSmoothChangeover
?
ITAUPConvolution
::
AUTO
:
ITAUPConvolution
::
SWITCH
)
);
pFilter
->
R
elease
();
// Auto-release
}
inline
int
GetLatency
()
const
...
...
@@ -87,7 +87,7 @@ public:
inline
virtual
void
Process
(
const
float
*
pfInputSamples
,
float
*
pfOutputSamples
)
{
m_pConvolver
->
p
rocess
(
pfInputSamples
,
m_iBlocklength
,
pfOutputSamples
,
m_iBlocklength
);
m_pConvolver
->
P
rocess
(
pfInputSamples
,
m_iBlocklength
,
pfOutputSamples
,
m_iBlocklength
);
}
private:
...
...
src/Motion/VASampleAndHoldMotionModel.h
View file @
1371d5d4
...
...
@@ -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
;
...
...
src/Rendering/Binaural/AirTrafficNoise/VAAirTrafficNoiseAudioRenderer.cpp
View file @
1371d5d4
...
...
@@ -767,10 +767,10 @@ void CVABinauralAirTrafficNoiseAudioRenderer::ProcessStream( const ITAStreamInfo
fRefSoundPathSoundSourceGain
=
0.0
f
;
}
pPath
->
oDirSoundPath
.
pFIRConvolverChL
->
s
etGain
(
fDirSoundPathSoundSourceGain
);
pPath
->
oRefSoundPath
.
pFIRConvolverChL
->
s
etGain
(
fRefSoundPathSoundSourceGain
);
pPath
->
oDirSoundPath
.
pFIRConvolverChR
->
s
etGain
(
fDirSoundPathSoundSourceGain
);
pPath
->
oRefSoundPath
.
pFIRConvolverChR
->
s
etGain
(
fRefSoundPathSoundSourceGain
);
pPath
->
oDirSoundPath
.
pFIRConvolverChL
->
S
etGain
(
fDirSoundPathSoundSourceGain
);
pPath
->
oRefSoundPath
.
pFIRConvolverChL
->
S
etGain
(
fRefSoundPathSoundSourceGain
);
pPath
->
oDirSoundPath
.
pFIRConvolverChR
->
S
etGain
(
fDirSoundPathSoundSourceGain
);
pPath
->
oRefSoundPath
.
pFIRConvolverChR
->
S
etGain
(
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
->
p
rocess
(
ctxAudio
.
m_sbTempBufD
.
data
(),
(
*
pPath
->
pListener
->
psfOutput
)[
0
].
data
(),
ITAUPConvolution
::
OUTPUT_MIX
);
pPath
->
oRefSoundPath
.
pFIRConvolverChL
->
p
rocess
(
ctxAudio
.
m_sbTempBufR
.
data
(),
(
*
pPath
->
pListener
->
psfOutput
)[
0
].
data
(),
ITAUPConvolution
::
OUTPUT_MIX
);
pPath
->
oDirSoundPath
.
pFIRConvolverChR
->
p
rocess
(
ctxAudio
.
m_sbTempBufD
.
data
(),
(
*
pPath
->
pListener
->
psfOutput
)[
1
].
data
(),
ITAUPConvolution
::
OUTPUT_MIX
);
pPath
->
oRefSoundPath
.
pFIRConvolverChR
->
p
rocess
(
ctxAudio
.
m_sbTempBufR
.
data
(),
(
*
pPath
->
pListener
->
psfOutput
)[
1
].
data
(),
ITAUPConvolution
::
OUTPUT_MIX
);
pPath
->
oDirSoundPath
.
pFIRConvolverChL
->
P
rocess
(
ctxAudio
.
m_sbTempBufD
.
data
(),
(
*
pPath
->
pListener
->
psfOutput
)[
0
].
data
(),
ITAUPConvolution
::
OUTPUT_MIX
);
pPath
->
oRefSoundPath
.
pFIRConvolverChL
->
P
rocess
(
ctxAudio
.
m_sbTempBufR
.
data
(),
(
*
pPath
->
pListener
->
psfOutput
)[
0
].
data
(),
ITAUPConvolution
::
OUTPUT_MIX
);
pPath
->
oDirSoundPath
.
pFIRConvolverChR
->
P
rocess
(
ctxAudio
.
m_sbTempBufD
.
data
(),
(
*
pPath
->
pListener
->
psfOutput
)[
1
].
data
(),
ITAUPConvolution
::
OUTPUT_MIX
);
pPath
->
oRefSoundPath
.
pFIRConvolverChR
->
P
rocess
(
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
->
s
etFilterExchangeMode
(
ITAUPConvolution
::
CROSSFADE_COSINE_SQUARE
);
oRefSoundPath
.
pFIRConvolverChL
->
s
etFilterExchangeMode
(
ITAUPConvolution
::
CROSSFADE_COSINE_SQUARE
);
oDirSoundPath
.
pFIRConvolverChR
->
s
etFilterExchangeMode
(
ITAUPConvolution
::
CROSSFADE_COSINE_SQUARE
);
oRefSoundPath
.
pFIRConvolverChR
->
s
etFilterExchangeMode
(
ITAUPConvolution
::
CROSSFADE_COSINE_SQUARE
);
oDirSoundPath
.
pFIRConvolverChL
->
s
etFilterCrossfadeLength
(
(
std
::
min
)(
iBlocklength
,
32
)
);
oRefSoundPath
.
pFIRConvolverChL
->
s
etFilterCrossfadeLength
(
(
std
::
min
)(
iBlocklength
,
32
)
);
oDirSoundPath
.
pFIRConvolverChR
->
s
etFilterCrossfadeLength
(
(
std
::
min
)(
iBlocklength
,
32
)
);
oRefSoundPath
.
pFIRConvolverChR
->
s
etFilterCrossfadeLength
(
(
std
::
min
)(
iBlocklength
,
32
)
);
oDirSoundPath
.
pFIRConvolverChL
->
s
etGain
(
0.0
f
,
true
);
oRefSoundPath
.
pFIRConvolverChL
->
s
etGain
(
0.0
f
,
true
);
oDirSoundPath
.
pFIRConvolverChR
->
s
etGain
(
0.0
f
,
true
);
oRefSoundPath
.
pFIRConvolverChR
->
s
etGain
(
0.0
f
,
true
);
ITAUPFilter
*
pDHRIRFilterChL
=
oDirSoundPath
.
pFIRConvolverChL
->
r
equestFilter
();
ITAUPFilter
*
pRHRIRFilterChL
=
oRefSoundPath
.
pFIRConvolverChL
->
r
equestFilter
();
ITAUPFilter
*
pDHRIRFilterChR
=
oDirSoundPath
.
pFIRConvolverChR
->
r
equestFilter
();
ITAUPFilter
*
pRHRIRFilterChR
=
oRefSoundPath
.
pFIRConvolverChR
->
r
equestFilter
();
oDirSoundPath
.
pFIRConvolverChL
->
S
etFilterExchangeMode
(
ITAUPConvolution
::
CROSSFADE_COSINE_SQUARE
);
oRefSoundPath
.
pFIRConvolverChL
->
S
etFilterExchangeMode
(
ITAUPConvolution
::
CROSSFADE_COSINE_SQUARE
);
oDirSoundPath
.
pFIRConvolverChR
->
S
etFilterExchangeMode
(
ITAUPConvolution
::
CROSSFADE_COSINE_SQUARE
);
oRefSoundPath
.
pFIRConvolverChR
->
S
etFilterExchangeMode
(
ITAUPConvolution
::
CROSSFADE_COSINE_SQUARE
);
oDirSoundPath
.
pFIRConvolverChL
->
S
etFilterCrossfadeLength
(
(
std
::
min
)(
iBlocklength
,
32
)
);
oRefSoundPath
.
pFIRConvolverChL
->
S
etFilterCrossfadeLength
(
(
std
::
min
)(
iBlocklength
,
32
)
);
oDirSoundPath
.
pFIRConvolverChR
->
S
etFilterCrossfadeLength
(
(
std
::
min
)(
iBlocklength
,
32
)
);
oRefSoundPath
.
pFIRConvolverChR
->
S
etFilterCrossfadeLength
(
(
std
::
min
)(
iBlocklength
,
32
)
);
oDirSoundPath
.
pFIRConvolverChL
->
S
etGain
(
0.0
f
,
true
);
oRefSoundPath
.
pFIRConvolverChL
->
S
etGain
(
0.0
f
,
true
);
oDirSoundPath
.
pFIRConvolverChR
->
S
etGain
(
0.0
f
,
true
);
oRefSoundPath
.
pFIRConvolverChR
->
S
etGain
(
0.0
f
,
true
);
ITAUPFilter
*
pDHRIRFilterChL
=
oDirSoundPath
.
pFIRConvolverChL
->
R
equestFilter
();
ITAUPFilter
*
pRHRIRFilterChL
=
oRefSoundPath
.
pFIRConvolverChL
->
R
equestFilter
();
ITAUPFilter
*
pDHRIRFilterChR
=
oDirSoundPath
.
pFIRConvolverChR
->
R
equestFilter
();
ITAUPFilter
*
pRHRIRFilterChR
=
oRefSoundPath
.
pFIRConvolverChR
->
R
equestFilter
();
pDHRIRFilterChL
->
identity
();
pRHRIRFilterChL
->
identity
();
pDHRIRFilterChR
->
identity
();
pRHRIRFilterChR
->
identity
();
oDirSoundPath
.
pFIRConvolverChL
->
e
xchangeFilter
(
pDHRIRFilterChL
);
oRefSoundPath
.
pFIRConvolverChL
->
e
xchangeFilter
(
pRHRIRFilterChL
);
oDirSoundPath
.
pFIRConvolverChR
->
e
xchangeFilter
(
pDHRIRFilterChR
);
oRefSoundPath
.
pFIRConvolverChR
->
e
xchangeFilter
(
pRHRIRFilterChR
);
oDirSoundPath
.
pFIRConvolverChL
->
E
xchangeFilter
(
pDHRIRFilterChL
);
oRefSoundPath
.
pFIRConvolverChL
->
E
xchangeFilter
(
pRHRIRFilterChL
);
oDirSoundPath
.
pFIRConvolverChR
->
E
xchangeFilter
(
pDHRIRFilterChR
);
oRefSoundPath
.
pFIRConvolverChR
->
E
xchangeFilter
(
pRHRIRFilterChR
);
// Auto-release filter after it is not used anymore
oDirSoundPath
.
pFIRConvolverChL
->
r
eleaseFilter
(
pDHRIRFilterChL
);
oRefSoundPath
.
pFIRConvolverChL
->
r
eleaseFilter
(
pRHRIRFilterChL
);
oDirSoundPath
.
pFIRConvolverChR
->
r
eleaseFilter
(
pDHRIRFilterChR
);
oRefSoundPath
.
pFIRConvolverChR
->
r
eleaseFilter
(
pRHRIRFilterChR
);
oDirSoundPath
.
pFIRConvolverChL
->
R
eleaseFilter
(
pDHRIRFilterChL
);
oRefSoundPath
.
pFIRConvolverChL
->
R
eleaseFilter
(
pRHRIRFilterChL
);
oDirSoundPath
.
pFIRConvolverChR
->
R
eleaseFilter
(
pDHRIRFilterChR
);
oRefSoundPath
.
pFIRConvolverChR
->
R
eleaseFilter
(
pRHRIRFilterChR
);
m_sfHRIRTemp
.
init
(
2
,
iHRIRFilterLength
,
false
);
...
...
@@ -1407,8 +1407,8 @@ void CVABATNSoundPath::UpdateHRIR()
if
(
(
oDirSoundPath
.
oHRIRStateCur
!=
oDirSoundPath
.
oHRIRStateNew
)
||
bForeUpdate
)
{
ITAUPFilter
*
pHRIRFilterChL
=
oDirSoundPath
.
pFIRConvolverChL
->
g
etFilterPool
()
->
r
equestFilter
();
ITAUPFilter
*
pHRIRFilterChR
=
oDirSoundPath
.
pFIRConvolverChR
->
g
etFilterPool
()
->
r
equestFilter
();
ITAUPFilter
*
pHRIRFilterChL
=
oDirSoundPath
.
pFIRConvolverChL
->
G
etFilterPool
()
->
R
equestFilter
();
ITAUPFilter
*
pHRIRFilterChR
=
oDirSoundPath
.
pFIRConvolverChR
->
G
etFilterPool
()
->
R
equestFilter
();
if
(
pDirSoundPathHRIRDataNew
==
nullptr
)
{
...
...
@@ -1423,10 +1423,10 @@ void CVABATNSoundPath::UpdateHRIR()
m_sfHRIRTemp
.
init
(
2
,
iNewFilterLength
,
false
);
}
if
(
iNewFilterLength
>
oDirSoundPath
.
pFIRConvolverChL
->
g
etMaxFilterlength
()
)
if
(
iNewFilterLength
>
oDirSoundPath
.
pFIRConvolverChL
->
G
etMaxFilterlength
()
)
{
VA_WARN
(
"CVABATNSoundPath"
,
"HRIR too long for convolver, cropping. Increase HRIR filter length in BinauralFreefieldAudioRenderer configuration."
);
iNewFilterLength
=
oDirSoundPath
.
pFIRConvolverChL
->
g
etMaxFilterlength
();
iNewFilterLength
=
oDirSoundPath
.
pFIRConvolverChL
->
G
etMaxFilterlength
();
}
if
(
pDirSoundPathHRIRDataNew
->
GetProperties
()
->
bSpaceDiscrete
)
...
...
@@ -1440,14 +1440,14 @@ void CVABATNSoundPath::UpdateHRIR()
float
(
oDirSoundPath
.
oRelations
.
dAzimuthL2S
),
float
(
oDirSoundPath
.
oRelations
.
dElevationL2S
),
float
(
oDirSoundPath
.
oRelations
.
dDistance
)
);
}
pHRIRFilterChL
->
l
oad
(
m_sfHRIRTemp
[
0
].
data
(),
iNewFilterLength
);
pHRIRFilterChR
->
l
oad
(
m_sfHRIRTemp
[
1
].
data
(),
iNewFilterLength
);
pHRIRFilterChL
->
L
oad
(
m_sfHRIRTemp
[
0
].
data
(),
iNewFilterLength
);
pHRIRFilterChR
->
L
oad
(
m_sfHRIRTemp
[
1
].
data
(),
iNewFilterLength
);
}
oDirSoundPath
.
pFIRConvolverChL
->
e
xchangeFilter
(
pHRIRFilterChL
);
oDirSoundPath
.
pFIRConvolverChR
->
e
xchangeFilter
(
pHRIRFilterChR
);
oDirSoundPath
.
pFIRConvolverChL
->
r
eleaseFilter
(
pHRIRFilterChL
);
oDirSoundPath
.
pFIRConvolverChR
->
r
eleaseFilter
(
pHRIRFilterChR
);
oDirSoundPath
.
pFIRConvolverChL
->
E
xchangeFilter
(
pHRIRFilterChL
);
oDirSoundPath
.
pFIRConvolverChR
->
E
xchangeFilter
(
pHRIRFilterChR
);
oDirSoundPath
.
pFIRConvolverChL
->
R
eleaseFilter
(
pHRIRFilterChL
);
oDirSoundPath
.
pFIRConvolverChR
->
R
eleaseFilter
(
pHRIRFilterChR
);
// Ack
oDirSoundPath
.
oHRIRStateCur
=
oDirSoundPath
.
oHRIRStateNew
;
...
...
@@ -1468,8 +1468,8 @@ void CVABATNSoundPath::UpdateHRIR()
if
(
(
oRefSoundPath
.
oHRIRStateCur
!=
oRefSoundPath
.
oHRIRStateNew
)
||
bForeUpdate
)
{
ITAUPFilter
*
pHRIRFilterChL
=
oRefSoundPath
.
pFIRConvolverChL
->
g
etFilterPool
()
->
r
equestFilter
();
ITAUPFilter
*
pHRIRFilterChR
=
oRefSoundPath
.
pFIRConvolverChR
->
g
etFilterPool
()
->
r
equestFilter
();
ITAUPFilter
*
pHRIRFilterChL
=
oRefSoundPath
.
pFIRConvolverChL
->
G
etFilterPool
()
->
R
equestFilter
();
ITAUPFilter
*
pHRIRFilterChR
=
oRefSoundPath
.
pFIRConvolverChR
->
G
etFilterPool
()
->
R
equestFilter
();
if
(
pRefSoundPathHRIRDataNew
==
nullptr
)
{
...
...
@@ -1484,10 +1484,10 @@ void CVABATNSoundPath::UpdateHRIR()
m_sfHRIRTemp
.
init
(
2
,
iNewFilterLength
,
false
);
}
if
(
iNewFilterLength
>
oRefSoundPath
.
pFIRConvolverChL
->
g
etMaxFilterlength
()
)
if
(
iNewFilterLength
>
oRefSoundPath
.
pFIRConvolverChL
->
G
etMaxFilterlength
()
)
{
VA_WARN
(
"CVABATNSoundPath"
,
"HRIR too long for convolver, cropping. Increase HRIR filter length in BinauralFreefieldAudioRenderer configuration."
);
iNewFilterLength
=
oRefSoundPath
.
pFIRConvolverChL
->
g
etMaxFilterlength
();
iNewFilterLength
=
oRefSoundPath
.
pFIRConvolverChL
->
G
etMaxFilterlength
();
}
if
(
pRefSoundPathHRIRDataNew
->
GetProperties
()
->
bSpaceDiscrete
)
...
...
@@ -1501,14 +1501,14 @@ void CVABATNSoundPath::UpdateHRIR()
float
(
oRefSoundPath
.
oRelations
.
dAzimuthL2S
),
float
(
oRefSoundPath
.
oRelations
.
dElevationL2S
),
float
(
oRefSoundPath
.
oRelations
.
dDistance
)
);
}
pHRIRFilterChL
->
l
oad
(
m_sfHRIRTemp
[
0
].
data
(),
iNewFilterLength
);
pHRIRFilterChR
->
l
oad
(
m_sfHRIRTemp
[
1
].
data
(),
iNewFilterLength
);
pHRIRFilterChL
->
L
oad
(
m_sfHRIRTemp
[
0
].
data
(),
iNewFilterLength
);
pHRIRFilterChR
->
L
oad
(
m_sfHRIRTemp
[
1
].
data
(),
iNewFilterLength
);
}
oRefSoundPath
.
pFIRConvolverChL
->
e
xchangeFilter
(
pHRIRFilterChL
);
oRefSoundPath
.
pFIRConvolverChR
->
e
xchangeFilter
(
pHRIRFilterChR
);
oRefSoundPath
.
pFIRConvolverChL
->
r
eleaseFilter
(
pHRIRFilterChL
);
oRefSoundPath
.
pFIRConvolverChR
->
r
eleaseFilter
(
pHRIRFilterChR
);
oRefSoundPath
.
pFIRConvolverChL
->
E
xchangeFilter
(
pHRIRFilterChL
);
oRefSoundPath
.
pFIRConvolverChR
->
E
xchangeFilter
(
pHRIRFilterChR
);
oRefSoundPath
.
pFIRConvolverChL
->
R
eleaseFilter
(
pHRIRFilterChL
);
oRefSoundPath
.
pFIRConvolverChR
->
R
eleaseFilter
(
pHRIRFilterChR
);
// Ack
oRefSoundPath
.
oHRIRStateCur
=
oRefSoundPath
.
oHRIRStateNew
;
...
...
src/Rendering/Binaural/ArtificialReverb/VABinauralArtificialReverb.cpp
View file @
1371d5d4
This diff is collapsed.
Click to expand it.
src/Rendering/Binaural/FreeField/VABinauralFreeFieldAudioRenderer.cpp
View file @
1371d5d4
...
...
@@ -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.0
f
;
pPath
->
pFIRConvolverChL
->
s
etGain
(
fSoundSourceGain
);
pPath
->
pFIRConvolverChR
->
s
etGain
(
fSoundSourceGain
);
pPath
->
pFIRConvolverChL
->
S
etGain
(
fSoundSourceGain
);
pPath
->
pFIRConvolverChR
->
S
etGain
(
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
->
p
rocess
(
ctxAudio
.
m_sbTempL
.
data
(),
(
*
pPath
->
pListener
->
psfOutput
)[
0
].
data
(),
ITAUPConvolution
::
OUTPUT_MIX
);
pPath
->
pFIRConvolverChR
->
p
rocess
(
ctxAudio
.
m_sbTempR
.
data
(),
(
*
pPath
->
pListener
->
psfOutput
)[
1
].
data
(),
ITAUPConvolution
::
OUTPUT_MIX
);
pPath
->
pFIRConvolverChL
->
P
rocess
(
ctxAudio
.
m_sbTempL
.
data
(),
(
*
pPath
->
pListener
->
psfOutput
)[
0
].
data
(),
ITAUPConvolution
::
OUTPUT_MIX
);
pPath
->
pFIRConvolverChR
->
P
rocess
(
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
->
s
etFilterExchangeMode
(
ITAUPConvolution
::
CROSSFADE_COSINE_SQUARE
);
pFIRConvolverChL
->
s
etFilterCrossfadeLength
(
(
std
::
min
)(
iBlocklength
,
32
)
);
pFIRConvolverChL
->
s
etGain
(
0.0
f
,
true
);
ITAUPFilter
*
pHRIRFilterChL
=
pFIRConvolverChL
->
r
equestFilter
();
pFIRConvolverChL
->
S
etFilterExchangeMode
(
ITAUPConvolution
::
CROSSFADE_COSINE_SQUARE
);
pFIRConvolverChL
->
S
etFilterCrossfadeLength
(
(
std
::
min
)(
iBlocklength
,
32
)
);
pFIRConvolverChL
->
S
etGain
(
0.0
f
,
true
);
ITAUPFilter
*
pHRIRFilterChL
=
pFIRConvolverChL
->
R
equestFilter
();
pHRIRFilterChL
->
identity
();
pFIRConvolverChL
->
e
xchangeFilter
(
pHRIRFilterChL
);
pFIRConvolverChL
->
E
xchangeFilter
(
pHRIRFilterChL
);
pFIRConvolverChR
=
new
ITAUPConvolution
(
iBlocklength
,
iHRIRFilterLength
);
pFIRConvolverChR
->
s
etFilterExchangeMode
(
ITAUPConvolution
::
CROSSFADE_COSINE_SQUARE
);
pFIRConvolverChR
->
s
etFilterCrossfadeLength
(
(
std
::
min
)(
iBlocklength
,
32
)
);
pFIRConvolverChR
->
s
etGain
(
0.0
f
,
true
);
ITAUPFilter
*
pHRIRFilterChR
=
pFIRConvolverChR
->
r
equestFilter
();
pFIRConvolverChR
->
S
etFilterExchangeMode
(
ITAUPConvolution
::
CROSSFADE_COSINE_SQUARE
);
pFIRConvolverChR
->
S
etFilterCrossfadeLength
(
(
std
::
min
)(
iBlocklength
,
32
)
);
pFIRConvolverChR
->
S
etGain
(
0.0
f
,
true
);
ITAUPFilter
*
pHRIRFilterChR
=
pFIRConvolverChR
->
R
equestFilter
();
pHRIRFilterChR
->
identity
();
pFIRConvolverChL
->
e
xchangeFilter
(
pHRIRFilterChR
);
pFIRConvolverChL
->
E
xchangeFilter
(
pHRIRFilterChR
);
// Auto-release filter after it is not used anymore
pFIRConvolverChL
->
r
eleaseFilter
(
pHRIRFilterChL
);
pFIRConvolverChR
->
r
eleaseFilter
(
pHRIRFilterChR
);
pFIRConvolverChL
->
R
eleaseFilter
(
pHRIRFilterChL
);
pFIRConvolverChR
->
R
eleaseFilter
(
pHRIRFilterChR
);
m_sfHRIRTemp
.
init
(
2
,
iHRIRFilterLength
,
false
);
...
...
@@ -1256,8 +1256,8 @@ void CVABFFSoundPath::UpdateHRIR( const CVAListenerState::CVAAnthropometricParam
if
(
(
oHRIRStateCur
!=
oHRIRStateNew
)
||
bForeUpdate
)
{
ITAUPFilter
*
pHRIRFilterChL
=
pFIRConvolverChL
->
g
etFilterPool
()
->
r
equestFilter
();
ITAUPFilter
*
pHRIRFilterChR
=
pFIRConvolverChR
->
g
etFilterPool
()
->
r
equestFilter
();
ITAUPFilter
*
pHRIRFilterChL
=
pFIRConvolverChL
->
G
etFilterPool
()
->
R
equestFilter
();
ITAUPFilter
*
pHRIRFilterChR
=
pFIRConvolverChR
->
G
etFilterPool
()
->
R
equestFilter
();
if
(
pHRIRDataNew
==
nullptr
)
{
...
...
@@ -1272,10 +1272,10 @@ void CVABFFSoundPath::UpdateHRIR( const CVAListenerState::CVAAnthropometricParam
m_sfHRIRTemp
.
init
(
2
,
iNewFilterLength
,
false
);
}
if
(
iNewFilterLength
>
pFIRConvolverChL
->
g
etMaxFilterlength
()
)
if
(
iNewFilterLength
>
pFIRConvolverChL
->
G
etMaxFilterlength
()
)
{
VA_WARN
(
"CVABFFSoundPath"
,
"HRIR too long for convolver, cropping. Increase HRIR filter length in BinauralFreefieldAudioRenderer configuration."
);
iNewFilterLength
=
pFIRConvolverChL
->
g
etMaxFilterlength
();
iNewFilterLength
=
pFIRConvolverChL
->
G
etMaxFilterlength
();
}
if
(
pHRIRDataNew
->
GetProperties
()
->
bSpaceDiscrete
)
...
...
@@ -1289,14 +1289,14 @@ void CVABFFSoundPath::UpdateHRIR( const CVAListenerState::CVAAnthropometricParam
float
(
oRelations
.
dElevationL2S
),
float
(
oRelations
.
dDistance
)
);
}
pHRIRFilterChL
->
l
oad
(
m_sfHRIRTemp
[
0
].
data
(),
iNewFilterLength
);
pHRIRFilterChR
->
l
oad
(
m_sfHRIRTemp
[
1
].
data
(),
iNewFilterLength
);
pHRIRFilterChL
->
L
oad
(
m_sfHRIRTemp
[
0
].
data
(),
iNewFilterLength
);
pHRIRFilterChR
->
L
oad
(
m_sfHRIRTemp
[
1
].
data
(),
iNewFilterLength
);
}
pFIRConvolverChL
->
e
xchangeFilter
(
pHRIRFilterChL
);
pFIRConvolverChR
->
e
xchangeFilter
(
pHRIRFilterChR
);
pFIRConvolverChL
->
r
eleaseFilter
(
pHRIRFilterChL
);
pFIRConvolverChR
->
r
eleaseFilter
(
pHRIRFilterChR
);
pFIRConvolverChL
->
E
xchangeFilter
(
pHRIRFilterChL
);
pFIRConvolverChR
->
E
xchangeFilter
(
pHRIRFilterChR
);
pFIRConvolverChL
->
R
eleaseFilter
(
pHRIRFilterChL
);
pFIRConvolverChR
->
R
eleaseFilter
(
pHRIRFilterChR
);
// Ack
oHRIRStateCur
=
oHRIRStateNew
;
...
...
src/Rendering/Binaural/RoomAcoustics/VARoomAcousticsAudioRenderer.cpp
View file @
1371d5d4
...
...
@@ -535,22 +535,22 @@ ComplexSoundPath::ComplexSoundPath( double dSamplerate, int iBlocklength, int iR
:
m_pRenderer
(
nullptr
)
{
// Falter
int
iRIRConvolverLength
=
pParentFilterPool
->
g
etMaxFilterlength
();
int
iRIRConvolverLength
=
pParentFilterPool
->
G
etMaxFilterlength
();
pRIRConvolverCh0
=
new
ITAUPConvolution
(
iBlocklength
,
iRIRConvolverLength
,
pParentFilterPool
);
pRIRConvolverCh0
->
s
etFilterExchangeMode
(
ITAUPConvolution
::
CROSSFADE_COSINE_SQUARE
);
pRIRConvolverCh0
->
s
etFilterCrossfadeLength
(
(
std
::
min
)(
iBlocklength
,
32
)
);
ITAUPFilter
*
pRIRFilterCh0
=
pRIRConvolverCh0
->
r
equestFilter
();
pRIRFilterCh0
->
z
eros
();
pRIRConvolverCh0
->
e
xchangeFilter
(
pRIRFilterCh0
);
pRIRConvolverCh0
->
r
eleaseFilter
(
pRIRFilterCh0
);
pRIRConvolverCh0
->
S
etFilterExchangeMode
(
ITAUPConvolution
::
CROSSFADE_COSINE_SQUARE
);
pRIRConvolverCh0
->
S
etFilterCrossfadeLength
(
(
std
::
min
)(
iBlocklength
,
32
)
);
ITAUPFilter
*
pRIRFilterCh0
=
pRIRConvolverCh0
->
R
equestFilter
();
pRIRFilterCh0
->
Z
eros
();
pRIRConvolverCh0
->
E
xchangeFilter
(
pRIRFilterCh0
);
pRIRConvolverCh0
->
R
eleaseFilter
(
pRIRFilterCh0
);
pRIRConvolverCh1
=
new
ITAUPConvolution
(
iBlocklength
,
iRIRConvolverLength
,
pParentFilterPool
);
pRIRConvolverCh1
->
s
etFilterExchangeMode
(
ITAUPConvolution
::
CROSSFADE_COSINE_SQUARE
);
pRIRConvolverCh1
->
s
etFilterCrossfadeLength
(
(
std
::
min
)(
iBlocklength
,
32
)
);
ITAUPFilter
*
pRIRFilterCh1
=
pRIRConvolverCh1
->
r
equestFilter
();
pRIRFilterCh1
->
z
eros
();
pRIRConvolverCh1
->
e
xchangeFilter
(
pRIRFilterCh1
);
pRIRConvolverCh1
->
r
eleaseFilter
(
pRIRFilterCh1
);
pRIRConvolverCh1
->
S
etFilterExchangeMode
(
ITAUPConvolution
::
CROSSFADE_COSINE_SQUARE
);
pRIRConvolverCh1
->
S
etFilterCrossfadeLength
(
(
std
::
min
)(
iBlocklength
,
32
)
);
ITAUPFilter
*
pRIRFilterCh1
=
pRIRConvolverCh1
->
R
equestFilter
();
pRIRFilterCh1
->
Z
eros
();
pRIRConvolverCh1
->
E
xchangeFilter
(
pRIRFilterCh1
);
pRIRConvolverCh1
->
R
eleaseFilter
(
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
->
r
equestFilter
();
ITAUPFilter
*
pRIRFilterCh1
=
pRIRConvolverCh1
->
r
equestFilter
();
ITAUPFilter
*
pRIRFilterCh0
=
pRIRConvolverCh0
->
R
equestFilter
();
ITAUPFilter
*
pRIRFilterCh1
=
pRIRConvolverCh1
->
R
equestFilter
();
float
*
pfRIRDataCh0
=
sfRIRTemp
[
0
].
data
();
float
*
pfRIRDataCh1
=
sfRIRTemp
[
1
].
data
();
int
iCount
=
(
std
::
min
)(
sfRIRTemp
.
length
(),
pRIRConvolverCh0
->
g
etMaxFilterlength
()
);
pRIRFilterCh0
->
l
oad
(
pfRIRDataCh0
,
iCount
);
pRIRFilterCh1
->
l
oad
(
pfRIRDataCh1
,
iCount
);
int
iCount
=
(
std
::
min
)(
sfRIRTemp
.
length
(),
pRIRConvolverCh0
->
G
etMaxFilterlength
()
);
pRIRFilterCh0
->
L
oad
(
pfRIRDataCh0
,
iCount
);
pRIRFilterCh1
->
L
oad
(
pfRIRDataCh1
,
iCount
);
pRIRConvolverCh0
->
e
xchangeFilter
(
pRIRFilterCh0
);
pRIRConvolverCh1
->
e
xchangeFilter
(
pRIRFilterCh1
);
pRIRConvolverCh0
->
E
xchangeFilter
(
pRIRFilterCh0
);
pRIRConvolverCh1
->
E
xchangeFilter
(
pRIRFilterCh1
);
pRIRConvolverCh0
->
r
eleaseFilter
(
pRIRFilterCh0
);
pRIRConvolverCh1
->
r
eleaseFilter
(
pRIRFilterCh1
);
pRIRConvolverCh0
->
R
eleaseFilter
(
pRIRFilterCh0
);
pRIRConvolverCh1
->
R
eleaseFilter
(
pRIRFilterCh1
);
bool
bPathMuted
=
pSource
->
pData
->
bMuted
||
!
bEntitiesInSameRoom
;
pRIRConvolverCh0
->
s
etGain
(
bPathMuted
?
0.0
f
:
1.0
f
);
pRIRConvolverCh1
->
s
etGain
(
bPathMuted
?
0.0
f
:
1.0
f