Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
VACore
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
VACore
Commits
32449d41
Commit
32449d41
authored
Sep 25, 2018
by
Lucas Moesch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP - fixing bugs
parent
172dbc8c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
92 additions
and
43 deletions
+92
-43
src/Rendering/Binaural/RealTime/Utils/BinauralClusterEngine/VABinauralClusterEngine.cpp
...e/Utils/BinauralClusterEngine/VABinauralClusterEngine.cpp
+12
-2
src/Rendering/Binaural/RealTime/Utils/BinauralClusterEngine/VABinauralClusterEngine.h
...ime/Utils/BinauralClusterEngine/VABinauralClusterEngine.h
+5
-4
src/Rendering/Binaural/RealTime/Utils/BinauralClusterEngine/VABinauralClustering.cpp
...Time/Utils/BinauralClusterEngine/VABinauralClustering.cpp
+37
-30
src/Rendering/Binaural/RealTime/Utils/BinauralListener/VABinauralListener.h
...ural/RealTime/Utils/BinauralListener/VABinauralListener.h
+2
-1
src/Rendering/Binaural/RealTime/VABinauralRealTimeRenderer.cpp
...endering/Binaural/RealTime/VABinauralRealTimeRenderer.cpp
+34
-4
tests/CoreTest.cpp
tests/CoreTest.cpp
+2
-2
No files found.
src/Rendering/Binaural/RealTime/Utils/BinauralClusterEngine/VABinauralClusterEngine.cpp
View file @
32449d41
...
@@ -34,9 +34,11 @@ VABinauralClusterEngine::update()
...
@@ -34,9 +34,11 @@ VABinauralClusterEngine::update()
}
}
VABinauralClustering
*
VABinauralClustering
*
VABinauralClusterEngine
::
getClustering
(
int
listenerID
)
VABinauralClusterEngine
::
getClustering
(
const
int
listenerID
)
{
{
std
::
map
<
int
,
VABinauralClustering
*
>::
iterator
it
=
_clusterings
.
find
(
listenerID
);
const
int
id
=
listenerID
;
auto
it
=
_clusterings
.
find
(
id
);
return
it
->
second
;
return
it
->
second
;
}
}
...
@@ -49,6 +51,8 @@ VABinauralClusterEngine::addSource( int sourceID, VABinauralSoundSource* source
...
@@ -49,6 +51,8 @@ VABinauralClusterEngine::addSource( int sourceID, VABinauralSoundSource* source
{
{
it
->
second
->
addSource
(
sourceID
,
source
);
it
->
second
->
addSource
(
sourceID
,
source
);
}
}
_sources
.
insert
(
std
::
pair
<
int
,
VABinauralSoundSource
*
>
(
sourceID
,
source
));
}
}
void
void
...
@@ -70,7 +74,13 @@ VABinauralClusterEngine::addListener(int listenerID, VABinauralListener* listene
...
@@ -70,7 +74,13 @@ VABinauralClusterEngine::addListener(int listenerID, VABinauralListener* listene
// add local reference
// add local reference
_clusterings
.
insert
(
std
::
pair
<
int
,
VABinauralClustering
*
>
(
listenerID
,
clustering
));
_clusterings
.
insert
(
std
::
pair
<
int
,
VABinauralClustering
*
>
(
listenerID
,
clustering
));
_listeners
.
insert
(
std
::
pair
<
int
,
VABinauralListener
*
>
(
listenerID
,
listener
));
// add preexisting sources
for
(
auto
const
&
sourceIt
:
_sources
)
{
clustering
->
addSource
(
sourceIt
.
first
,
sourceIt
.
second
);
}
}
}
void
void
...
...
src/Rendering/Binaural/RealTime/Utils/BinauralClusterEngine/VABinauralClusterEngine.h
View file @
32449d41
...
@@ -21,6 +21,8 @@ public:
...
@@ -21,6 +21,8 @@ public:
int
numCluster
;
int
numCluster
;
};
};
std
::
map
<
int
,
VABinauralClustering
*
>
_clusterings
;
~
VABinauralClusterEngine
();
~
VABinauralClusterEngine
();
VABinauralClusterEngine
();
VABinauralClusterEngine
();
...
@@ -29,7 +31,7 @@ public:
...
@@ -29,7 +31,7 @@ public:
update
();
update
();
VABinauralClustering
*
VABinauralClustering
*
getClustering
(
int
listenerID
);
getClustering
(
const
int
listenerID
);
void
void
addSource
(
int
sourceID
,
VABinauralSoundSource
*
source
);
addSource
(
int
sourceID
,
VABinauralSoundSource
*
source
);
...
@@ -45,13 +47,12 @@ public:
...
@@ -45,13 +47,12 @@ public:
private:
private:
std
::
map
<
int
,
VABinauralSoundSource
*
>
_newSources
;
std
::
map
<
int
,
VABinauralSoundSource
*
>
_newSources
;
std
::
map
<
int
,
VABinauralClustering
*
>
_clusterings
;
IVAObjectPool
*
_sourcePool
;
IVAObjectPool
*
_sourcePool
;
IVAObjectPool
*
_clusteringPool
;
IVAObjectPool
*
_clusteringPool
;
//
std::map< int, VABinauralSoundSource* > _sources;
std
::
map
<
int
,
VABinauralSoundSource
*
>
_sources
;
//std::map< int, VABinauralListener* > _listener
;
std
::
map
<
int
,
VABinauralListener
*
>
_listeners
;
};
};
...
...
src/Rendering/Binaural/RealTime/Utils/BinauralClusterEngine/VABinauralClustering.cpp
View file @
32449d41
...
@@ -69,49 +69,56 @@ VABinauralClustering::getOutput()
...
@@ -69,49 +69,56 @@ VABinauralClustering::getOutput()
void
void
VABinauralClustering
::
update
()
VABinauralClustering
::
update
()
{
{
VABinauralClusteringState
*
state
=
new
VABinauralClusteringState
(
*
_curState
);
//TODO: DIRTY HACK
// remove removed sources
if
(
_nextState
==
nullptr
)
std
::
set
<
int
>::
const_iterator
it
;
for
(
it
=
_delSourceIDs
.
begin
();
it
!=
_delSourceIDs
.
end
();
++
it
)
{
{
// remove if in unassigned sources
std
::
map
<
int
,
VABinauralSoundSource
*
>::
iterator
delIt
=
_unassignedSources
.
find
(
*
it
);
VABinauralSoundSource
*
source
=
delIt
->
second
;
state
->
removeSource
(
*
it
);
VABinauralClusteringState
*
state
=
new
VABinauralClusteringState
(
*
_curState
);
_unassignedSources
.
erase
(
delIt
);
// remove removed sources
std
::
set
<
int
>::
const_iterator
it
;
// remove if in assigned sources
for
(
it
=
_delSourceIDs
.
begin
();
it
!=
_delSourceIDs
.
end
();
++
it
)
delIt
=
_assignedSources
.
find
(
*
it
);
{
source
=
delIt
->
second
;
// remove if in unassigned sources
std
::
map
<
int
,
VABinauralSoundSource
*
>::
iterator
delIt
=
_unassignedSources
.
find
(
*
it
);
VABinauralSoundSource
*
source
=
delIt
->
second
;
_assignedSources
.
erase
(
delIt
);
state
->
removeSource
(
*
it
);
}
// add unassigned sources
_unassignedSources
.
erase
(
delIt
);
std
::
map
<
int
,
VABinauralSoundSource
*
>::
iterator
sourceIt
;
for
(
sourceIt
=
_unassignedSources
.
begin
();
sourceIt
!=
_unassignedSources
.
end
();
++
sourceIt
)
// remove if in assigned sources
{
delIt
=
_assignedSources
.
find
(
*
it
);
state
->
addSource
(
sourceIt
->
first
,
sourceIt
->
second
,
_threshold
,
0
);
source
=
delIt
->
second
;
}
// TODO: refinement
_assignedSources
.
erase
(
delIt
);
}
// update source status
// add unassigned sources
for
(
auto
const
&
assignedSources
:
_assignedSources
)
std
::
map
<
int
,
VABinauralSoundSource
*
>::
iterator
sourceIt
;
{
_assignedSources
.
insert
(
std
::
pair
<
int
,
VABinauralSoundSource
*
>
(
assignedSources
.
first
,
assignedSources
.
second
));
}
_unassignedSources
.
clear
();
for
(
sourceIt
=
_unassignedSources
.
begin
();
sourceIt
!=
_unassignedSources
.
end
();
++
sourceIt
)
{
state
->
addSource
(
sourceIt
->
first
,
sourceIt
->
second
,
_threshold
,
0
);
}
_nextState
.
reset
(
state
);
// TODO: refinement
// TODO: update fixed clustertrajectories
// update source status
for
(
auto
const
&
assignedSources
:
_assignedSources
)
{
_assignedSources
.
insert
(
std
::
pair
<
int
,
VABinauralSoundSource
*
>
(
assignedSources
.
first
,
assignedSources
.
second
));
}
_unassignedSources
.
clear
();
_nextState
.
reset
(
state
);
// TODO: update fixed clustertrajectories
}
}
}
void
void
...
...
src/Rendering/Binaural/RealTime/Utils/BinauralListener/VABinauralListener.h
View file @
32449d41
...
@@ -28,12 +28,13 @@ public:
...
@@ -28,12 +28,13 @@ public:
int
motionModelNumHistoryKeys
;
int
motionModelNumHistoryKeys
;
};
};
bool
hasValidTrajectory
;
CVAListenerDesc
*
data
;
CVAListenerDesc
*
data
;
CVASharedMotionModel
*
motionModel
;
CVASharedMotionModel
*
motionModel
;
VAVec3
predPos
;
VAVec3
predPos
;
VAVec3
pre
f
View
;
VAVec3
pre
d
View
;
VAVec3
predUp
;
VAVec3
predUp
;
ITASampleFrame
*
output
;
ITASampleFrame
*
output
;
...
...
src/Rendering/Binaural/RealTime/VABinauralRealTimeRenderer.cpp
View file @
32449d41
...
@@ -146,7 +146,7 @@ VABinauralRealTimeRenderer::ProcessStream(const ITAStreamInfo* streamInfo)
...
@@ -146,7 +146,7 @@ VABinauralRealTimeRenderer::ProcessStream(const ITAStreamInfo* streamInfo)
updateTrajectories
(
time
);
updateTrajectories
(
time
);
// -- create output for every listener
// -- create output for every listener
std
::
map
<
int
,
VABinauralListener
*
>::
const_iterator
it
;
/*
std::map< int, VABinauralListener* >::const_iterator it;
for (it = _listeners.begin(); it != _listeners.end(); ++it)
for (it = _listeners.begin(); it != _listeners.end(); ++it)
{
{
VABinauralClustering* clustering = _clusterEngine.getClustering(it->first);
VABinauralClustering* clustering = _clusterEngine.getClustering(it->first);
...
@@ -157,6 +157,17 @@ VABinauralRealTimeRenderer::ProcessStream(const ITAStreamInfo* streamInfo)
...
@@ -157,6 +157,17 @@ VABinauralRealTimeRenderer::ProcessStream(const ITAStreamInfo* streamInfo)
fm_copy(outputChL, (*output)[0].data(), m_uiBlocklength);
fm_copy(outputChL, (*output)[0].data(), m_uiBlocklength);
fm_copy(outputChR, (*output)[1].data(), m_uiBlocklength);
fm_copy(outputChR, (*output)[1].data(), m_uiBlocklength);
}
}
} */
// TEST
for
(
auto
const
&
clusteringIt
:
_clusterEngine
.
_clusterings
)
{
VABinauralClustering
*
clustering
=
clusteringIt
.
second
;
output
=
clustering
->
getOutput
();
fm_copy
(
outputChL
,
(
*
output
)[
0
].
data
(),
m_uiBlocklength
);
fm_copy
(
outputChR
,
(
*
output
)[
1
].
data
(),
m_uiBlocklength
);
}
}
IncrementWritePointer
();
IncrementWritePointer
();
...
@@ -184,6 +195,12 @@ VABinauralRealTimeRenderer::UpdateScene(CVASceneState* newSceneState)
...
@@ -184,6 +195,12 @@ VABinauralRealTimeRenderer::UpdateScene(CVASceneState* newSceneState)
// update sources
// update sources
updateSources
(
&
diff
);
updateSources
(
&
diff
);
// Alte Szene freigeben (dereferenzieren)
if
(
_curSceneState
)
_curSceneState
->
RemoveReference
();
_curSceneState
=
_newSceneState
;
_newSceneState
=
nullptr
;
}
}
/*
/*
...
@@ -273,6 +290,7 @@ VABinauralRealTimeRenderer::updateListeners( CVASceneStateDiff* diff )
...
@@ -273,6 +290,7 @@ VABinauralRealTimeRenderer::updateListeners( CVASceneStateDiff* diff )
}
}
}
}
_clusterEngine
.
update
();
}
}
void
void
...
@@ -372,15 +390,27 @@ void VABinauralRealTimeRenderer::updateMotionStates()
...
@@ -372,15 +390,27 @@ void VABinauralRealTimeRenderer::updateMotionStates()
void
void
VABinauralRealTimeRenderer
::
updateTrajectories
(
double
time
)
VABinauralRealTimeRenderer
::
updateTrajectories
(
double
time
)
{
{
std
::
map
<
int
,
VABinauralSoundSource
*>::
iterator
it
;
for
(
it
=
_sources
.
begin
();
it
!=
_sources
.
end
();
++
it
)
for
(
auto
const
&
sourceIt
:
_sources
)
{
{
bool
isValid
=
true
;
bool
isValid
=
true
;
VABinauralSoundSource
*
source
=
it
->
second
;
VABinauralSoundSource
*
source
=
sourceIt
.
second
;
source
->
motionModel
->
HandleMotionKeys
();
source
->
motionModel
->
HandleMotionKeys
();
isValid
&=
source
->
motionModel
->
EstimatePosition
(
time
,
source
->
predPos
);
isValid
&=
source
->
motionModel
->
EstimatePosition
(
time
,
source
->
predPos
);
isValid
&=
source
->
motionModel
->
EstimateOrientation
(
time
,
source
->
predView
,
source
->
predUp
);
isValid
&=
source
->
motionModel
->
EstimateOrientation
(
time
,
source
->
predView
,
source
->
predUp
);
source
->
hasValidTrajectory
=
isValid
;
source
->
hasValidTrajectory
=
isValid
;
}
}
for
(
auto
const
&
listenerIt
:
_listeners
)
{
bool
isValid
=
true
;
VABinauralListener
*
listener
=
listenerIt
.
second
;
listener
->
motionModel
->
HandleMotionKeys
();
isValid
&=
listener
->
motionModel
->
EstimatePosition
(
time
,
listener
->
predPos
);
isValid
&=
listener
->
motionModel
->
EstimateOrientation
(
time
,
listener
->
predView
,
listener
->
predUp
);
listener
->
hasValidTrajectory
=
isValid
;
}
}
}
tests/CoreTest.cpp
View file @
32449d41
...
@@ -73,8 +73,8 @@ int main( int, char** )
...
@@ -73,8 +73,8 @@ int main( int, char** )
{
{
try
try
{
{
//
va = VACore::CreateCoreInstance( "../conf/VACore.ini" );
va
=
VACore
::
CreateCoreInstance
(
"../conf/VACore.ini"
);
va
=
VACore
::
CreateCoreInstance
(
GetCoreConfig
()
);
//
va = VACore::CreateCoreInstance( GetCoreConfig() );
// Attach (register) event handler
// Attach (register) event handler
//va->AttachEventHandler( &dumper );
//va->AttachEventHandler( &dumper );
...
...
Write
Preview
Markdown
is supported
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