gs.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /* ====================================================================
3  * Copyright (c) 1995-2002 Carnegie Mellon University. All rights
4  * reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in
15  * the documentation and/or other materials provided with the
16  * distribution.
17  *
18  * This work was supported in part by funding from the Defense Advanced
19  * Research Projects Agency and the National Science Foundation of the
20  * United States of America, and the CMU Sphinx Speech Consortium.
21  *
22  * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND
23  * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
24  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
26  * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  *
34  * ====================================================================
35  *
36  */
37 /*
38  * gs.h -- gaussian density module.
39  *
40  * **********************************************
41  * CMU ARPA Speech Project
42  *
43  * Copyright (c) 1996 Carnegie Mellon University.
44  * ALL RIGHTS RESERVED.
45  * **********************************************
46  *
47  * HISTORY
48  * $Log$
49  * Revision 1.1 2006/04/05 20:27:30 dhdfu
50  * A Great Reorganzation of header files and executables
51  *
52  * Revision 1.7 2006/02/22 16:41:58 arthchan2003
53  * Merged from SPHINX3_5_2_RCI_IRII_BRANCH: 1, Fixed issue in $ keyword, 2, Fixed dox-doc
54  *
55  * Revision 1.6.4.1 2005/07/05 05:47:59 arthchan2003
56  * Fixed dox-doc. struct level of documentation are included.
57  *
58  * Revision 1.6 2005/06/21 18:28:05 arthchan2003
59  * Log. 1, Fixed doxygen documentation. 2, Add $Log$
60  * Revision 1.1 2006/04/05 20:27:30 dhdfu
61  * A Great Reorganzation of header files and executables
62  *
63  * Log. 1, Fixed doxygen documentation. 2, Add Revision 1.7 2006/02/22 16:41:58 arthchan2003
64  * Log. 1, Fixed doxygen documentation. 2, Add Merged from SPHINX3_5_2_RCI_IRII_BRANCH: 1, Fixed issue in $ keyword, 2, Fixed dox-doc
65  * Log. 1, Fixed doxygen documentation. 2, Add
66  * Log. 1, Fixed doxygen documentation. 2, Add Revision 1.6.4.1 2005/07/05 05:47:59 arthchan2003
67  * Log. 1, Fixed doxygen documentation. 2, Add Fixed dox-doc. struct level of documentation are included.
68  * Log. 1, Fixed doxygen documentation. 2, Add keyword.
69  *
70  * Revision 1.4 2005/06/13 04:02:55 archan
71  * Fixed most doxygen-style documentation under libs3decoder.
72  *
73  * Revision 1.3 2005/03/30 01:22:46 archan
74  * Fixed mistakes in last updates. Add
75  *
76  *
77  * 29-Dec-03 A. Chan (archan@cs.cmu.edu) at Carnegie Mellon University.
78  * Initial version created
79  */
80 
81 #ifndef _LIB_GS_H_
82 #define _LIB_GS_H_
83 
84 #include <stdio.h>
85 
86 #include <s3types.h>
87 #include <logmath.h>
88 
111 #ifdef __cplusplus
112 extern "C" {
113 #endif
114 #if 0
115 } /* Fool Emacs into not indenting things. */
116 #endif
117 
122 typedef struct gs_s {
123  logmath_t *logmath;
124  int32 n_mgau;
125  int32 n_feat;
126  int32 n_code;
127  int32 n_density;
128  int32 n_featlen;
129  int32 n_mbyte;
130  float32 **codeword;
131  uint32 ***codemap;
132  FILE *fp;
133  int32* mgau_sl;
134 } gs_t;
135 
136 
139 int32 gs_display(char *file,
140  gs_t *gs
141  );
142 
144 gs_t* gs_read(const char *file,
145  logmath_t *logmath
146  );
147 
149 int32 gc_compute_closest_cw ( gs_t *gs,
150  float32 *feat
151  );
152 
154 int32 gs_mgau_shortlist(gs_t *gs,
155  int32 m,
156  int32 n,
157  float32 *feat,
158  int32 bst_codeid
159  );
160 
161 #if 0
162 { /* Stop indent from complaining */
163 #endif
164 #ifdef __cplusplus
165 }
166 #endif
167 
168 #endif