void g729_init_decoder(PVT *hDecoder){ struct g72x_coder_pvt *state = hDecoder; #ifndef IPPCORE_NO_SSE ippSetFlushToZero(1, NULL); #endif state->coder = ippsMalloc_8u(decoder_size); state->scratch_mem = ippsMalloc_8u(coder_size_scratch); apiG729Decoder_InitBuff(state->coder, state->scratch_mem); apiG729Decoder_Init(state->coder, G729A_CODEC); return 0; }
static USC_Status Reinit(USC_Modes *modes, USC_Handle handle ) { G729_Handle *g729_handle; g729_handle = (G729_Handle*)handle; if (g729_handle->direction == 0) /* encode only */ { G729Encoder_Obj *EncObj = (G729Encoder_Obj *)&g729_handle->Object; apiG729Encoder_Init((G729Encoder_Obj*)EncObj, modes->bitrate, modes->vad); } else if (g729_handle->direction == 1) /* decode only */ { G729Decoder_Obj *DecObj = (G729Decoder_Obj *)&g729_handle->Object; apiG729Decoder_Init((G729Decoder_Obj*)DecObj, modes->bitrate); } else { return USC_NoOperation; } return USC_NoError; }
static USC_Status Init(const USC_Option *options, const USC_MemBank *pBanks, USC_Handle *handle) { G729_Handle *g729_handle; *handle = (USC_Handle*)pBanks->pMem; g729_handle = (G729_Handle*)*handle; g729_handle->direction = options->direction; if (options->direction == 0) /* encode only */ { G729Encoder_Obj *EncObj = (G729Encoder_Obj *)&g729_handle->Object; apiG729Encoder_Init((G729Encoder_Obj*)EncObj, (G729Codec_Type)options->modes.bitrate,options->modes.vad); } else if (options->direction == 1) /* decode only */ { G729Decoder_Obj *DecObj = (G729Decoder_Obj *)&g729_handle->Object; apiG729Decoder_Init((G729Decoder_Obj*)DecObj, (G729Codec_Type)options->modes.bitrate); } else { return USC_NoOperation; } return USC_NoError; }