⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gaeci.h55

📁 TI公司DSP/tms320c55x/tms320c54x系列的声学回声消除代码
💻 H55
字号:
*---------------------------------------------------------------------*
*                                                                     *
* THIS IS AN UNPUBLISHED WORK CONTAINING CONFIDENTIAL AND PROPRIETARY *
* INFORMATION.  IF PUBLICATION OCCURS, THE FOLLOWING NOTICE APPLIES:  *
*     "COPYRIGHT 2003 MICHAEL TSIROULNIKOV, ALL RIGHTS RESERVED"      *
*                                                                     *
*---------------------------------------------------------------------*/

*--------------------- local defs ------------------------------------*/

GAEC_MIKET_ETL10MS			.set (25)
IGAEC_FR_SZ          		.set (40)

IGAEC_CMD_RESET             .set (0x0001)
IGAEC_CMD_PRESERVE_FLT      .set (0x0002)
IGAEC_CMD_VOLUME           	.set (0x0004)
IGAEC_CMD_CFG               .set (0x0008)

IGAEC_CMD_ALL_OFF           .set (0x0010)
IGAEC_CMD_ADAPT_OFF         .set (0x0020)
IGAEC_CMD_CNL_OFF         	.set (0x0040)
IGAEC_CMD_RCV_NSE_OFF       .set (0x0080)
IGAEC_CMD_NLP_OFF           .set (0x0100)
IGAEC_CMD_NSE_RED_OFF       .set (0x0200)

IGAEC_CMD_SND_MUTED        	.set (0x1000)
IGAEC_CMD_LOOPBACK       	.set (0x2000)
IGAEC_CMD_TONE       		.set (0x4000)

IGAEC_tCfg 					.struct
sErlMin						.int
sDtThr						.int
sRcvDistThr					.int
sTCLst						.int
sTCLdt						.int
sWhiteThr					.int
IGAEC_tCfg_Sz				.endstruct

GAEC_MIKET_tStts 			.struct
sRcvNoise					.int
sSndNoise					.int
sRcvAtt						.int
sSndAtt						.int
sErl						.int
sErle						.int
sMaxCoef					.int
sWorstErl					.int

GAEC_MIKET_tStts_Sz			.endstruct

GAEC_FR_SZ          		.set (IGAEC_FR_SZ)
GAEC_BANDS          		.set (10)
GAEC_BLK_SZ         		.set (GAEC_BANDS)
GAEC_BLKS           		.set (IGAEC_FR_SZ/GAEC_BANDS)
GAEC_LFCTR          		.set (6)

GAEC_FBS_SZ         		.set (GAEC_BANDS*GAEC_LFCTR)
GAEC_FBZ_SZ         		.set (GAEC_BANDS*GAEC_LFCTR)
GAEC_FBR_SZ         		.set (90)

GAEC_SBUF_SZ        		.set (GAEC_FBS_SZ+GAEC_FR_SZ-GAEC_BLK_SZ)
GAEC_RBUF_SZ        		.set (GAEC_FBR_SZ+GAEC_FR_SZ-GAEC_BLK_SZ)
GAEC_TBUF_SZ        		.set (GAEC_SBUF_SZ)

GAEC_ERR_SZ         		.set (GAEC_LFCTR + GAEC_BLKS - 1)
GAEC_SND_SZ         		.set (GAEC_BLKS)

GAEC_SECTION_SZ     		.set (GAEC_BLKS*2)
GAEC_ADF_SZ         		.set (GAEC_SECTION_SZ*GAEC_MIKET_ETL10MS)
GAEC_ADF_BSZ        		.set (GAEC_ADF_SZ-1) 
GAEC_RCV_SZ         		.set (GAEC_ADF_BSZ+GAEC_BLKS)

GAEC_SECTIONS4      		.set (GAEC_ADF_SZ/GAEC_SECTION_SZ)
GAEC_SECTIONS3      		.set (GAEC_SECTIONS4)
GAEC_SECTIONS2      		.set (GAEC_SECTIONS4)
GAEC_SECTIONSDT     		.set (GAEC_ADF_SZ/GAEC_SECTION_SZ)
GAEC_OFF2           		.set (0)
GAEC_OFF3           		.set (0)
GAEC_OFF4           		.set (0)

GAEC_1DB		          	.set 170

GAEC_ADEN           		.set (GAEC_ADF_SZ*4096)
GAEC_ADEN_BASE				.set (GAEC_ADF_SZ)
GAEC_ADEN_SHFT				.set (12)
GAEC_ADF_FRS        		.set (1+GAEC_ADF_SZ/GAEC_BLKS)

GAEC_EPC_MAXD       		.set (50)
GAEC_EPC_MIND       		.set (GAEC_EPC_MAXD/4)
GAEC_EPC_SSZ        		.set (GAEC_EPC_MAXD)
GAEC_EPC_SZ         		.set (GAEC_EPC_SSZ + GAEC_FR_SZ/2)
GAEC_FLATEN_SZ				.set (8)
GAEC_ERLE_MAX				.set (GAEC_1DB*40) 

                            
GAEC_NLP_MODE_CLEAR 		.set (0)
GAEC_NLP_MODE_MODIFY 		.set (1)
GAEC_NLP_MODE_PASS  		.set (2)

GAEC_CRIT_MRGN      		.set (GAEC_1DB*20)
GAEC_CRIT_SHFT      		.set (12)
GAEC_CRIT_MAX       		.set (GAEC_1DB*30)
GAEC_CRIT_MIN       		.set (GAEC_1DB*(-6))

GAEC_VAD_CRIT_THR       	.set (GAEC_1DB*3)
GAEC_VAD_NSE_MAX        	.set (GAEC_1DB*(-38))
GAEC_VAD_NSE_MIN        	.set (GAEC_1DB*(-77))

GAEC_TMP_SZ					.set (GAEC_FBR_SZ/2)

GAEC_tDb					.struct

psRcv						.long
psAdf						.long
psAdfM						.long

; S32 data
slRoutSav					.long
slSoutSav					.long
slSepcSav					.long

aslRkSav1       			.long 6
aslRkSav2       			.long 6
aslEn2          			.long GAEC_BANDS+1
aslEn3          			.long GAEC_BANDS+1
aslEn4          			.long GAEC_BANDS+1
aslAdEn         			.long GAEC_BANDS+1
aslAdEnM         			.long GAEC_BANDS+1
aslNrPrior         			.long GAEC_BANDS+1

aslEpcRcv       			.long GAEC_EPC_MAXD
aslEpcSnd       			.long GAEC_EPC_MAXD
asEpcRcvIn      			.int GAEC_EPC_SZ
asEpcSndIn      			.int GAEC_EPC_SZ

asNrCoef					.int GAEC_BANDS+1
asShft						.int GAEC_BANDS+1

; S16 data
asTdSav         			.int 5
asRbuf          			.int GAEC_RBUF_SZ
asSbuf          			.int GAEC_SBUF_SZ
aasErrSav       			.int (GAEC_BANDS*2)*GAEC_ERR_SZ

asTbuf          			.int GAEC_TBUF_SZ
aasT           				.int (GAEC_BANDS*2)*GAEC_ERR_SZ

asExpectedErrEn 			.int GAEC_BANDS+1
sExpectedErrEn				.int
asErleAv        			.int GAEC_BANDS+1
sErleAv						.int
asErlAv         			.int GAEC_BANDS+1
sErlAv						.int
asDtCrit        			.int GAEC_BANDS+1
sDtCrit						.int
asErlCrit       			.int GAEC_BANDS+1
sErlCrit					.int 
asDerle      				.int GAEC_BANDS+1

asVadErrNse      			.int GAEC_BANDS+1
sVadErrNse					.int 
asVadErrCrit     			.int GAEC_BANDS+1
sVadErrCrit					.int 

asVadRinCrit     			.int GAEC_BANDS+1
sVadRinCrit     			.int 
asVadRinNse      			.int GAEC_BANDS+1
sVadRinNse      			.int 
    
; correction
sRinSav						.int
sSinSav						.int

sEpcXcr						.int
sEpcCrit					.int

;// rcv analysis
sToneCnt					.int
uIsTone						.int 
asRcvEnHst      			.int 7;

; adf ctrl
uAdfMode					.int
sConvAcc					.int
sConvEnCnt					.int

;// dtd
uIsDT						.int

;// nlp
sNseSav						.int

sMaxCoefBand				.int
sMaxCoef					.int
sMaxCoefAv					.int

;// common
uControl					.int
sVolume						.int 

;// Adf energy history
asFlatRoutEnHst				.int GAEC_FLATEN_SZ
asRoutEnHst     			.int GAEC_ADF_FRS;
aasRoutEnHst    			.int (GAEC_BANDS+1) *GAEC_ADF_FRS;

Stts						.tag GAEC_MIKET_tStts
Cfg  						.tag IGAEC_tCfg;


GAEC_tDb_Sz					.endstruct

GAEC_tScRcv					.struct
;
;S32 data
aslRk		    			.long 6
aslRkTx		    			.long 6
aslG            			.long 6

;S16 data
asF             			.int 6
asK             			.int 6
asRk		    			.int 6

sJ0							.int
uIsSingular					.int 
uLow						.int
uHigh						.int
uEven						.int
uEdge						.int

asTdBuf						.int GAEC_FR_SZ+5
filler						.int
GAEC_tScRcv_Sz				.endstruct

GAEC_tScNr					.struct
slSig						.long
slNse						.long
slEst						.long
sSig						.int
sCoef						.int
GAEC_tScNr_Sz				.endstruct

GAEC_tScA2					.struct
sTx							.int
sErrI						.int
sErrQ						.int
sDexp						.int
GAEC_tScA2_Sz				.endstruct

GAEC_tScA3					.struct
sTx							.int
asErr						.int GAEC_BLKS
sDexp						.int
GAEC_tScA3_Sz				.endstruct

GAEC_tScA4					.struct
sTx							.int
asErr						.int GAEC_BLKS*2
sDexp						.int
GAEC_tScA4_Sz				.endstruct

;// epc analysis
GAEC_tScEpc					.struct 
asEpcRcv        			.int GAEC_EPC_MAXD
asEpcSnd        			.int GAEC_EPC_MAXD
sEpcRcv						.int
sEpcSnd						.int
sEpcXcr						.int
GAEC_tScEpc_Sz				.endstruct

GAEC_tSc					.struct
u							.union
Rcv							.tag GAEC_tScRcv
aNr							.tag GAEC_tScNr, (GAEC_BANDS+1)							
aA2							.tag GAEC_tScA2, (GAEC_BANDS-1)							
aA3							.tag GAEC_tScA3, (GAEC_BANDS-1)							
aA4							.tag GAEC_tScA4, (GAEC_BANDS-1)							
asTmp						.int GAEC_TMP_SZ
Epc							.tag GAEC_tScEpc
							.endunion

aasErr0         			.int GAEC_BANDS*2*GAEC_ERR_SZ;
aasSin          			.int GAEC_BANDS*2*GAEC_BLKS;
aasErr          			.int GAEC_BANDS*2*GAEC_BLKS;
aasErrM          			.int GAEC_BANDS*2*GAEC_BLKS;

asRinEn         			.int GAEC_BANDS+1
sRinEn						.int;
asRoutEn         			.int GAEC_BANDS+1
sRoutEn						.int;
asSinEn         			.int GAEC_BANDS+1
sSinEn						.int;
asErrEn         			.int GAEC_BANDS+1
sErrEn						.int;
asErrMEn         			.int GAEC_BANDS+1
asErle          			.int GAEC_BANDS+1
sErle						.int;
asErl           			.int GAEC_BANDS+1
sErl						.int;
asSSC           			.int GAEC_BANDS+1
asAttRin         			.int GAEC_BANDS+1
asAttErr         			.int GAEC_BANDS+1

sErleMax					.int;
sMaxCoef					.int;
uAdapt						.int;
uNlpMode					.int;

GAEC_tSc_Sz					.endstruct;


*--------------------- public vars- ----------------------------------*/
	.global _GAEC_aasFBR
	.global _GAEC_aasFBS
	.global _GAEC_aasFBZ
	.global _GAEC_aasFBX
	
;--------------------- asm level functions ---------------------------

m_en2log	.macro	acx, tx
	acx = acx + #1;
    acx = mant (acx), tx = -exp(acx); || nop
    acx = acx << #-21;
    acx = acx + #(0x780-1024 - 6*170)
    acx = acx + (tx*#512);
    .endm

	.global	_gaec_adapt_pre



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -