PocketSphinx  0.6
s3types.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /* ====================================================================
3  * Copyright (c) 1999-2004 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  * s3types.h -- Types specific to s3 decoder.
39  *
40  * **********************************************
41  * CMU ARPA Speech Project
42  *
43  * Copyright (c) 1999 Carnegie Mellon University.
44  * ALL RIGHTS RESERVED.
45  * **********************************************
46  *
47  * HISTORY
48  * $Log: s3types.h,v $
49  * Revision 1.16 2006/02/22 19:57:57 arthchan2003
50  * Merged from branch SPHINX3_5_2_RCI_IRII_BRANCH: Increase the size of MAX_S3CIPID from 127 to 32767. This will make Chinese Mandarin setup works.
51  *
52  * Revision 1.15.4.1 2005/10/09 19:53:09 arthchan2003
53  * Changed the maximum number of CI PID from 127 to 32767, this will allow us to take care of Chinese syllable, Chinese initial/final and even Cantononese. It might still cause us problem in Turkish.
54  *
55  * Revision 1.15 2005/06/21 20:54:44 arthchan2003
56  * 1, Added $ keyword. 2, make a small change for compilation purpose.
57  *
58  * Revision 1.5 2005/06/16 04:59:09 archan
59  * Sphinx3 to s3.generic, a gentle-refactored version of Dave's change in senone scale.
60  *
61  * Revision 1.4 2005/06/15 21:48:56 archan
62  * Sphinx3 to s3.generic: Changed noinst_HEADERS to pkginclude_HEADERS. This make all the headers to be installed.
63  *
64  * Revision 1.3 2005/03/30 01:22:47 archan
65  * Fixed mistakes in last updates. Add
66  *
67  *
68  * 13-May-1999 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University.
69  * Changed typedef source for s3ssid_t from int32 to s3pid_t.
70  * Changed s3senid_t from int16 to int32 (to conform with composite senid
71  * which is int32).
72  *
73  * 04-May-1999 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University.
74  * Added senone sequence ID (s3ssid_t).
75  *
76  * 12-Jul-95 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University.
77  * Started.
78  */
79 
80 
81 #ifndef _S3_S3TYPES_H_
82 #define _S3_S3TYPES_H_
83 
84 #include <float.h>
85 #include <assert.h>
86 
87 #include <sphinxbase/prim_type.h>
88 #include <sphinxbase/err.h>
89 #include <sphinxbase/ckd_alloc.h>
90 
95 #ifdef __cplusplus
96 extern "C" {
97 #endif
98 #if 0
99 } /* Fool Emacs into not indenting things. */
100 #endif
101 
109 typedef int16 s3cipid_t;
110 #define BAD_S3CIPID ((s3cipid_t) -1)
111 #define NOT_S3CIPID(p) ((p)<0)
112 #define IS_S3CIPID(p) ((p)>=0)
113 #define MAX_S3CIPID 32767
114 
115 /*#define MAX_S3CIPID 127*/
116 
117 typedef int32 s3pid_t;
118 #define BAD_S3PID ((s3pid_t) -1)
119 #define NOT_S3PID(p) ((p)<0)
120 #define IS_S3PID(p) ((p)>=0)
121 #define MAX_S3PID ((int32)0x7ffffffe)
122 
123 typedef uint16 s3ssid_t;
124 #define BAD_S3SSID ((s3ssid_t) 0xffff)
125 #define NOT_S3SSID(p) ((p) == BAD_S3SSID)
126 #define IS_S3SSID(p) ((p) != BAD_S3SSID)
127 #define MAX_S3SSID ((s3ssid_t)0xfffe)
128 
129 typedef int32 s3tmatid_t;
130 #define BAD_S3TMATID ((s3tmatid_t) -1)
131 #define NOT_S3TMATID(t) ((t)<0)
132 #define IS_S3TMATID(t) ((t)>=0)
133 #define MAX_S3TMATID ((int32)0x7ffffffe)
134 
135 typedef int32 s3wid_t;
136 #define BAD_S3WID ((s3wid_t) -1)
137 #define NOT_S3WID(w) ((w)<0)
138 #define IS_S3WID(w) ((w)>=0)
139 #define MAX_S3WID ((int32)0x7ffffffe)
140 
141 typedef uint16 s3lmwid_t;
142 #define BAD_S3LMWID ((s3lmwid_t) 0xffff)
143 #define NOT_S3LMWID(w) ((w)==BAD_S3LMWID)
144 #define IS_S3LMWID(w) ((w)!=BAD_S3LMWID)
145 #define MAX_S3LMWID ((uint32)0xfffe)
146 #define BAD_LMCLASSID (-1)
147 
148 typedef uint32 s3lmwid32_t;
149 #define BAD_S3LMWID32 ((s3lmwid32_t) 0x0fffffff)
150 #define NOT_S3LMWID32(w) ((w)==BAD_S3LMWID32)
151 #define IS_S3LMWID32(w) ((w)!=BAD_S3LMWID32)
152 #define MAX_S3LMWID32 ((uint32)0xfffffffe)
153 
154 /* Generic macro that is applicable to both uint16 and uint32
155  Careful with efficiency issue.
156 
157  Also, please don't use BAD_S3LATID(l);
158 */
159 
160 #define BAD_LMWID(lm) (lm->is32bits? BAD_S3LMWID32 : BAD_S3LMWID)
161 #define NOT_LMWID(lm,w) (lm->is32bits? NOT_S3LMWID32(w): NOT_S3LMWID(w))
162 #define IS_LMWID(lm,w) (lm->is32bits? IS_S3LMWID32(w): IS_S3LMWID(w))
163 #define MAX_LMWID(lm) (lm->is32bits? MAX_S3LMWID32: MAX_S3LMWID)
164 
165 typedef int32 s3latid_t;
166 #define BAD_S3LATID ((s3latid_t) -1)
167 #define NOT_S3LATID(l) ((l)<0)
168 #define IS_S3LATID(l) ((l)>=0)
169 #define MAX_S3LATID ((int32)0x7ffffffe)
170 
171 typedef int16 s3frmid_t;
172 #define BAD_S3FRMID ((s3frmid_t) -1)
173 #define NOT_S3FRMID(f) ((f)<0)
174 #define IS_S3FRMID(f) ((f)>=0)
175 #define MAX_S3FRMID ((int32)0x7ffe)
176 
177 typedef uint16 s3senid_t;
178 #define BAD_S3SENID ((s3senid_t) 0xffff)
179 #define NOT_S3SENID(s) ((s) == BAD_S3SENID)
180 #define IS_S3SENID(s) ((s) != BAD_S3SENID)
181 #define MAX_S3SENID ((int16)0x7ffe)
182 
183 typedef int16 s3mgauid_t;
184 #define BAD_S3MGAUID ((s3mgauid_t) -1)
185 #define NOT_S3MGAUID(m) ((m)<0)
186 #define IS_S3MGAUID(m) ((m)>=0)
187 #define MAX_S3MGAUID ((int32)0x00007ffe)
188 
189 
190 #define S3_LOGPROB_ZERO ((int32) 0xc8000000)
191 #define S3_LOGPROB_ZERO_F ((float32) -1e30)
193 #define RENORM_THRESH ((int32) ((S3_LOGPROB_ZERO)>>1))
195 #define S3_SUCCESS 0
196 #define S3_ERROR -1
197 #define S3_WARNING -2
198 
200 #define MAX_N_STATE 20
201 
204 #define MAX_N_ATTRIB 5
205 
206 #ifndef TRUE
207 #define TRUE 1
208 #define FALSE 0 /* assume that true is never defined w/o false */
209 #endif
210 
211 /* Timer for elapsed I/O time */
212 #define IO_ELAPSED 0
213 
214 /* Timer for utt processing elapsed time */
215 #define UTT_ELAPSED 1
216 #define UTT_IO_ELAPSED 2
217 #define UTT_BW_ELAPSED 3
218 
219 #define TYING_NON_EMITTING (0xffffffff)
220 #define TYING_NO_ID (0xffffffff)
221 
222 #define MAX_VERSION_LEN 128
223 
224 #define MEG *1024*1024
225 
226 #if 0
227 { /* Stop indent from complaining */
228 #endif
229 #ifdef __cplusplus
230 }
231 #endif
232 
233 #endif
int16 s3cipid_t
Size definitions for more semantially meaningful units.
Definition: s3types.h:109