Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
ITADSP
Commits
2932d2db
Commit
2932d2db
authored
Feb 27, 2018
by
Dipl.-Ing. Jonas Stienen
Browse files
Style and trying to find issue with uninitialized return buffer from VDL
parent
6a775bd5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ITAVariableDelayLine.cpp
View file @
2932d2db
...
...
@@ -16,7 +16,7 @@
// Interpolation resampling factor range (otherwise crossfading is used)
#define MIN_RESAMPLING_FACTOR 0.0f // [0, inf) ... aber sinnvoll z.B. 0, 0.1, 0.5 (< 1)
#define MIN_RESAMPLING_FACTOR 0.0
1
f // [0, inf) ... aber sinnvoll z.B. 0, 0.1, 0.5 (< 1)
#define MAX_RESAMPLING_FACTOR 25.0f // [0, inf) ... aber sinnvoll z.B. 1, 1.5, 2, 3 (> 1)
...
...
@@ -61,7 +61,8 @@ CITAVariableDelayLine::CITAVariableDelayLine( double dSamplerate,
Clear
();
}
void
CITAVariableDelayLine
::
Clear
()
{
void
CITAVariableDelayLine
::
Clear
()
{
m_psbVDLBuffer
->
Zero
();
m_psbTemp
->
Zero
();
...
...
@@ -157,7 +158,8 @@ void CITAVariableDelayLine::ReserveMaximumDelaySamples( float fMaxDelaySamples )
{
// Puffer schon gross genug => Nichts tun...
if
(
m_psbVDLBuffer
->
length
()
>=
iNewBufferSize
)
return
;
if
(
m_psbVDLBuffer
->
length
()
>=
iNewBufferSize
)
return
;
m_swBufferSizeInc
.
start
();
...
...
@@ -284,7 +286,8 @@ void CITAVariableDelayLine::Process( const ITASampleBuffer* psbInput, ITASampleB
// --= Keine nderung der Verzgerung (fr rasant schnelle statische Szenen) =--
if
(
fNewDelay
==
fCurrentDelay
)
{
if
(
fNewDelay
==
fCurrentDelay
)
{
// Keine nderung der Verzgerung. Einfach Anfang der VDL in den Ausgang kopieren.
int
iReadCursor
=
(
m_iWriteCursor
+
m_iVDLBufferSize
-
(
int
)
ceil
(
fCurrentDelay
)
)
%
m_iVDLBufferSize
;
psbOutput
->
cyclic_write
(
m_psbVDLBuffer
,
m_iBlockLength
,
iReadCursor
,
0
);
...
...
@@ -441,6 +444,12 @@ void CITAVariableDelayLine::Process( const ITASampleBuffer* psbInput, ITASampleB
int
iInputStartOffset
=
iLeft
;
m_pInterpolationRoutine
->
Interpolate
(
m_psbTemp
,
iInputLength
,
iInputStartOffset
,
psbOutput
,
m_iBlockLength
);
for
(
int
k
=
0
;
k
<
psbOutput
->
GetLength
();
k
++
)
{
if
(
isnan
(
psbOutput
->
GetData
()[
k
]
)
)
ITA_EXCEPT1
(
INVALID_PARAMETER
,
"VDL produced NAN value when switching from "
+
IntToString
(
iCurrentIntDelay
)
+
" to "
+
IntToString
(
iNewIntDelay
)
+
" with interpolation"
);
}
break
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment