00001 /* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */ 00002 /* ==================================================================== 00003 * Copyright (c) 2009 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 00043 #ifndef __TST_SEARCH_H__ 00044 #define __TST_SEARCH_H__ 00045 00046 /* SphinxBase headers. */ 00047 #include <cmd_ln.h> 00048 #include <logmath.h> 00049 #include <ngram_model.h> 00050 #include <listelem_alloc.h> 00051 #include <err.h> 00052 00053 /* Local headers. */ 00054 #include "pocketsphinx_internal.h" 00055 #include "lextree.h" 00056 #include "vithist.h" 00057 #include "hmm.h" 00058 00065 typedef struct { 00066 int32 maxwpf; 00067 int32 maxhistpf; 00068 int32 maxhmmpf; 00069 int32 hmm_hist_binsize; 00070 int32 hmm_hist_bins; 00071 int32 *hmm_hist; 00072 } histprune_t; 00073 00089 typedef struct { 00090 int32 hmm; 00091 int32 ptrans; 00092 int32 word; 00093 int32 ptranskip; 00094 int32 wordend; 00095 int32 n_ciphone; 00097 int32 bestscore; 00098 int32 bestwordscore; 00099 int32 thres; 00100 int32 phone_thres; 00101 int32 word_thres; 00103 int32 *wordbestscores; 00104 int32 *wordbestexits; 00106 } beam_t; 00107 00111 typedef struct tst_stats_s { 00112 int32 n_hmm_eval; 00113 int32 n_senone_active_utt; 00114 } tst_stats_t; 00115 00119 struct tst_search_s { 00120 ps_search_t base; 00121 ngram_model_t *lmset; 00122 fillpen_t *fillpen; 00130 int32 n_lextree; 00131 lextree_t **curugtree; 00133 hash_table_t *ugtree; 00134 lextree_t **fillertree; 00135 int32 n_lextrans; 00136 int32 epl; 00138 int32 isLMLA; 00140 histprune_t *histprune; 00141 beam_t *beam; 00142 vithist_t *vithist; 00144 bitvec_t *ssid_active; 00145 bitvec_t *comssid_active; 00146 int16 *composite_senone_scores; 00148 FILE *hmmdumpfp; 00150 int n_frame; 00152 int exit_id; 00153 tst_stats_t st; 00154 }; 00155 typedef struct tst_search_s tst_search_t; 00156 00160 ps_search_t *tst_search_init(cmd_ln_t *config, 00161 acmod_t *acmod, 00162 s3dict_t *dict, 00163 dict2pid_t *d2p); 00164 00168 void tst_search_free(ps_search_t *search); 00169 00170 00171 #endif /* __TST_SEARCH_H__ */
1.6.1