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 * logs3.h -- log(base-S3) module. 00039 * 00040 * ********************************************** 00041 * CMU ARPA Speech Project 00042 * 00043 * Copyright (c) 1997 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.11 2006/03/03 19:45:01 egouvea 00053 * Clean up the log handling. In logs3.c, removed unnecessary variables 00054 * (e.g. "f", exactly the same as "F") and functions (e.g. "logs3_10base()"). 00055 * 00056 * In confidence.c, replace (logs3_to_log10(r_lscr) * logs3_10base()) 00057 * with r_lscr, since the only difference is that one is a double, the 00058 * other an int (and as such, they differ on the order of 1e-12). 00059 * 00060 * In future cleanups.... replace the "int" declaration with "int32", 00061 * used in the rest of the code. 00062 * 00063 * Revision 1.10 2006/02/22 20:31:53 arthchan2003 00064 * Add clarification comment on logs3.h 00065 * 00066 * Revision 1.9.4.1 2006/01/16 19:51:19 arthchan2003 00067 * Added a function to convert Sphinx 3 log to log 10. 00068 * 00069 * Revision 1.9 2005/06/21 20:46:54 arthchan2003 00070 * 1, Added a report flag in logs3_init, 2, Fixed doxygen documentation, 3, Add the $ keyword. 00071 * 00072 * Revision 1.6 2005/06/13 04:02:57 archan 00073 * Fixed most doxygen-style documentation under libs3decoder. 00074 * 00075 * Revision 1.5 2005/05/27 01:15:44 archan 00076 * 1, Changing the function prototypes of logs3_init to have another argument which specify whether an add table should be used. Corresponding changes have made in all executables and test programs. 2, Synchronzie how align, allphone, decode_anytopo, dag sets the default value of logbase. 00077 * 00078 * Revision 1.4 2005/04/21 23:50:26 archan 00079 * Some more refactoring on the how reporting of structures inside kbcore_t is done, it is now 50% nice. Also added class-based LM test case into test-decode.sh.in. At this moment, everything in search mode 5 is already done. It is time to test the idea whether the search can really be used. 00080 * 00081 * Revision 1.3 2005/03/30 01:22:47 archan 00082 * Fixed mistakes in last updates. Add 00083 * 00084 * 00085 * 28-Apr-1999 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University. 00086 * Added log_to_logs3_factor(), and logs3_to_p(). 00087 * 00088 * 05-Nov-95 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University. 00089 * Created. 00090 */ 00091 00092 00093 #ifndef _S3_LOGS3_H_ 00094 #define _S3_LOGS3_H_ 00095 00096 #include <s3types.h> 00097 #include <logmath.h> 00098 00110 #ifdef __cplusplus 00111 extern "C" { 00112 #endif 00113 #if 0 00114 } /* Fool Emacs into not indenting things. */ 00115 #endif 00116 00117 00118 #define LOGS3_SUCCESS 1 00119 #define LOGS3_FAILURE 0 00120 00122 S3DECODER_EXPORT 00123 logmath_t* logs3_init (float64 base, 00124 int32 bReport, 00125 int32 bLogTable 00126 ); 00127 00129 S3DECODER_EXPORT 00130 int32 logs3 (logmath_t* logmath, 00131 float64 p 00132 ); 00133 00135 void logs3_report(logmath_t* logmath); 00136 00137 #if 0 00138 { /* Stop indent from complaining */ 00139 #endif 00140 #ifdef __cplusplus 00141 } 00142 #endif 00143 00144 00145 #endif