📄 gaeci.h
字号:
/*---------------------------------------------------------------------*
* *
* THIS IS AN UNPUBLISHED WORK CONTAINING CONFIDENTIAL AND PROPRIETARY *
* INFORMATION. IF PUBLICATION OCCURS, THE FOLLOWING NOTICE APPLIES: *
* "COPYRIGHT 2003 MICHAEL TSIROULNIKOV, ALL RIGHTS RESERVED" *
* *
*---------------------------------------------------------------------*/
#ifndef _gaeci_h
#define _gaeci_h
#include "stddefs.h"
#include "gaec_miket.h"
#define _DSK_VER (1)
#define _DSK_LIM (0)
/*--------------------- local defs ------------------------------------*/
#ifndef Q15
#define Q15(x) ((S16)(32768.*(x)))
#endif
#define GAEC_FR_SZ (IGAEC_FR_SZ)
/* there is a delay for a frame in each of RxIn/ TxOut devices.
1 frame is compensated by update of the delay line after adaptation */
//#define GAEC_IO_FRAMES (2)
#define GAEC_BANDS (10)
#define GAEC_BLK_SZ (GAEC_BANDS)
#define GAEC_BLKS (IGAEC_FR_SZ/GAEC_BANDS)
#define GAEC_LFCTR (6)
#define GAEC_FBS_SZ (GAEC_BANDS*GAEC_LFCTR)
#define GAEC_FBZ_SZ (GAEC_BANDS*GAEC_LFCTR)
#define GAEC_FBR_SZ (90)
#define GAEC_SBUF_SZ (GAEC_FBS_SZ+GAEC_FR_SZ-GAEC_BLK_SZ)
#define GAEC_RBUF_SZ (GAEC_FBR_SZ+GAEC_FR_SZ-GAEC_BLK_SZ)
#define GAEC_TBUF_SZ (GAEC_SBUF_SZ)
#define GAEC_ERR_SZ (GAEC_LFCTR + GAEC_BLKS - 1)
#define GAEC_SND_SZ (GAEC_BLKS)
#define GAEC_SECTION_SZ (GAEC_BLKS*2) /* corresponds to 10ms */
#define GAEC_ADF_SZ (GAEC_SECTION_SZ*GAEC_MIKET_ETL10MS) /* must be dividable by 8 (->10ms) */
#define GAEC_ADF_BSZ (GAEC_ADF_SZ-1)
#define GAEC_RCV_SZ (GAEC_ADF_BSZ+GAEC_BLKS)
#define GAEC_SECTIONS4 (GAEC_ADF_SZ/GAEC_SECTION_SZ)
#define GAEC_SECTIONS3 (GAEC_SECTIONS4)
#define GAEC_SECTIONS2 (GAEC_SECTIONS4)
#define GAEC_SECTIONSDT (GAEC_ADF_SZ/GAEC_SECTION_SZ)
#define GAEC_OFF2 (0)
#define GAEC_OFF3 (0)
#define GAEC_OFF4 (0)
#define GAEC_DB(x) ((S16)(x*170))
#define GAEC_ADEN (((S32)GAEC_ADF_SZ) << 12)
#define GAEC_ADF_FRS (1+GAEC_ADF_SZ/GAEC_BLKS)
#define GAEC_EPC_MAXD (50)
#define GAEC_EPC_MIND (GAEC_EPC_MAXD/4)
#define GAEC_EPC_SSZ (GAEC_EPC_MAXD)
#define GAEC_EPC_SZ (GAEC_EPC_SSZ + GAEC_FR_SZ/2)
#define GAEC_FLATEN_SZ (8)
#define GAEC_ERLE_MAX (GAEC_DB(40)) /* 1% of distortions */
#define GAEC_NLP_MODE_CLEAR (0)
#define GAEC_NLP_MODE_MODIFY (1)
#define GAEC_NLP_MODE_PASS (2)
// 3db->512=2^9, 512*8=2^12
// common detector defs
#define GAEC_CRIT_MRGN GAEC_DB(20.0)
#define GAEC_CRIT_SHFT (12)
#define GAEC_CRIT_MAX (GAEC_DB(30.0))
#define GAEC_CRIT_MIN (GAEC_DB(-6.0))
// vad specfic definitions
#define GAEC_VAD_CRIT_THR GAEC_DB(3.0)
#define GAEC_VAD_NSE_MAX GAEC_DB(-38.0)
#define GAEC_VAD_NSE_MIN GAEC_DB(-77.0)
#define GAEC_TMP_SZ (GAEC_FBR_SZ/2)
typedef struct GAEC_tDb
{
/* pointers */
S16 *psRcv;
S16 *psAdf;
S16 *psAdfM;
#if !defined(__TMS320C55X__) /* i.e. c54x */
S16 filler;
#endif
// S32 data
S32 slRoutSav;
S32 slSoutSav;
S32 slSepcSav;
S32 aslRkSav1 [6];
S32 aslRkSav2 [6];
S32 aslEn2 [GAEC_BANDS+1];
S32 aslEn3 [GAEC_BANDS+1];
S32 aslEn4 [GAEC_BANDS+1];
S32 aslAdEn [GAEC_BANDS+1];
S32 aslAdEnM [GAEC_BANDS+1];
S32 aslNrPrior [GAEC_BANDS+1];
S32 aslEpcRcv [GAEC_EPC_MAXD];
S32 aslEpcSnd [GAEC_EPC_MAXD];
S16 asEpcRcvIn [GAEC_EPC_SZ];
S16 asEpcSndIn [GAEC_EPC_SZ];
S16 asNrCoef [GAEC_BANDS+1];
S16 asShft [GAEC_BANDS+1];
S16 asTdSav [5];
S16 asRbuf [GAEC_RBUF_SZ];
S16 asSbuf [GAEC_SBUF_SZ];
S16 aasErrSav [GAEC_BANDS*2][GAEC_ERR_SZ];
S16 asTbuf [GAEC_TBUF_SZ];
S16 aasT [GAEC_BANDS*2][GAEC_ERR_SZ];
S16 asExpectedErrEn [GAEC_BANDS+1];
S16 sExpectedErrEn;
S16 asErleAv [GAEC_BANDS+1];
S16 sErleAv;
S16 asErlAv [GAEC_BANDS+1];
S16 sErlAv;
S16 asDtCrit [GAEC_BANDS+1];
S16 sDtCrit;
S16 asErlCrit [GAEC_BANDS+1];
S16 sErlCrit;
S16 asDerle [GAEC_BANDS+1];
S16 asVadErrNse [GAEC_BANDS+1];
S16 sVadErrNse;
S16 asVadErrCrit [GAEC_BANDS+1];
S16 sVadErrCrit;
S16 asVadRinCrit [GAEC_BANDS+1];
S16 sVadRinCrit;
S16 asVadRinNse [GAEC_BANDS+1];
S16 sVadRinNse;
// correction
S16 sRinSav;
S16 sSinSav;
// echo path change
S16 sEpcXcr;
S16 sEpcCrit;
// rcv analysis
S16 sToneCnt;
U16 uIsTone;
S16 asRinEnHst [7];
// adf ctrl
U16 uAdfMode;
S16 sConvAcc;
S16 sConvEnCnt;
// dtd
U16 uIsDT;
// nlp
S16 sNseSav;
// max coef
S16 sMaxCoefBand;
S16 sMaxCoef;
S16 sMaxCoefAv;
// common
U16 uControl;
S16 sVolume;
// Adf Rcv Out energy history
S16 asFlatRoutEnHst [GAEC_FLATEN_SZ];
S16 asRoutEnHst [GAEC_ADF_FRS];
S16 aasRoutEnHst [GAEC_BANDS+1][GAEC_ADF_FRS];
GAEC_MIKET_tStts Stts;
IGAEC_tCfg Cfg;
#if _DSK_LIM
U32 ulLimCnt;
#endif
} GAEC_tDb;
typedef struct {
S32 aslRk [6];
S32 aslRkTx [6];
S32 aslG [6];
S16 asF [6];
S16 asK [6];
S16 asRk [6]; // 54
S16 sJ0;
U16 uIsSingular;
U16 uLow;
U16 uHigh;
U16 uEven;
U16 uEdge; // 6
S16 asTdBuf [GAEC_FR_SZ+5]; // 45 ... that can be hidden, if 16 words are worth it
U16 filler; // add to make size even
} GAEC_tScRcv; // 106
typedef struct {
S32 slSig;
S32 slNse;
S32 slEst;
S16 sSig;
S16 sCoef;
} GAEC_tScNr;
typedef struct {
S16 sTx;
S16 sErrI;
S16 sErrQ;
S16 sDexp;
} GAEC_tScA2;
typedef struct {
S16 sTx;
S16 asErr[GAEC_BLKS];
S16 sDexp;
} GAEC_tScA3;
typedef struct {
S16 sTx;
S16 asErr[GAEC_BLKS*2];
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -