VAD refactor: Mode changed to "int".
As part of style this CL includes changing the input aggressiveness mode from int16_t to int. No other style changes made. Impact on: - Audio Processing: Changed return value on MapSetting(). - Function test in audio_conference_mixer already uses int. No action. - NetEq: Function pointer changes and input parameter changes in SetVADMode() and SetVADModeInternal(). - Audio Coding: Uses enum ACMVADMode which is type independent. - VAD: Two unit tests. TESTS=vad_unittests, neteq_unittests, audioproc_unittest Review URL: https://webrtc-codereview.appspot.com/373001 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1544 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -471,8 +471,7 @@ int WebRtcNetEQ_InitVAD(PostDecodeVAD_t *VADInst, WebRtc_UWord16 fs)
|
||||
* -1 - Error
|
||||
*/
|
||||
|
||||
int WebRtcNetEQ_SetVADModeInternal(PostDecodeVAD_t *VADInst,
|
||||
WebRtc_Word16 mode)
|
||||
int WebRtcNetEQ_SetVADModeInternal(PostDecodeVAD_t *VADInst, int mode)
|
||||
{
|
||||
|
||||
int res = 0;
|
||||
|
||||
@@ -189,7 +189,7 @@ typedef struct ExpandInst_t_
|
||||
* WebRtcVad_set_mode and WebRtcVad_Process, respectively, all found in webrtc_vad.h.
|
||||
*/
|
||||
typedef int (*VADInitFunction)(void *VAD_inst);
|
||||
typedef int (*VADSetmodeFunction)(void *VAD_inst, WebRtc_Word16 mode);
|
||||
typedef int (*VADSetmodeFunction)(void *VAD_inst, int mode);
|
||||
typedef WebRtc_Word16 (*VADFunction)(void *VAD_inst, WebRtc_Word16 fs, WebRtc_Word16 *frame,
|
||||
WebRtc_Word16 frameLen);
|
||||
|
||||
@@ -200,7 +200,7 @@ typedef struct PostDecodeVAD_t_
|
||||
void *VADState; /* pointer to a VAD instance */
|
||||
|
||||
WebRtc_Word16 VADEnabled; /* 1 if enabled, 0 if disabled */
|
||||
WebRtc_Word16 VADMode; /* mode parameter to pass to the VAD function */
|
||||
int VADMode; /* mode parameter to pass to the VAD function */
|
||||
WebRtc_Word16 VADDecision; /* 1 for active, 0 for passive */
|
||||
WebRtc_Word16 SIDintervalCounter; /* reset when decoding CNG/SID frame,
|
||||
increment for each recout call */
|
||||
@@ -700,7 +700,7 @@ int WebRtcNetEQ_InitVAD(PostDecodeVAD_t *VADInst, WebRtc_UWord16 fs);
|
||||
* -1 - Error
|
||||
*/
|
||||
|
||||
int WebRtcNetEQ_SetVADModeInternal(PostDecodeVAD_t *VADInst, WebRtc_Word16 mode);
|
||||
int WebRtcNetEQ_SetVADModeInternal(PostDecodeVAD_t *VADInst, int mode);
|
||||
|
||||
#endif /* NETEQ_VAD */
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ int WebRtcNetEQ_GetRawFrameWaitingTimes(void *inst,
|
||||
* WebRtcVad_set_mode and WebRtcVad_Process, respectively, all found in webrtc_vad.h.
|
||||
*/
|
||||
typedef int (*WebRtcNetEQ_VADInitFunction)(void *VAD_inst);
|
||||
typedef int (*WebRtcNetEQ_VADSetmodeFunction)(void *VAD_inst, WebRtc_Word16 mode);
|
||||
typedef int (*WebRtcNetEQ_VADSetmodeFunction)(void *VAD_inst, int mode);
|
||||
typedef WebRtc_Word16 (*WebRtcNetEQ_VADFunction)(void *VAD_inst, WebRtc_Word16 fs,
|
||||
WebRtc_Word16 *frame, WebRtc_Word16 frameLen);
|
||||
|
||||
@@ -189,7 +189,7 @@ int WebRtcNetEQ_SetVADInstance(void *NetEQ_inst, void *VAD_inst,
|
||||
* -1 - Error
|
||||
*/
|
||||
|
||||
int WebRtcNetEQ_SetVADMode(void *NetEQ_inst, WebRtc_Word16 mode);
|
||||
int WebRtcNetEQ_SetVADMode(void *NetEQ_inst, int mode);
|
||||
|
||||
/****************************************************************************
|
||||
* WebRtcNetEQ_RecOutNoDecode(...)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
||||
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
@@ -1632,7 +1632,7 @@ int WebRtcNetEQ_SetVADInstance(void *NetEQ_inst, void *VAD_inst,
|
||||
* -1 - Error
|
||||
*/
|
||||
|
||||
int WebRtcNetEQ_SetVADMode(void *inst, WebRtc_Word16 mode)
|
||||
int WebRtcNetEQ_SetVADMode(void *inst, int mode)
|
||||
{
|
||||
|
||||
/* Typecast to internal instance type */
|
||||
|
||||
Reference in New Issue
Block a user