/************************************************
		SolomonVoice_VoiceAndNoiseStatus.h
*************************************************/

#include "SV_common_include.h"

//#define BIN_ACCLOW 
#define BIN_ACCMAX 22

// Processing
extern void SolomonVoice_VAD_TimeDomain_Exe(INT64 PwrdB_Rx, INT64 PwrdB_Mic1);
// PwrdB_Rx - power of Rx channel
// PwrdB_Mic1 - power of Rx channel
//p_struct - pointer to the module internal structure

static void fn_VAD_acc(INT64 *Xacc);
static void fn_DefineTxCondition(INT64 *XXmic1, INT64 *XXmic2);
static void fn_SetMixingState(INT64 *XXmic1);
static void fn_WindDetection(INT64 *XXmic1, INT64 *XXmic2, ComplexInt64 *XXcross);
static void fn_1micVAD_LTSV(INT64 *XX);

extern void VoiceAndNoiseStatus_Exe(ComplexInt* Rx_sp,ComplexInt* Outer1_sp,ComplexInt* Outer2_sp,ComplexInt* Acc_sp, int nsp);
// Rx_sp, Outer1_sp, Outer2_sp, Acc_sp - Complex spectrum of channels
// nsp - number of bins in channels (positive frequencies only)
// p_struct - pointer to the module internal structure

extern int VoiceAndNoiseStatus_Get_frmVAD_Acc(void);
extern int VoiceAndNoiseStatus_Get_frmVAD_Acc_BSH(void);
extern int VoiceAndNoiseStatus_Get_frmVAD_Rx_AEC(void);
extern int VoiceAndNoiseStatus_Get_VADACCmask(void);
extern int VoiceAndNoiseStatus_Get_flag_Wind_strong(void);
extern int VoiceAndNoiseStatus_Get_flag_Wind_normal(void);
extern int VoiceAndNoiseStatus_Get_flag_Tx_silence(void);
extern int VoiceAndNoiseStatus_Get_flag_Tx_silence_AEC(void);
extern int VoiceAndNoiseStatus_Get_flag_Tx_LoudSig(void);
extern int VoiceAndNoiseStatus_Get_flag_NoiseOnly(void);
extern int VoiceAndNoiseStatus_Get_flag_FrmDT(void);
extern int VoiceAndNoiseStatus_Get_flag_SingleTalk(void);
extern int VoiceAndNoiseStatus_Get_flag_SingleNET(void);
extern int VoiceAndNoiseStatus_Get_flag_ACC_Effective(void); 
extern int VoiceAndNoiseStatus_Get_noiseLevel(void);
extern int VoiceAndNoiseStatus_Get_state_noise2clean(void);
extern int VoiceAndNoiseStatus_VADCorrection(short *Mask);
extern int VoiceAndNoiseStatus_NoiseOnsetCorrection(int *noisySpec, int *enhSpec, short *refMask, short noiseLevel);

// Init
extern void VoiceAndNoiseStatus_Init(int Fs);
// Fs - {8000, 16000}
// p_struct - pointer to the module structure (to be initialized)
extern void VoiceAndNoiseStatus_Deinit();


