PocketSphinx  5prealpha
tied_mgau_common.h File Reference

Common code shared between SC and PTM (tied-state) models. More...

#include <sphinxbase/logmath.h>
#include <sphinxbase/fixpoint.h>

Go to the source code of this file.

Macros

#define MGAU_MIXW_VERSION   "1.0" /* Sphinx-3 file format version for mixw */
 
#define MGAU_PARAM_VERSION   "1.0" /* Sphinx-3 file format version for mean/var */
 
#define NONE   -1
 
#define WORST_DIST   (int32)(0x80000000)
 
#define GMMSUB(a, b)   ((a)-(b))
 Subtract GMM component b (assumed to be positive) and saturate.
 
#define GMMADD(a, b)   ((a)+(b))
 
#define MIN(a, b)   ((a) < (b) ? (a) : (b))
 
#define LOGMATH_INLINE   static
 
#define MAX_NEG_MIXW   159
 Maximum negated mixture weight value. More...
 
#define MAX_NEG_ASCR   96
 Maximum negated acoustic score value. More...
 

Functions

LOGMATH_INLINE int fast_logmath_add (logmath_t *lmath, int mlx, int mly)
 Quickly log-add two negated log probabilities. More...
 

Detailed Description

Common code shared between SC and PTM (tied-state) models.

Definition in file tied_mgau_common.h.

Macro Definition Documentation

#define MAX_NEG_ASCR   96

Maximum negated acoustic score value.

Definition at line 83 of file tied_mgau_common.h.

#define MAX_NEG_MIXW   159

Maximum negated mixture weight value.

Definition at line 82 of file tied_mgau_common.h.

Function Documentation

LOGMATH_INLINE int fast_logmath_add ( logmath_t *  lmath,
int  mlx,
int  mly 
)

Quickly log-add two negated log probabilities.

Parameters
lmathThe log-math object
mlxA negative log probability (0 < mlx < 255)
mlyA negative log probability (0 < mly < 255)
Returns
-log(exp(-mlx)+exp(-mly))

We can do some extra-fast log addition since we know that mixw+ascr is always less than 256 and hence x-y is also always less than 256. This relies on some cooperation from logmath_t which will never produce a logmath table smaller than 256 entries.

Note that the parameters are negated log probabilities (and hence, are positive numbers), as is the return value. This is the key to the "fastness" of this function.

Definition at line 103 of file tied_mgau_common.h.