aec_nm.h
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:6k
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*****************************************************************************
- *
- * Filename:
- * ---------
- * AEC.h
- *
- * Project:
- * --------
- * Maui META APP
- *
- * Description:
- * ------------
- * Acoustic Echo Cancellation (AEC) calibration in normal mode header
- *
- * Author:
- * -------
- * Andy Ueng (mtk00490)
- *
- *============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * $Revision$
- * $Modtime$
- * $Log$
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- //---------------------------------------------------------------------------
- #ifndef _AEC_NM_H_
- #define _AEC_NM_H_
- #ifndef _AEC_COMMON_H_
- #include "aec_common.h"
- #endif
- #ifndef META_DLL_H
- #include "meta.h"
- #endif
- #ifndef _METAAPP_COMMON_H_
- #include "metaapp_common.h"
- #endif
- #ifndef _SP_COEF_H_
- #include "sp_coef.h"
- #endif
- #ifndef _VOLUME_SETTING_H_
- #include "volume_setting.h"
- #endif
- #ifndef _MAN_HANDLE_H_
- #include "man_handle.h"
- #endif
- //---------------------------------------------------------------------------
- typedef struct
- {
- E_AEC_TYPE_T e_aec_type;
- E_AUDIO_FIR_VER_T e_audio_param_type;
- S_AEC_NM_INI_T s_ini;
- bool b_fir_runtime_support;
- bool b_cust_vol_runtime_support;
- bool b_drc_support;
- bool b_debug;
- bool b_cust_vol_16;
- TNotifyEvent ne_onTermSuccess;
- TNotifyEvent ne_onTermByUser;
- E_AEC_RESULT_T e_result;
- AnsiString as_audcoeff_default_h;
- AnsiString as_volume_gain_file;
- }S_AEC_NM_T;
- //---------------------------------------------------------------------------
- class CAECNM : public TThread
- {
- private:
- // common
- CMETAHANDLE m_META_HANDLE_Obj;
- E_METAAPP_RESULT_T m_eConfirmState;
- HANDLE m_hEvent;
- S_AEC_NM_T* m_psAEC;
- // E_AEC_RESULT_T m_sAECRsult;
- //E_AEC_STEP m_eStep;
- //calresult m_sResultFir;
- //speresult m_sResultSEFir;
- // bool m_bDRCSupport;
- // bool m_bAecNMSupport;
- // FIR
- CSPCOEF m_cSP_COEF_Obj;
- S_FIR_COEFF_T m_sFirCoeff;
- char* m_cpBuf;
- // S_AEC_FIR m_sAECFir;
- S_AEC_SE_FIR_T m_sAecNmFir;
- // volume setting
- CVOLSET m_cVOL_SET_Obj;
- CustAcousticVol_T m_sCustVol;
- CustAcousticVol16lvl_T m_sCustVolEx;
- //int m_iMicGain;
- //int m_iSpkGain;
- //unsigned short m_usUpDigiGain;
- //unsigned short m_usDnDigiGain;
- //unsigned short m_usKTGain[3];
- //spkgain m_sSpkGain;
- //micgain m_sMicGain;
- // INI
- S_AEC_NM_INI_T m_sAecNmIni;
- protected:
- void __fastcall Execute(void);
- public:
- void (*ConfirmCallback)(void);
- __fastcall CAECNM(bool CreateSuspended, S_AEC_NM_T *p_s_aec_nm);
-
- E_METAAPP_RESULT_T REQ_Audio_Tone_Loop_Back_Rec(Audio_Tone_LoopBackRec_Req req);
- // NVRAM
- E_METAAPP_RESULT_T REQ_Read_FIR_From_NVRAM(void);
- void CNF_ReadFirFromNVRAM(void);
- E_METAAPP_RESULT_T REQ_Write_FIR_To_NVRAM(void);
- void CNF_WriteFirToNVRAM(void);
- E_METAAPP_RESULT_T REQ_Read_Volume_Setting_From_NVRAM(void);
- void CNF_ReadVolSettingFromNVRAM(void);
- E_METAAPP_RESULT_T REQ_Write_Volume_Setting_To_NVRAM(void);
- void CNF_WriteVolSettingToNVRAM(void);
- // memory
- void AllocateDynMemory(void);
- void ReleaseDynMemory(void);
- // file
- bool REQ_Read_From_File(char *filename);
- bool REQ_Write_To_Audcoeff_Default(char *filename, E_AUDIO_FIR_VER_T audio_param_type);
- bool REQ_Write_Record_To_File(char *filename);
-
- // global information
- //E_METAAPP_RESULT_T Get_ConfirmState(void);
- //int Get_MicGain(void);
- //int Get_SpkGain(void);
- //E_AEC_RESULT_T Get_Result(void);
- //bool Get_AecNMSupport(void);
- };
- /*---------------------------------------------------------------------------*/
- #endif