Moved calling points of spl_int routines from module init to module create routines.
Review URL: https://webrtc-codereview.appspot.com/789006 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2872 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
3f9a721da5
commit
ac4d70de04
@ -14,10 +14,6 @@
|
||||
* Some code came from common/rtcd.c in the WebM project.
|
||||
*/
|
||||
|
||||
/* TODO(kma): Add calls to WebRtcSpl_Init() in all related modules
|
||||
* (AEC, NS, codecs etc.).
|
||||
*/
|
||||
|
||||
#include "common_audio/signal_processing/include/real_fft.h"
|
||||
#include "common_audio/signal_processing/include/signal_processing_library.h"
|
||||
#include "system_wrappers/interface/cpu_features_wrapper.h"
|
||||
|
@ -37,6 +37,8 @@ int WebRtcVad_Create(VadInst** handle) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
WebRtcSpl_Init();
|
||||
|
||||
self->init_flag = 0;
|
||||
|
||||
return 0;
|
||||
@ -54,7 +56,6 @@ int WebRtcVad_Free(VadInst* handle) {
|
||||
|
||||
// TODO(bjornv): Move WebRtcVad_InitCore() code here.
|
||||
int WebRtcVad_Init(VadInst* handle) {
|
||||
WebRtcSpl_Init();
|
||||
// Initialize the core VAD component.
|
||||
return WebRtcVad_InitCore((VadInstT*) handle);
|
||||
}
|
||||
|
@ -48,6 +48,7 @@ WebRtc_Word16 WebRtcIlbcfix_DecoderAssign(iLBC_decinst_t **iLBC_decinst, WebRtc_
|
||||
WebRtc_Word16 WebRtcIlbcfix_EncoderCreate(iLBC_encinst_t **iLBC_encinst) {
|
||||
*iLBC_encinst=(iLBC_encinst_t*)malloc(sizeof(iLBC_Enc_Inst_t));
|
||||
if (*iLBC_encinst!=NULL) {
|
||||
WebRtcSpl_Init();
|
||||
return(0);
|
||||
} else {
|
||||
return(-1);
|
||||
@ -57,6 +58,7 @@ WebRtc_Word16 WebRtcIlbcfix_EncoderCreate(iLBC_encinst_t **iLBC_encinst) {
|
||||
WebRtc_Word16 WebRtcIlbcfix_DecoderCreate(iLBC_decinst_t **iLBC_decinst) {
|
||||
*iLBC_decinst=(iLBC_decinst_t*)malloc(sizeof(iLBC_Dec_Inst_t));
|
||||
if (*iLBC_decinst!=NULL) {
|
||||
WebRtcSpl_Init();
|
||||
return(0);
|
||||
} else {
|
||||
return(-1);
|
||||
|
@ -29,8 +29,6 @@ WebRtc_Word16 WebRtcIlbcfix_InitDecode( /* (o) Number of decoded samples */
|
||||
int use_enhancer) { /* (i) 1: use enhancer, 0: no enhancer */
|
||||
int i;
|
||||
|
||||
WebRtcSpl_Init();
|
||||
|
||||
iLBCdec_inst->mode = mode;
|
||||
|
||||
/* Set all the variables that are dependent on the frame size mode */
|
||||
|
@ -26,8 +26,6 @@
|
||||
WebRtc_Word16 WebRtcIlbcfix_InitEncode( /* (o) Number of bytes encoded */
|
||||
iLBC_Enc_Inst_t *iLBCenc_inst, /* (i/o) Encoder instance */
|
||||
WebRtc_Word16 mode) { /* (i) frame size mode */
|
||||
WebRtcSpl_Init();
|
||||
|
||||
iLBCenc_inst->mode = mode;
|
||||
|
||||
/* Set all the variables that are dependent on the frame size mode */
|
||||
|
@ -86,6 +86,7 @@ WebRtc_Word16 WebRtcIsacfix_Create(ISACFIX_MainStruct **ISAC_main_inst)
|
||||
(*(ISACFIX_SubStruct**)ISAC_main_inst)->errorcode = 0;
|
||||
(*(ISACFIX_SubStruct**)ISAC_main_inst)->initflag = 0;
|
||||
(*(ISACFIX_SubStruct**)ISAC_main_inst)->ISACenc_obj.SaveEnc_ptr = NULL;
|
||||
WebRtcSpl_Init();
|
||||
return(0);
|
||||
} else {
|
||||
return(-1);
|
||||
@ -217,8 +218,6 @@ WebRtc_Word16 WebRtcIsacfix_EncoderInit(ISACFIX_MainStruct *ISAC_main_inst,
|
||||
/* flag encoder init */
|
||||
ISAC_inst->initflag |= 2;
|
||||
|
||||
WebRtcSpl_Init();
|
||||
|
||||
if (CodingMode == 0)
|
||||
/* Adaptive mode */
|
||||
ISAC_inst->ISACenc_obj.new_framelength = INITIAL_FRAMESAMPLES;
|
||||
@ -529,8 +528,6 @@ WebRtc_Word16 WebRtcIsacfix_DecoderInit(ISACFIX_MainStruct *ISAC_main_inst)
|
||||
/* flag decoder init */
|
||||
ISAC_inst->initflag |= 1;
|
||||
|
||||
WebRtcSpl_Init();
|
||||
|
||||
WebRtcIsacfix_InitMaskingDec(&ISAC_inst->ISACdec_obj.maskfiltstr_obj);
|
||||
WebRtcIsacfix_InitPostFilterbank(&ISAC_inst->ISACdec_obj.postfiltbankstr_obj);
|
||||
WebRtcIsacfix_InitPitchFilter(&ISAC_inst->ISACdec_obj.pitchfiltstr_obj);
|
||||
|
@ -290,6 +290,9 @@ int WebRtcNetEQ_Assign(void **inst, void *NETEQ_inst_Addr)
|
||||
MainInst_t *NetEqMainInst = (MainInst_t*) NETEQ_inst_Addr;
|
||||
*inst = NETEQ_inst_Addr;
|
||||
if (*inst == NULL) return (-1);
|
||||
|
||||
WebRtcSpl_Init();
|
||||
|
||||
/* Clear memory */
|
||||
WebRtcSpl_MemSetW16((WebRtc_Word16*) NetEqMainInst, 0,
|
||||
(sizeof(MainInst_t) / sizeof(WebRtc_Word16)));
|
||||
@ -396,8 +399,6 @@ int WebRtcNetEQ_Init(void *inst, WebRtc_UWord16 fs)
|
||||
return (-1);
|
||||
}
|
||||
|
||||
WebRtcSpl_Init();
|
||||
|
||||
#ifdef NETEQ_VAD
|
||||
/* Start out with no PostDecode VAD instance */
|
||||
NetEqMainInst->DSPinst.VADInst.VADState = NULL;
|
||||
|
@ -111,6 +111,8 @@ AudioDeviceModule* AudioDeviceModuleImpl::Create(const WebRtc_Word32 id,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
WebRtcSpl_Init();
|
||||
|
||||
return audioDevice;
|
||||
}
|
||||
|
||||
@ -608,8 +610,6 @@ WebRtc_Word32 AudioDeviceModuleImpl::Init()
|
||||
if (!_ptrAudioDevice)
|
||||
return -1;
|
||||
|
||||
WebRtcSpl_Init();
|
||||
|
||||
_ptrAudioDeviceUtility->Init();
|
||||
|
||||
if (_ptrAudioDevice->Init() == -1)
|
||||
|
@ -110,6 +110,8 @@ WebRtc_Word32 WebRtcAecm_Create(void **aecmInst)
|
||||
return -1;
|
||||
}
|
||||
|
||||
WebRtcSpl_Init();
|
||||
|
||||
aecm->initFlag = 0;
|
||||
aecm->lastError = 0;
|
||||
|
||||
@ -171,8 +173,6 @@ WebRtc_Word32 WebRtcAecm_Init(void *aecmInst, WebRtc_Word32 sampFreq)
|
||||
}
|
||||
aecm->sampFreq = sampFreq;
|
||||
|
||||
WebRtcSpl_Init();
|
||||
|
||||
// Initialize AECM core
|
||||
if (WebRtcAecm_InitCore(aecm->aecmCore, aecm->sampFreq) == -1)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user