1 /*---------------------------------------------------------------------------* 2 * prelib.h * 3 * * 4 * Copyright 2007, 2008 Nuance Communciations, Inc. * 5 * * 6 * Licensed under the Apache License, Version 2.0 (the 'License'); * 7 * you may not use this file except in compliance with the License. * 8 * * 9 * You may obtain a copy of the License at * 10 * http://www.apache.org/licenses/LICENSE-2.0 * 11 * * 12 * Unless required by applicable law or agreed to in writing, software * 13 * distributed under the License is distributed on an 'AS IS' BASIS, * 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 15 * See the License for the specific language governing permissions and * 16 * limitations under the License. * 17 * * 18 *---------------------------------------------------------------------------*/ 19 20 21 #ifndef _h_prelib_ 22 #define _h_prelib_ 23 24 #ifdef SET_RCSID 25 static const char prelib_h[] = "$Id: prelib.h,v 1.2.6.7 2008/04/01 18:23:20 dahan Exp $"; 26 #endif 27 28 29 #include "pre_desc.h" 30 31 void init_preprocessed(preprocessed *datapak, int dimen, 32 float imelda_scale); 33 void init_partial_distance_approx(preprocessed *prep); 34 void clear_partial_distance_approx(preprocessed *prep); 35 void clear_preprocessed(preprocessed *datapak); 36 37 void linear_transform_frame(preprocessed *datapak, imeldata *fram, int do_shift); 38 void inverse_transform_frame (preprocessed *prep, imeldata *fram, int do_shift); 39 40 #ifdef __cplusplus 41 extern "C" 42 { 43 #endif 44 45 void create_lookup_logadd(logadd_table_info *table, float mul_scale); 46 47 #ifdef __cplusplus 48 } 49 #endif 50 51 void destroy_lookup_logadd(logadd_table_info *table); 52 53 void create_linear_transform(preprocessed *datapak, int matdim, 54 int with_offset); 55 void free_linear_transform(preprocessed *datapak); 56 #ifndef _RTT 57 int init_newton_transform(preprocessed *datapak, float reqscale, 58 char *filename, int dimen); 59 void copy_linear_transform(preprocessed *datapak, float **new_matrix, 60 int dimen); 61 void load_imelda_transform(char *filename, int dim); 62 #endif 63 64 void set_cepstrum_offset(preprocessed *prep, int index, int value); 65 66 int voicing_bit(preprocessed *predat); 67 68 #if DO_SUBTRACTED_SEGMENTATION 69 void setup_spectrum_transform(preprocessed *prep, int numceps, 70 float *stat_sc, float *stat_off); 71 void clear_spectrum_transform(preprocessed *prep); 72 #endif 73 74 #endif 75