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

📄 test.dsp

📁 基于ADSP的G.729语音编解码程序
💻 DSP
字号:
#define        stream_port   0x201		// compressed data
#define        speech_port   0x200		// uncompressed data
#define        FRAME_SNUM    2000

/******************************************************************
* main control program to test calc_cw code and verify cw result **
* NOTICE: some multifunction instruction may create warnings     **
*         when you assemble it, but it is no harm to your        **
*         program. So you do better verify on Emulation!!!!!     **
* See created map file and verify the pm and dm data size required*
* Author:  Jason wang(zhigang wang)                              ** 
* Email:   wzg119@yeah.net   ,BP : +8602195950-161452            **
*******************************************************************/
//.MODULE/SEG=App_PM/ABS=0x0000        test_main;
.MODULE/SEG=START_PM        test_main;

/*******************************************************************/
#include       "def2181.inc"
#include       "Dtx.inc"

/*******************************************************************/
.VAR/DM/RAM/SEG=App_DMbuf    count_frame,flag_cod,Enc_Frame;

/*******************************************************************/
.GLOBAL        flag_cod,Enc_Frame;

.EXTERNAL      Vad_Enable;
.EXTERNAL      Init_encoder;
.EXTERNAL      Init_decoder;
.EXTERNAL      encode_frame;
.EXTERNAL      decode_seag;
.EXTERNAL      out_speech;
.EXTERNAL      flush_speech;
.EXTERNAL      read_seag;
!*******************************************************************
START_TEST:    
			   CALL setup_system;
               AR=1;        { 0 to control encoder and 1 decoder}
			   AR=PASS AR;
			   IF EQ JUMP test_encoder;
               NOP;
test_decoder:  AR=FLAG_DEC;
			   DM(flag_cod)=AR;
			   CALL Init_decoder;
			   AR=PASS 0;
               DM(count_frame)=AR;    
    {----------Loop for each "L_FRAME" speech data---------}
decode_next:   CALL read_seag;   
			   CALL decode_seag;
			   AY0=FRAME_SNUM;
			   AR=DM(count_frame);
			   AR=AR+8;
			   NONE=AR-AY0;
			   DM(count_frame)=AR;
			   IF NE JUMP decode_next;
			   NOP;
			   NOP;
               JUMP stop_here;

test_encoder:  AR=FLAG_COD;
			   DM(flag_cod)=AR;
               CALL Init_encoder;
			   AR=PASS 0;
               DM(count_frame)=AR;
			   AR=PASS 0;
			   DM(Vad_Enable)=AR;
 encode_next:  AR=DM(count_frame);
 			   AR=AR+1;
			   DM(count_frame)=AR;
               CALL encode_frame;
               
               DIS INTS; 
               ar=0x1111;
               io(0x555)=ar;
               IDLE;
               nop;
               
			   AR=DM(count_frame);
               CALL out_speech;
			   AY0=FRAME_SNUM;
               AX0=DM(count_frame);
			   NONE=AX0-AY0;
			   IF NE JUMP encode_next;
			   AR=DM(count_frame);
			   CALL flush_speech;
			   NOP;
			   NOP;
stop_here:	   JUMP stop_here;

/*******************************************************************/
setup_system:  L0=0; L1=0; 
			   L2=0; L3=0;
			   L4=0; L5=0;
			   L6=0; L7=0;
			   AR=PASS 0;
			   AR=SETBIT 12 Of AR;
			   DM(Sport0_Autobuf_Ctrl)=AR;		   
  			   DIS BIT_REV,DIS AV_LATCH,ENA AR_SAT,DIS M_MODE,ENA G_MODE;
			   M0=0; M1=1; 
			   M4=1; M2=-1; M7=-1;

			   RTS;
/*******************************************************************/
.ENDMOD;	
		

⌨️ 快捷键说明

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