PocketSphinx  0.6
src/libpocketsphinx/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.

Defines

#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 LOGMATH_INLINE   static
#define MAX_NEG_MIXW   159
 Maximum negated mixture weight value.
#define MAX_NEG_ASCR   96
 Maximum negated acoustic score value.

Functions

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

Detailed Description

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

Definition in file tied_mgau_common.h.


Define Documentation

#define MAX_NEG_ASCR   96

Maximum negated acoustic score value.

Definition at line 85 of file tied_mgau_common.h.

#define MAX_NEG_MIXW   159

Maximum negated mixture weight value.

Definition at line 84 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 105 of file tied_mgau_common.h.