SPRAAK
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Data Structures | Typedefs | Enumerations | Functions | Variables
ssp_master.c File Reference

definitions for the signal processing routines More...

Data Structures

struct  SprSspFlist
 
struct  SprSspFinfo
 
struct  SprSspAS
 
struct  SprSspStatus
 
struct  SprSspStatusIO
 Save/load a modules status. More...
 
struct  SprSspStatusUpdate
 Update module status with some new data. More...
 
struct  SprSspInfo
 
struct  SprSspDesc
 
struct  SprSspDlist
 
struct  SprSspStoreInfo
 
struct  SprSspRecallInfo
 
struct  spr_t_ssp_types
 

Typedefs

typedef SprSspStatusIO SprSspStatusLoad
 
typedef SprSspStatusIO SprSspStatusSave
 
typedef void(* _FuncPtr1_SSP_MASTER_ )(struct spr_t_ssp_info *info, SprSspStatus *action)
 
typedef int(* _FuncPtr2_SSP_MASTER_ )(struct spr_t_ssp_info *info, const void *frame_in, void *frame_out)
 
typedef void(* _FuncPtr3_SSP_MASTER_ )(struct spr_t_ssp_info *info)
 
typedef void *(* _FuncPtr4_SSP_MASTER_ )(SprStream *f, struct spr_t_ssp_desc *d)
 
typedef int(* _FuncPtr5_SSP_MASTER_ )(SprSspInfo *ssp_start, const char **line_array, void *aux_info)
 
typedef int(* _FuncPtr6_SSP_MASTER_ )(SprSspInfo *info, const void *frame_in, void *frame_out)
 

Enumerations

enum  {
  SPR_SSP_FRAME_OUT, SPR_SSP_FRAME_SKP, SPR_SSP_FRAME_END, SPR_SSP_FRAME_ERR,
  SPR_SSP_FRAME_HLD
}
 
enum  {
  SPR_SSP_FLIST_STOP, SPR_SSP_FLIST_CONTINUE, SPR_SSP_FLIST_START, SPR_SSP_FLIST_PAUSE,
  SPR_SSP_FLIST_RESUME
}
 
enum  { SPR_SSP_STATUS_NOI, SPR_SSP_STATUS_RDY, SPR_SSP_STATUS_ERR, SPR_SSP_STATUS_FAT }
 
enum  {
  SPR_SSP_PASTE_STORE, SPR_SSP_PASTE_RECALL, SPR_SSP_PASTE_GET_VLEN, SPR_SSP_PASTE_GET_TYPE,
  SPR_SSP_PASTE_CHK_NAME, SPR_SSP_PASTE_LAST
}
 
enum  { SPR_SSP_MODSTATUS_LOAD, SPR_SSP_MODSTATUS_SAVE, SPR_SSP_MODSTATUS_UPDATE }
 Action ID's. More...
 
enum  { SPR_SSP_MOD_AUX_NULL, SPR_SSP_MOD_AUX_KEYS, SPR_SSP_MOD_AUX_VAR, SPR_SSP_MOD_AUX_DES }
 note: lowest bits reverved for FEVAL_SUBST_... flags More...
 
enum  { SPR_SSP_LT_EMPTY, SPR_SSP_LT_GLOBAL_CMD, SPR_SSP_LT_HEADER, SPR_SSP_LT_LOCAL_CMD }
 

Functions

int spr_ssp_line_type (const char *str)
 
const char * spr_ssp_get_line (const char ***line_array, int req_types, int stop_types)
 
const char * spr_ssp_next_line (const char ***line_array)
 

Variables

char * spr_ssp_str_err []
 
char * spr_ssp_str_err_short []
 
char * spr_ssp_str_status []
 
char * spr_ssp_str_paste []
 
SprSspDesc spr_ssp_empty_desc
 

Detailed Description

definitions for the signal processing routines

Date
10/10/94
Author
Kris Demuynck

The signal processing routines must provide the following routines towards the ssp_master module: setup_xxx, reset_xxx, process_xxx and free_xxx.

setup_xxx
int setup_xxx(
ssp_info *Info,
const char **line_array,
keyset *keys,
const Cmd **cmd_list)

The following fields in the ssp_info structure has to be filled in:

vlen_out
Number of parameters in the output frame
type_out
Type of the parameters in the output frame
history
Required number of previous frames, in order to give (approximately) the same result as an infinite number of previous frames.
specific_data
All data required by the routine.

The following functionality is required:

reset_xxx
void reset_idct(
ssp_info *info,
SprSspStatus *action)

This procedure is called before a new file will be processed. Its main task is initializing/resetting the specific information. It is also used to ask for special actions like storing and loading a certain status, or modifying the modules behaviour on the fly. Currently, the following actions (action) are defined:

NULL
A normal reset.
SprSspStatusLoad
Save the current status.
The saved data must be ASCII data.
SprSspStatusSave
Load a previously saved status.
SprSspStatusUpdate
Update the status given some feedback info from elsewhere in the recognizer.
process_xxx
int process_xxx(
ssp_info *info,
const void *frame_in,
void *frame_out);

Process a single frame. The folowing return codes are valid:

SSP_FRAME_OUT
Indicates that a valid output frame is returned.
SSP_FRAME_HLD
Indicates that the input frame is stored and will be returned later (non causal routines).
SSP_FRAME_SKP
Indicates that the frame has been skipped (e.g. varfr).
SSP_FRAME_ERR
Indicates that an error has occurred.
SSP_FRAME_END
Indicates that the last input frames has been processed and returned.

The order of the frames must remain intact. The output stream can be delayed by returning SSP_FRAME_HLD and frames can be left out by returning SSP_FRAME_SKP.After the last valid input frame, NULL pointers are given as input frame until a SSP_FRAME_END is received. This ensures that the signal processing routines can return all delayed frames.

free_xxx
void free_xxx(
ssp_info *info);
Free the specific data (the master routines take care of the ssp_info structure).

The master routines reflect a same structure:

ssp_setup
Allocates the ssp_des structure. The initialization is done during the first ssp_reset, so the size, datatype and other information stored in the keys, is known during the initialization.
ssp_new_file
Construct the file name for a given data file, and check if the name differs from the previous file.
ssp_reset
Initialize/reset the internal buffers and the specific data. Must be called at the start of a new file. Also used for loading/saving of status information (e.g. speaker adaptation data).
ssp_fseek
Skip a number of frames.
ssp_process
Process one frame.
ssp_free
Free all memory allocated by the signal processing routines.
See Also
ssp_part1.c, ssp_part2.c, ssp_part3.c, ssp_part4.c and spr_sigp.c
Revision History:
30/11/2004 - KD
split into ssp_master.c and ssp_tbl.c