PocketSphinx  5prealpha
ms_mgau.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  * ms_mgau.h -- Essentially a wrapper that wrap up gauden and
39  * senone. It supports multi-stream.
40  *
41  *
42  * **********************************************
43  * CMU ARPA Speech Project
44  *
45  * Copyright (c) 1997 Carnegie Mellon University.
46  * ALL RIGHTS RESERVED.
47  * **********************************************
48  * HISTORY
49  * $Log$
50  * Revision 1.1 2006/04/05 20:27:30 dhdfu
51  * A Great Reorganzation of header files and executables
52  *
53  * Revision 1.3 2006/02/22 16:57:15 arthchan2003
54  * Fixed minor dox-doc issue
55  *
56  * Revision 1.2 2006/02/22 16:56:01 arthchan2003
57  * Merged from SPHINX3_5_2_RCI_IRII_BRANCH: Added ms_mgau.[ch] into the trunk. It is a wrapper of ms_gauden and ms_senone
58  *
59  * Revision 1.1.2.4 2005/09/25 18:55:19 arthchan2003
60  * Added a flag to turn on and off precomputation.
61  *
62  * Revision 1.1.2.3 2005/08/03 18:53:44 dhdfu
63  * Add memory deallocation functions. Also move all the initialization
64  * of ms_mgau_model_t into ms_mgau_init (duh!), which entails removing it
65  * from decode_anytopo and friends.
66  *
67  * Revision 1.1.2.2 2005/08/02 21:05:38 arthchan2003
68  * 1, Added dist and mgau_active as intermediate variable for computation. 2, Added ms_cont_mgau_frame_eval, which is a multi stream version of GMM computation mainly s3.0 family of tools. 3, Fixed dox-doc.
69  *
70  * Revision 1.1.2.1 2005/07/20 19:37:09 arthchan2003
71  * Added a multi-stream cont_mgau (ms_mgau) which is a wrapper of both gauden and senone. Add ms_mgau_init and model_set_mllr. This allow eliminating 600 lines of code in decode_anytopo/align/allphone.
72  *
73  *
74  *
75  */
76 
96 #ifndef _LIBFBS_MS_CONT_MGAU_H_
97 #define _LIBFBS_MS_CONT_MGAU_H_
98 
99 /* SphinxBase headers. */
100 #include <sphinxbase/cmd_ln.h>
101 #include <sphinxbase/logmath.h>
102 #include <sphinxbase/feat.h>
103 
104 /* Local headers. */
105 #include "acmod.h"
106 #include "bin_mdef.h"
107 #include "ms_gauden.h"
108 #include "ms_senone.h"
109 
114 typedef struct {
115  ps_mgau_t base;
118  int topn;
121  gauden_dist_t ***dist;
122  uint8 *mgau_active;
123  cmd_ln_t *config;
124 } ms_mgau_model_t;
125 
126 #define ms_mgau_gauden(msg) (msg->g)
127 #define ms_mgau_senone(msg) (msg->s)
128 #define ms_mgau_topn(msg) (msg->topn)
129 
130 ps_mgau_t* ms_mgau_init(acmod_t *acmod, logmath_t *lmath, bin_mdef_t *mdef);
131 void ms_mgau_free(ps_mgau_t *g);
132 int32 ms_cont_mgau_frame_eval(ps_mgau_t * msg,
133  int16 *senscr,
134  uint8 *senone_active,
135  int32 n_senone_active,
136  mfcc_t ** feat,
137  int32 frame,
138  int32 compallsen);
139 int32 ms_mgau_mllr_transform(ps_mgau_t *s,
140  ps_mllr_t *mllr);
141 
142 #endif /* _LIBFBS_MS_CONT_MGAU_H_*/
143 
(Sphinx 3.0 specific) multiple streams senones.
Structure to store distance (density) values for a given input observation wrt density values in some...
Definition: ms_gauden.h:71
Binary format model definition files, with support for heterogeneous topologies and variable-size N-p...
gauden_t * g
The codebook.
Definition: ms_mgau.h:116
8-bit senone PDF structure.
Definition: ms_senone.h:76
int topn
Top-n gaussian will be computed.
Definition: ms_mgau.h:118
(Sphinx 3.0 specific) Gaussian density module.
Feature space linear transform structure.
Definition: acmod.h:82
Multivariate gaussian mixture density parameters.
Definition: ms_gauden.h:82
Acoustic model structures for PocketSphinx.
Acoustic model structure.
Definition: acmod.h:148
senone_t * s
The senone.
Definition: ms_mgau.h:117