classifier.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 
3 #ifndef __SPHINX3_CLASSIFIER_H
4 #define __SPHINX3_CLASSIFIER_H
5 
6 #include "s3types.h"
7 #include "cont_mgau.h"
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 #if 0
13 } /* Fool Emacs into not indenting things. */
14 #endif
15 
16 #define CEP_LEN 13
17 #define VOTING_LEN 5
18 #define CLASS_LATENCY 2
19 #define CLASS_SILENCE_PRIOR 0.4f
20 #define CLASS_OWNER_PRIOR 0.4f
21 #define CLASS_SECONDARY_PRIOR 0.1f
22 #define CLASS_NOISE_PRIOR 0.1f
23 
24 
25 enum {
31 };
32 
33 enum {
34  EP_MAYBE = 0,
37 };
38 
39 typedef struct {
41  s3cipid_t class_map[NUM_CLASSES];
42  int32 frame_prob[NUM_CLASSES];
46  int voting_frames[VOTING_LEN];
48  int32 prior_prob[NUM_CLASSES] ;
49 
50 } classifier_t;
51 
52 typedef struct {
53  int *endpts;
56  int state;
60  int counter;
61 
65 } endptr_t;
66 
67 int cl_init(classifier_t *_cl, char *_mdef_file, char *_means_file, char *_vars_file,
68  float64 _var_floor, char *_mix_weights_file,
69  float64 _mix_weight_floor, char *_gm_type, int _post_classify);
70 void cl_finish(classifier_t *_cl);
71 void cl_calc_frame_prob(classifier_t *_cl, float32 *_frame);
72 int cl_classify_frames(classifier_t *_cl, float32 **_frames, int _num_frames,
73  int **_classes);
74 
75 void ep_init(endptr_t *_ep, int _pad_leader, int _pad_trailer,
76  int _pad_cancel);
77 void ep_finish(endptr_t *_ep);
78 int ep_endpoint(endptr_t *_ep, int *_classes, int _num_frames,
79  int **_endpts);
80 
81 #if 0
82 { /* Stop indent from complaining */
83 #endif
84 #ifdef __cplusplus
85 }
86 #endif
87 
88 #endif