PocketSphinx  0.6
src/libpocketsphinx/ms_mgau.h
Go to the documentation of this file.
00001 /* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */
00002 /* ====================================================================
00003  * Copyright (c) 1999-2004 Carnegie Mellon University.  All rights
00004  * reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions
00008  * are met:
00009  *
00010  * 1. Redistributions of source code must retain the above copyright
00011  *    notice, this list of conditions and the following disclaimer. 
00012  *
00013  * 2. Redistributions in binary form must reproduce the above copyright
00014  *    notice, this list of conditions and the following disclaimer in
00015  *    the documentation and/or other materials provided with the
00016  *    distribution.
00017  *
00018  * This work was supported in part by funding from the Defense Advanced 
00019  * Research Projects Agency and the National Science Foundation of the 
00020  * United States of America, and the CMU Sphinx Speech Consortium.
00021  *
00022  * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND 
00023  * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
00024  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00025  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
00026  * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00027  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
00028  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
00029  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
00030  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
00031  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
00032  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033  *
00034  * ====================================================================
00035  *
00036  */
00037 /*
00038  * ms_mgau.h -- Essentially a wrapper that wrap up gauden and
00039  * senone. It supports multi-stream. 
00040  *
00041  *
00042  * **********************************************
00043  * CMU ARPA Speech Project
00044  *
00045  * Copyright (c) 1997 Carnegie Mellon University.
00046  * ALL RIGHTS RESERVED.
00047  * **********************************************
00048  * HISTORY
00049  * $Log$
00050  * Revision 1.1  2006/04/05  20:27:30  dhdfu
00051  * A Great Reorganzation of header files and executables
00052  * 
00053  * Revision 1.3  2006/02/22 16:57:15  arthchan2003
00054  * Fixed minor dox-doc issue
00055  *
00056  * Revision 1.2  2006/02/22 16:56:01  arthchan2003
00057  * 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
00058  *
00059  * Revision 1.1.2.4  2005/09/25 18:55:19  arthchan2003
00060  * Added a flag to turn on and off precomputation.
00061  *
00062  * Revision 1.1.2.3  2005/08/03 18:53:44  dhdfu
00063  * Add memory deallocation functions.  Also move all the initialization
00064  * of ms_mgau_model_t into ms_mgau_init (duh!), which entails removing it
00065  * from decode_anytopo and friends.
00066  *
00067  * Revision 1.1.2.2  2005/08/02 21:05:38  arthchan2003
00068  * 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.
00069  *
00070  * Revision 1.1.2.1  2005/07/20 19:37:09  arthchan2003
00071  * 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.
00072  *
00073  *
00074  *
00075  */
00076 
00096 #ifndef _LIBFBS_MS_CONT_MGAU_H_
00097 #define _LIBFBS_MS_CONT_MGAU_H_
00098 
00099 /* SphinxBase headers. */
00100 #include <sphinxbase/cmd_ln.h>
00101 #include <sphinxbase/logmath.h>
00102 #include <sphinxbase/feat.h>
00103 
00104 /* Local headers. */
00105 #include "acmod.h"
00106 #include "bin_mdef.h"
00107 #include "ms_gauden.h"
00108 #include "ms_senone.h"
00109 
00114 typedef struct {
00115     ps_mgau_t base;
00116     gauden_t* g;   
00117     senone_t* s;   
00118     int topn;      
00121     gauden_dist_t ***dist;  
00122     uint8 *mgau_active;
00123     cmd_ln_t *config;
00124 } ms_mgau_model_t;  
00125 
00126 #define ms_mgau_gauden(msg) (msg->g)
00127 #define ms_mgau_senone(msg) (msg->s)
00128 #define ms_mgau_topn(msg) (msg->topn)
00129 
00130 ps_mgau_t* ms_mgau_init(cmd_ln_t *config, logmath_t *lmath, bin_mdef_t *mdef);
00131 void ms_mgau_free(ps_mgau_t *g);
00132 int32 ms_cont_mgau_frame_eval(ps_mgau_t * msg,
00133                               int16 *senscr,
00134                               uint8 *senone_active,
00135                               int32 n_senone_active,
00136                               mfcc_t ** feat,
00137                               int32 frame,
00138                               int32 compallsen);
00139 int32 ms_mgau_mllr_transform(ps_mgau_t *s,
00140                              ps_mllr_t *mllr);
00141 
00142 #endif /* _LIBFBS_MS_CONT_MGAU_H_*/
00143