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 * stat.h -- statistics of the searching process, including timers and counters. 00039 * 00040 * ********************************************** 00041 * CMU ARPA Speech Project 00042 * 00043 * Copyright (c) 1999 Carnegie Mellon University. 00044 * ALL RIGHTS RESERVED. 00045 * ********************************************** 00046 * 00047 * HISTORY 00048 * $Log$ 00049 * Revision 1.1 2006/04/05 20:27:30 dhdfu 00050 * A Great Reorganzation of header files and executables 00051 * 00052 * Revision 1.2 2006/02/22 20:01:06 arthchan2003 00053 * Merged from branch SPHINX3_5_2_RCI_IRII_BRANCH: 1, Take care of the situation when the hmm_eval =0 (but ugly). 2, Add a free function for stat_t. 00054 * 00055 * Revision 1.1.4.2 2005/07/05 06:25:40 arthchan2003 00056 * Fixed dox-doc. 00057 * 00058 * Revision 1.1.4.1 2005/07/03 22:56:51 arthchan2003 00059 * Add stat_free. 00060 * 00061 * Revision 1.1 2005/06/21 20:58:09 arthchan2003 00062 * Add a statistics inventory structure, it takes care of 1, counters, 2, timers. Interfaces are provided to allow convenient clearing and updating of structures 00063 * 00064 * Revision 1.6 2005/04/25 19:22:47 archan 00065 * Refactor out the code of rescoring from lexical tree. Potentially we want to turn off the rescoring if we need. 00066 * 00067 * Revision 1.5 2005/04/20 03:44:10 archan 00068 * Create functions for clear/update/report statistics. It wraps up code which was slightly spaghatti-like in the past 00069 * 00070 * Revision 1.4 2005/03/30 01:22:47 archan 00071 * Fixed mistakes in last updates. Add 00072 * 00073 * 00074 * 24-Mar-2004 Arthur Chan (archan@cs.cmu.edu) at Carnegie Mellon University 00075 * start 00076 */ 00077 00078 00079 #ifndef _S3_STAT_ 00080 #define _S3_STAT_ 00081 00082 #include <profile.h> 00083 #include <s3types.h> 00084 #include "sphinx3_export.h" 00085 00090 #ifdef __cplusplus 00091 extern "C" { 00092 #endif 00093 #if 0 00094 } /* Fool Emacs into not indenting things. */ 00095 #endif 00096 00101 typedef struct { 00102 /* All structure that measure the time and stuffs we computed */ 00103 ptmr_t tm_sen; 00104 ptmr_t tm_srch; 00105 ptmr_t tm_ovrhd; 00106 ptmr_t tm; 00108 int32 utt_hmm_eval; 00109 int32 utt_sen_eval; 00110 int32 utt_gau_eval; 00111 int32 utt_cisen_eval; 00112 int32 utt_cigau_eval; 00113 int32 utt_wd_exit; 00115 int32 nfr; 00117 float64 tot_sen_eval; 00118 float64 tot_gau_eval; 00119 float64 tot_ci_sen_eval; 00120 float64 tot_ci_gau_eval; 00121 float64 tot_hmm_eval; 00122 float64 tot_wd_exit; 00125 int32 tot_fr; 00129 } stat_t ; 00130 00134 stat_t* stat_init(void); 00135 00138 void stat_free(stat_t* st 00139 ); 00140 00142 void stat_clear_utt( 00143 stat_t* st 00144 ); 00145 00147 void stat_clear_corpus( 00148 stat_t* st 00149 ); 00150 00152 void stat_update_corpus( 00153 stat_t* st 00154 ); 00155 00157 void stat_report_utt( 00158 stat_t* st, 00159 char * uttid 00160 ); 00161 00163 S3DECODER_EXPORT 00164 void stat_report_corpus( 00165 stat_t * st 00166 ); 00167 00168 00169 #if 0 00170 { /* Stop indent from complaining */ 00171 #endif 00172 #ifdef __cplusplus 00173 } 00174 #endif 00175 00176 #endif 00177