Lines Matching refs:rec

72 static void allocate_recognition1(srec *rec,
91 rec->current_model_scores = (costdata*) CALLOC_CLR(max_model_states, sizeof(costdata), "search.srec.current_model_scores"); /*FIX - either get NUM_MODELS from acoustic models, or check this someplace to make sure we have enough room*/
92 rec->num_model_slots_allocated = (modelID)max_model_states;
94 rec->fsmarc_token_array_size = (stokenID)max_hmm_tokens;
96 rec->fsmarc_token_array = (fsmarc_token*) CALLOC_CLR(rec->fsmarc_token_array_size , sizeof(fsmarc_token), "search.srec.fsmarc_token_array");
97 rec->max_new_states = (stokenID)max_hmm_tokens;
99 rec->word_token_array = (word_token*) CALLOC_CLR(max_word_tokens, sizeof(word_token), "search.srec.word_token_array");
100 rec->word_token_array_size = (wtokenID)max_word_tokens;
102 rec->word_token_array_flags = (asr_int16_t*) CALLOC_CLR(max_word_tokens, sizeof(asr_int16_t), "search.srec.word_token_array_flags");
104 rec->fsmnode_token_array = (fsmnode_token*) CALLOC_CLR(max_fsmnode_tokens, sizeof(fsmnode_token), "search.srec.fsmnode_token_array");
105 rec->fsmnode_token_array_size = (ftokenID)max_fsmnode_tokens;
107 rec->altword_token_array = (altword_token*) CALLOC_CLR(max_altword_tokens, sizeof(altword_token), "search.srec.altword_token_array");
108 rec->altword_token_array_size = (wtokenID)max_altword_tokens;
110 rec->prune_delta = (costdata)viterbi_prune_thresh;
112 rec->max_frames = (frameID)max_frames;
113 rec->best_model_cost_for_frame = (costdata*)CALLOC_CLR(max_frames, sizeof(costdata), "search.srec.best_model_cost_for_frame");
114 rec->word_lattice = allocate_word_lattice((frameID)max_frames);
116 rec->word_priority_q = allocate_priority_q(num_wordends_per_frame);
117 rec->best_fsmarc_token = MAXstokenID;
120 rec->astar_stack = astar_stack_make(rec, ASTAR_NBEST_LEN);
121 rec->context = NULL;
138 int allocate_recognition(multi_srec *rec,
172 rec->rec = (srec*)CALLOC_CLR(max_searches, sizeof(srec), "search.srec.base");
173 rec->num_allocated_recs = max_searches;
174 rec->num_swimodels = 0;
178 rec->best_token_for_arc = (stokenID*)CALLOC_CLR(max_fsm_arcs, sizeof(stokenID), "search.srec.best_token_for_arc");
179 rec->max_fsm_arcs = (arcID)max_fsm_arcs;
181 rec->best_token_for_node = (ftokenID*)CALLOC_CLR(max_fsm_nodes, sizeof(ftokenID), "search.srec.best_token_for_node");
182 rec->max_fsm_nodes = (nodeID)max_fsm_nodes;
187 rec->cost_offset_for_frame = (costdata*)CALLOC_CLR(max_frames, sizeof(costdata), "search.srec.current_best_costs");
188 rec->accumulated_cost_offset = (bigcostdata*)CALLOC_CLR(max_frames, sizeof(bigcostdata), "search.srec.accumulated_cost_offset");
189 rec->max_frames = (frameID)max_frames;
191 rec->accumulated_cost_offset[i] = 0;
194 for (i = 0; i < rec->num_allocated_recs; i++)
196 allocate_recognition1(&rec->rec[i], viterbi_prune_thresh, max_hmm_tokens, max_fsmnode_tokens, max_word_tokens, max_altword_tokens, num_wordends_per_frame, max_frames, max_model_states);
197 rec->rec[i].best_token_for_node = rec->best_token_for_node;
198 rec->rec[i].max_fsm_nodes = rec->max_fsm_nodes;
199 rec->rec[i].best_token_for_arc = rec->best_token_for_arc;
200 rec->rec[i].max_fsm_arcs = rec->max_fsm_arcs;
201 rec->rec[i].max_frames = rec->max_frames;
202 rec->rec[i].cost_offset_for_frame = rec->cost_offset_for_frame;
203 rec->rec[i].accumulated_cost_offset = rec->accumulated_cost_offset;
204 rec->rec[i].id = (asr_int16_t)i;
206 rec->eos_status = VALID_SPEECH_NOT_YET_DETECTED;
211 static void free_recognition1(srec *rec)
213 FREE(rec->current_model_scores);
214 FREE(rec->fsmarc_token_array);
215 FREE(rec->word_token_array);
216 FREE(rec->word_token_array_flags);
217 FREE(rec->fsmnode_token_array);
218 FREE(rec->altword_token_array);
219 FREE(rec->best_model_cost_for_frame);
220 destroy_word_lattice(rec->word_lattice);
221 free_priority_q(rec->word_priority_q);
222 astar_stack_destroy(rec);
225 void free_recognition(multi_srec *rec)
228 for (i = 0; i < rec->num_allocated_recs; i++)
229 free_recognition1(&rec->rec[i]);
230 FREE(rec->accumulated_cost_offset);
231 FREE(rec->cost_offset_for_frame);
232 FREE(rec->best_token_for_node);
233 FREE(rec->best_token_for_arc);
234 FREE(rec->rec);