diff --git a/src/common_audio/vad/include/webrtc_vad.h b/src/common_audio/vad/include/webrtc_vad.h index 4324381ca7..b288176ed7 100644 --- a/src/common_audio/vad/include/webrtc_vad.h +++ b/src/common_audio/vad/include/webrtc_vad.h @@ -127,7 +127,7 @@ int WebRtcVad_Init(VadInst *vad_inst); * Return value : 0 - Ok * -1 - Error */ -int WebRtcVad_set_mode(VadInst *vad_inst, WebRtc_Word16 mode); +int WebRtcVad_set_mode(VadInst *vad_inst, int mode); /**************************************************************************** * WebRtcVad_Process(...) diff --git a/src/common_audio/vad/vad_core.c b/src/common_audio/vad/vad_core.c index e4fb55f97c..2c6e6a950f 100644 --- a/src/common_audio/vad/vad_core.c +++ b/src/common_audio/vad/vad_core.c @@ -527,7 +527,7 @@ int WebRtcVad_InitCore(VadInstT* self) { } // Set aggressiveness mode -int WebRtcVad_set_mode_core(VadInstT *inst, short mode) +int WebRtcVad_set_mode_core(VadInstT *inst, int mode) { if (mode == 0) diff --git a/src/common_audio/vad/vad_core.h b/src/common_audio/vad/vad_core.h index 5e563539aa..c82fbce0f2 100644 --- a/src/common_audio/vad/vad_core.h +++ b/src/common_audio/vad/vad_core.h @@ -75,7 +75,7 @@ int WebRtcVad_InitCore(VadInstT* self); * -1 - Error */ -int WebRtcVad_set_mode_core(VadInstT* inst, short mode); +int WebRtcVad_set_mode_core(VadInstT* inst, int mode); /**************************************************************************** * WebRtcVad_CalcVad32khz(...) diff --git a/src/common_audio/vad/vad_core_unittest.cc b/src/common_audio/vad/vad_core_unittest.cc index 528bce9aa2..141b7965c0 100644 --- a/src/common_audio/vad/vad_core_unittest.cc +++ b/src/common_audio/vad/vad_core_unittest.cc @@ -45,8 +45,7 @@ TEST_F(VadTest, set_mode_core) { // Test WebRtcVad_set_mode_core(). // Invalid modes should return -1. EXPECT_EQ(-1, WebRtcVad_set_mode_core(self, -1)); - EXPECT_EQ(-1, WebRtcVad_set_mode_core(self, - static_cast(kModesSize))); + EXPECT_EQ(-1, WebRtcVad_set_mode_core(self, 1000)); // Valid modes should return 0. for (size_t j = 0; j < kModesSize; ++j) { EXPECT_EQ(0, WebRtcVad_set_mode_core(self, kModes[j])); diff --git a/src/common_audio/vad/vad_unittest.h b/src/common_audio/vad/vad_unittest.h index 87852e84a2..f68427c6ef 100644 --- a/src/common_audio/vad/vad_unittest.h +++ b/src/common_audio/vad/vad_unittest.h @@ -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 @@ -19,7 +19,7 @@ namespace { // Modes we support -const int16_t kModes[] = { 0, 1, 2, 3 }; +const int kModes[] = { 0, 1, 2, 3 }; const size_t kModesSize = sizeof(kModes) / sizeof(*kModes); // Rates we support. diff --git a/src/common_audio/vad/webrtc_vad.c b/src/common_audio/vad/webrtc_vad.c index 51a27f22d4..30bc8a6e6c 100644 --- a/src/common_audio/vad/webrtc_vad.c +++ b/src/common_audio/vad/webrtc_vad.c @@ -106,7 +106,7 @@ int WebRtcVad_Init(VadInst* handle) { return WebRtcVad_InitCore((VadInstT*) handle); } -int WebRtcVad_set_mode(VadInst *vad_inst, WebRtc_Word16 mode) +int WebRtcVad_set_mode(VadInst *vad_inst, int mode) { VadInstT* vad_ptr; diff --git a/src/modules/audio_coding/neteq/dsp.c b/src/modules/audio_coding/neteq/dsp.c index 441d981e7e..96f07d2736 100644 --- a/src/modules/audio_coding/neteq/dsp.c +++ b/src/modules/audio_coding/neteq/dsp.c @@ -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; diff --git a/src/modules/audio_coding/neteq/dsp.h b/src/modules/audio_coding/neteq/dsp.h index 4cafb8faa8..94213e4500 100644 --- a/src/modules/audio_coding/neteq/dsp.h +++ b/src/modules/audio_coding/neteq/dsp.h @@ -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 */ diff --git a/src/modules/audio_coding/neteq/interface/webrtc_neteq_internal.h b/src/modules/audio_coding/neteq/interface/webrtc_neteq_internal.h index 1044727ca2..70ed044d42 100644 --- a/src/modules/audio_coding/neteq/interface/webrtc_neteq_internal.h +++ b/src/modules/audio_coding/neteq/interface/webrtc_neteq_internal.h @@ -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(...) diff --git a/src/modules/audio_coding/neteq/webrtc_neteq.c b/src/modules/audio_coding/neteq/webrtc_neteq.c index bf3ab20337..c15e6c4a67 100644 --- a/src/modules/audio_coding/neteq/webrtc_neteq.c +++ b/src/modules/audio_coding/neteq/webrtc_neteq.c @@ -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 */ diff --git a/src/modules/audio_processing/voice_detection_impl.cc b/src/modules/audio_processing/voice_detection_impl.cc index 49aac2e674..e1c0f0ee3e 100644 --- a/src/modules/audio_processing/voice_detection_impl.cc +++ b/src/modules/audio_processing/voice_detection_impl.cc @@ -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 @@ -23,7 +23,7 @@ namespace webrtc { typedef VadInst Handle; namespace { -WebRtc_Word16 MapSetting(VoiceDetection::Likelihood likelihood) { +int MapSetting(VoiceDetection::Likelihood likelihood) { switch (likelihood) { case VoiceDetection::kVeryLowLikelihood: return 3;