libsent/src/anlz/paramtypes.c File Reference

Convert between string and binary expression of parameter type. More...

#include <sent/stddefs.h>
#include <sent/htk_defs.h>
#include <sent/htk_param.h>

Include dependency graph for paramtypes.c:

Go to the source code of this file.

Functions

short param_qualstr2code (char *s)
short param_str2code (char *s)
char * param_qualcode2str (char *buf, short type, boolean descflag)
char * param_code2str (char *buf, short type, boolean descflag)

Variables

static OptionStr pbase []
 Database that relates base type strings to binary code and description string.
static OptionStr pqual []
 Database that relates qualifier type strings to binary code and description string.


Detailed Description

Convert between string and binary expression of parameter type.

Author:
Akinobu LEE
Date:
Tue Feb 15 00:06:26 2005
The functions in this file converts the expression of parameter type, between string (ex. "MFCC_E_D_Z") and internal binary format used in HTK.

Revision
1.3

Definition in file paramtypes.c.


Function Documentation

short param_qualstr2code ( char *  s  ) 

Convert a qualifier string to a binary type code.

Parameters:
s [in] a string that contains qualifier strings like "_E_D_Z"
Returns:
the converted internal binary type code, F_ERR_INVALID if failed.

Definition at line 69 of file paramtypes.c.

Referenced by param_str2code().

short param_str2code ( char *  s  ) 

Convert a type string that contains basename and qualifiers to a binary type code.

Parameters:
s [in] a string that contains base and qualifier string like "MFCC_E_D_Z"
Returns:
the converted internal binary type code, F_ERR_INVALID if failed.

Definition at line 105 of file paramtypes.c.

Referenced by read_global_opt().

char* param_qualcode2str ( char *  buf,
short  type,
boolean  descflag 
)

Convert the qualifier part of a binary type code to string.

Parameters:
buf [out] buffer to store the resulting string (must have enough length)
type [in] binary type code to convert.
descflag [in] set to TRUE if you want result in description string instead of qualifier string.
Returns:
buf on success, NULL on failure.

Definition at line 148 of file paramtypes.c.

Referenced by param_code2str(), and select_param_vmark().

char* param_code2str ( char *  buf,
short  type,
boolean  descflag 
)

Convert a binary type code to string.

Parameters:
buf [out] buffer to store the resulting string (must have enough length)
type [in] binary type code to convert.
descflag [in] set to TRUE if you want result in description string instead of base and qualifier string.
Returns:
buf on success, NULL on failure.

Definition at line 177 of file paramtypes.c.

Referenced by new_param_check_and_adjust(), new_select_param_kind(), print_hmmdef_info(), and put_param_head().


Variable Documentation

OptionStr pbase[] [static]

Initial value:

 {
  {"WAVEFORM", F_WAVEFORM, "sampled waveform", FALSE},
  {"DISCRETE", F_DISCRETE, "Discrete", FALSE},
  {"LPC", F_LPC, "LPC", TRUE},
  {"LPCEPSTRA", F_LPCEPSTRA, "LPC cepstral", TRUE},
  {"MFCC", F_MFCC, "mel-frequency cepstral", TRUE},
  {"FBANK", F_FBANK, "log mel-filter bank", TRUE},
  {"MELSPEC", F_MELSPEC, "linear mel-filter bank", TRUE},
  {"LPREFC", F_LPREFC, "LPC(reflection)", TRUE},
  {"LPDELCEP", F_LPDELCEP, "LPC+Delta", TRUE},
  {"USER", F_USER, "user defined sample kind", TRUE},
  {NULL,0,NULL,FALSE}
}
Database that relates base type strings to binary code and description string.

Definition at line 35 of file paramtypes.c.

Referenced by param_code2str(), and param_str2code().

OptionStr pqual[] [static]

Initial value:

 {
  {"_E", F_ENERGY, "log energy coef.", TRUE},
  {"_N", F_ENERGY_SUP, "uppress absolute energy", TRUE},
  {"_D", F_DELTA, "delta coef.", TRUE},
  {"_A", F_ACCL, "acceleration coef.", TRUE},
  {"_C", F_COMPRESS, "compressed", TRUE},
  {"_Z", F_CEPNORM, "cepstral mean normalization", TRUE},
  {"_K", F_CHECKSUM, "CRC checksum added", TRUE},
  {"_0", F_ZEROTH, "0'th cepstral parameter", TRUE},
  {NULL,0,NULL,FALSE}
}
Database that relates qualifier type strings to binary code and description string.

Definition at line 49 of file paramtypes.c.

Referenced by param_qualcode2str(), and param_qualstr2code().


Generated on Tue Dec 26 16:17:43 2006 for Julius by  doxygen 1.5.0