pinebuds/services/multimedia/speech/inc/med_aec3_comm.h

123 lines
4.5 KiB
C
Raw Normal View History

2022-08-15 04:20:27 -05:00
#ifndef _MED_AEC3_COMM_H_
#define _MED_AEC3_COMM_H_
/*****************************************************************************
1 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*****************************************************************************/
#include "codec_typedefine.h"
#include "med_fft.h"
#include "codec_com_codec.h"
#include "med_aec3_main.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif
/*****************************************************************************
2 <EFBFBD><EFBFBD><EFBFBD>
*****************************************************************************/
/* FFT IFFT<46>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD> */
typedef VOS_VOID (*MED_AEC_FFT_CALLBACK)(VOS_INT16 *, VOS_INT16 *);
#ifdef AEC_ONLY_SUPPORT_8k
#ifdef SPEECH_STREAM_UNIT_128
#define MED_AEC_FFT_LEN_NB (256)
#else
#define MED_AEC_FFT_LEN_NB (240)
#endif
#define MED_AEC_MAX_FFT_LEN (MED_AEC_FFT_LEN_NB) /* <20><><EFBFBD><EFBFBD>FFT<46><54><EFBFBD><EFBFBD> */
#else
#ifdef SPEECH_STREAM_UNIT_128
#define MED_AEC_FFT_LEN_NB (256)
#define MED_AEC_FFT_LEN_WB (512)
#else
#define MED_AEC_FFT_LEN_NB (240)
#define MED_AEC_FFT_LEN_WB (480)
#endif
#define MED_AEC_MAX_FFT_LEN (MED_AEC_FFT_LEN_WB) /* <20><><EFBFBD><EFBFBD>FFT<46><54><EFBFBD><EFBFBD> */
#endif
#define MED_AEC_HF_AF_M (6)
/* <20><>ʱȫ<CAB1><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E9A3AC>AEC<45><43>ģ<EFBFBD><C4A3>ʹ<EFBFBD><CAB9> */
//extern VOS_INT16 g_ashwMedAecTmp1Len640[MED_AEC_MAX_FFT_LEN];
//extern VOS_INT16 g_ashwMedAecTmp2Len640[MED_AEC_MAX_FFT_LEN];
//extern VOS_INT32 g_aswMedAecTmp1Len320[CODEC_FRAME_LENGTH_WB];
//extern VOS_INT32 g_aswMedAecTmp1Len640[MED_AEC_MAX_FFT_LEN];
/* AEC <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EAB6A8>*/
//#define MED_AEC_GetshwVecTmp640Ptr1() (&g_ashwMedAecTmp1Len640[0]) /* <20><>ʱȫ<CAB1><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8> <20><><EFBFBD><EFBFBD>640 INT16 */
//#define MED_AEC_GetshwVecTmp640Ptr2() (&g_ashwMedAecTmp2Len640[0]) /* <20><>ʱȫ<CAB1><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8> <20><><EFBFBD><EFBFBD>640 INT16 */
//#define MED_AEC_GetswVecTmp320Ptr1() (&g_aswMedAecTmp1Len320[0]) /* <20><>ʱȫ<CAB1><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8> <20><><EFBFBD><EFBFBD>320 INT32 */
//#define MED_AEC_GetswVecTmp640Ptr1() (&g_aswMedAecTmp1Len640[0]) /* <20><>ʱȫ<CAB1><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8> <20><><EFBFBD><EFBFBD>640 INT32 */
#define MED_AEC_OFFSET_THD (60) /* <20>ӳٲ<D3B3><D9B2><EFBFBD><EFBFBD><EFBFBD>ֵ */
#define MED_AEC_MAX_OFFSET (960) /* <20><><EFBFBD>󲹳<EFBFBD><F3B2B9B3><EFBFBD><EFBFBD>ȣ<EFBFBD><C8A3><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Q0*/
#define MED_AEC_MAX_TAIL_LEN (960) /* <20><><EFBFBD><EFBFBD>β<EFBFBD>˳<EFBFBD><CBB3>ȣ<EFBFBD><C8A3><EFBFBD>λms<6D><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>60msβ<73><CEB2><EFBFBD>ӳ<EFBFBD> Q0*/
/*****************************************************************************
3 ö<EFBFBD>ٶ<EFBFBD><EFBFBD><EFBFBD>
*****************************************************************************/
/* AF FFT<46><54><EFBFBD><EFBFBD> */
enum MED_AEC_AF_FFT_LEN_ENUM
{
#ifdef SPEECH_STREAM_UNIT_128
MED_AEC_AF_FFT_LEN_NB = 256, /* խ<><D5AD>FFT<46><54><EFBFBD><EFBFBD> */
MED_AEC_AF_FFT_LEN_WB = 512, /* <20><><EFBFBD><EFBFBD>FFT<46><54><EFBFBD><EFBFBD> */
#else
MED_AEC_AF_FFT_LEN_NB = 240, /* խ<><D5AD>FFT<46><54><EFBFBD><EFBFBD> */
MED_AEC_AF_FFT_LEN_WB = 480, /* <20><><EFBFBD><EFBFBD>FFT<46><54><EFBFBD><EFBFBD> */
#endif
MED_AEC_AF_FFT_LEN_BUTT
};
typedef VOS_INT16 MED_AEC_AF_FFT_LEN_ENUM_INT16;
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD><C3B6> */
enum CODEC_SWITCH_ENUM
{
CODEC_SWITCH_OFF = 0,
CODEC_SWITCH_ON,
CODEC_SWITCH_BUTT
};
typedef VOS_UINT16 CODEC_SWITCH_ENUM_UINT16;
/*****************************************************************************
4 ȫ<EFBFBD>ֱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*****************************************************************************/
/*****************************************************************************
5 STRUCT<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*****************************************************************************/
/*****************************************************************************
6 UNION<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*****************************************************************************/
/*****************************************************************************
7 OTHERS<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*****************************************************************************/
/*****************************************************************************
8 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*****************************************************************************/
#ifdef DEBUG_AEC
static VOS_VOID fprint_vec_int32(FILE *fd, VOS_INT32 *buf, VOS_INT32 len)
{
for (VOS_INT32 i = 0; i < len - 1; i++) {
fprintf(fd, "%d ", buf[i]);
}
fprintf(fd, "%d\n", buf[len - 1]);
}
#endif
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#endif /* end of med_aec_main.h*/