#include <sent/stddefs.h>
#include <sent/speech.h>
#include <sent/htk_hmm.h>
#include <sent/htk_param.h>
#include <sent/hmm.h>
#include <sent/gprune.h>
#include "globalvars.h"
Include dependency graph for outprob.c:
Go to the source code of this file.
Defines | |
#define | LOG_UNDEF (LOG_ZERO - 1) |
Value to be used as the initial cache value. | |
Functions | |
boolean | outprob_cache_init () |
boolean | outprob_cache_prepare () |
static void | outprob_cache_extend (int reqframe) |
void | outprob_cache_free () |
LOGPROB | outprob_state (int t, HTK_HMM_State *stateinfo, HTK_Param *param) |
Compute output probability of a state. | |
void | outprob_cd_nbest_init (int num) |
void | outprob_cd_nbest_free () |
static LOGPROB | outprob_cd_nbest (int t, CD_State_Set *lset, HTK_Param *param) |
static LOGPROB | outprob_cd_max (int t, CD_State_Set *lset, HTK_Param *param) |
static LOGPROB | outprob_cd_avg (int t, CD_State_Set *lset, HTK_Param *param) |
LOGPROB | outprob_cd (int t, CD_State_Set *lset, HTK_Param *param) |
LOGPROB | outprob (int t, HMM_STATE *hmmstate, HTK_Param *param) |
Variables | |
static int | statenum |
Local work area that holds total number of HMM states in the HMM definition data. | |
static LOGPROB ** | outprob_cache = NULL |
State-level cache [t][stateid]. | |
static int | allocframenum |
Allocated frames of the cache. | |
static int | allocblock |
Allocation block size per allocateion of the cache. | |
static BMALLOC_BASE * | croot |
Root alloc pointer to state outprob cache. | |
static LOGPROB * | last_cache |
Local work are to hold cache list of current time. | |
static LOGPROB * | maxprobs |
Work area that holds N-best state scores for pseudo state set. | |
static int | maxn |
Allocated length of above. |
The state scores will be cached here. The 2-dimension cache array of state and input frame are used to store the computed scores. They will be expanded when needed. Thus the scores will be cached for all input frame because they will also be used in the 2nd pass of recognition process.
When using a tied-mixture model, codebook-level cache will be also done in addition to this state-level cache. See calc_tied_mix.c for details.
Definition in file outprob.c.
boolean outprob_cache_init | ( | ) |
Initialize the cache data, should be called once on startup.
Definition at line 82 of file outprob.c.
Referenced by outprob_init().
boolean outprob_cache_prepare | ( | ) |
Prepare cache for the next input, by clearing the existing cache.
Definition at line 100 of file outprob.c.
Referenced by outprob_prepare().
static void outprob_cache_extend | ( | int | reqframe | ) | [static] |
Expand the cache to time axis if needed.
reqframe | [in] required frame length |
Definition at line 120 of file outprob.c.
Referenced by outprob_state().
void outprob_cache_free | ( | ) |
LOGPROB outprob_state | ( | int | t, | |
HTK_HMM_State * | stateinfo, | |||
HTK_Param * | param | |||
) |
Compute output probability of a state.
Set the needed values to the global variables that begins with "OP_", and call calc_outprob_state(). The calc_outprob_state() is actually a function pointer, and the entity is either calc_tied_mix() for tied-mixture model and calc_mix() for others. (If you use GMS, the entity will be gms_state() instead.)
The state-level cache is also consulted here.
Definition at line 180 of file outprob.c.
Referenced by outprob(), outprob_cd_avg(), outprob_cd_max(), outprob_cd_nbest(), outprob_style(), and start_word().
void outprob_cd_nbest_init | ( | int | num | ) |
Initialize work area for outprob_cd_nbest().
num | [in] number of top states to be calculated. |
Definition at line 217 of file outprob.c.
Referenced by outprob_init().
void outprob_cd_nbest_free | ( | ) |
Free work area for outprob_cd_nbest().
Definition at line 228 of file outprob.c.
Referenced by outprob_free().
static LOGPROB outprob_cd_nbest | ( | int | t, | |
CD_State_Set * | lset, | |||
HTK_Param * | param | |||
) | [static] |
Return average of N-beat outprob for pseudo state set.
t | [in] input frame | |
lset | [in] pseudo state set | |
param | [in] input parameter data |
Definition at line 243 of file outprob.c.
Referenced by outprob_cd().
static LOGPROB outprob_cd_max | ( | int | t, | |
CD_State_Set * | lset, | |||
HTK_Param * | param | |||
) | [static] |
Return maximum outprob of the pseudo state set.
t | [in] input frame | |
lset | [in] pseudo state set | |
param | [in] input parameter data |
Definition at line 287 of file outprob.c.
Referenced by outprob_cd().
static LOGPROB outprob_cd_avg | ( | int | t, | |
CD_State_Set * | lset, | |||
HTK_Param * | param | |||
) | [static] |
Return average outprob of the pseudo state set.
t | [in] input frame | |
lset | [in] pseudo state set | |
param | [in] input parameter data |
Definition at line 309 of file outprob.c.
Referenced by outprob_cd().
LOGPROB outprob_cd | ( | int | t, | |
CD_State_Set * | lset, | |||
HTK_Param * | param | |||
) |
Compute the log output probability of a pseudo state set.
t | [in] input frame | |
lset | [in] pseudo state set | |
param | [in] input parameter data |
Definition at line 335 of file outprob.c.
Referenced by outprob(), outprob_style(), and start_word().
Top function to compute the output probability of a HMM state.
t | [in] input frame | |
hmmstate | [in] HMM state | |
param | [in] input parameter data |
Definition at line 369 of file outprob.c.
Referenced by scan_word(), and viterbi_segment().