aboutsummaryrefslogtreecommitdiffstats
path: root/utils/makemhr/loaddef.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-03-24 19:00:58 -0700
committerChris Robinson <[email protected]>2019-03-24 19:00:58 -0700
commitf392d9c138b733e44988eadf8f5d8fc5218f8d01 (patch)
tree24bc9dc86ba4fc3f09d705f0139f5a7933ee3932 /utils/makemhr/loaddef.h
parent5e6e738681f0d3833143c3d539b1adcdc8a14c31 (diff)
Move makemhr's .def loading code to a separate source
Diffstat (limited to 'utils/makemhr/loaddef.h')
-rw-r--r--utils/makemhr/loaddef.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/utils/makemhr/loaddef.h b/utils/makemhr/loaddef.h
index e69de29b..5e8c5313 100644
--- a/utils/makemhr/loaddef.h
+++ b/utils/makemhr/loaddef.h
@@ -0,0 +1,30 @@
+#ifndef LOADDEF_H
+#define LOADDEF_H
+
+#include <stdio.h>
+
+#include "makemhr.h"
+
+
+// Constants for accessing the token reader's ring buffer.
+#define TR_RING_BITS (16)
+#define TR_RING_SIZE (1 << TR_RING_BITS)
+#define TR_RING_MASK (TR_RING_SIZE - 1)
+
+
+// Token reader state for parsing the data set definition.
+struct TokenReaderT {
+ FILE *mFile;
+ const char *mName;
+ uint mLine;
+ uint mColumn;
+ char mRing[TR_RING_SIZE];
+ size_t mIn;
+ size_t mOut;
+};
+
+void TrSetup(FILE *fp, const char *filename, TokenReaderT *tr);
+int ProcessMetrics(TokenReaderT *tr, const uint fftSize, const uint truncSize, HrirDataT *hData);
+int ProcessSources(const HeadModelT model, TokenReaderT *tr, HrirDataT *hData);
+
+#endif /* LOADDEF_H */