예제 #1
0
/*************************************************************************
*
*  Function:   Speech_Decode_Frame_reset
*  Purpose:    Resetses state memory
*
**************************************************************************
*/
int Speech_Decode_Frame_reset (Speech_Decode_FrameState *state)
{
  Decoder_amr_reset(state->decoder_amrState, (enum Mode)0);
  Post_Filter_reset(state->post_state);
  Post_Process_reset(state->postHP_state);

  state->prev_mode = (enum Mode)0;

  return 0;
}
예제 #2
0
/*************************************************************************
*
*  Function:   Post_Process_init
*  Purpose:    Allocates state memory and initializes state memory
*
**************************************************************************
*/
int Post_Process_init (Post_ProcessState **state)
{
  Post_ProcessState* s;
 
  if (state == (Post_ProcessState **) NULL){
      fprintf(stderr, "Post_Process_init: invalid parameter\n");
      return -1;
  }
  *state = NULL;
 
  /* allocate memory */
  if ((s= (Post_ProcessState *) malloc(sizeof(Post_ProcessState))) == NULL){
      fprintf(stderr, "Post_Process_init: can not malloc state structure\n");
      return -1;
  }
  
  Post_Process_reset(s);
  *state = s;
  
  return 0;
}