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

📄 tableld.dsp

📁 基于ADSP的G.729语音编解码程序
💻 DSP
字号:
/*************************************************************************/
/* This file contains all the tables used by the G.729A codec			 */
/* $$01/10/2000 rejustified the tables used in audio codec				 */
/* $$01/11/2000 move table from dm area to pm area						 */
/* $$01/16/2001 modified and printed,Author: Jason.wang (zhigang wang)   */
/* $$01/16/2001 Email: wzg119@yeah.net,  BP: 86+02195950-161452          */
/* $$01/16/2001 This modlue is not optimized! should be test on Emulator */
/*************************************************************************/
.MODULE/SEG=App_PM        Tab_ld8a;

/*************************************************************************/
#include	   "ld8a.inc"

/*************************************************************************/
.GLOBAL        table,slope,table2;
.GLOBAL        inter_3l,pred,coef;
.GLOBAL        a100,b100,a140,b140;
.GLOBAL        slope_cos,slope_acos;
.GLOBAL        thr1,thr2,imap1,imap2;
.GLOBAL        map1,map2,coefhi,coeflo;
.GLOBAL        lspcb1,lspcb2,gbk11,gbk12;
.GLOBAL        gbk21,gbk22,bitsno,bitsno2;
.GLOBAL        grid,fg,fg_sum,lag_h,lag_l;
.GLOBAL        tabpow,tablog,tabsqr,tab_zone; 
.GLOBAL        hamwindow,fg_sum_inv,freq_prev_reset;

/*------------------------------------------------------------*/
/* Hamming_cos window for LPC analysis.                       */
/* Create with function ham_cos(window,200,40)                */
/*------------------------------------------------------------*/
.VAR/PM/RAM/SEG=Tab_PM    hamwindow[L_WINDOW] ;
.INIT24          hamwindow: <haming.dat>;

/*-----------------------------------------------------------*/
/* Table of lag_window for autocorrelation.                  */
/* noise floor = 1.0001   = (0.9999  on r[1] ..r[10])        */
/* Bandwidth expansion = 60 Hz                               */
/* Special double precision format. See "oper_32b.c"         */
/*-----------------------------------------------------------*/
.VAR/PM/RAM/SEG=Tab_PM    lag_h[M+2] ;
.INIT24          lag_h:    
    H#7FD800, H#7F6B00, H#7EB600, H#7DBB00, H#7C7B00, H#7AF800,
	H#793500, H#773500, H#74FA00, H#728900, H#6FE500, H#6D1300;

.VAR/PM/RAM/SEG=Tab_PM    lag_l[M+2] ;
.INIT24          lag_l:
    H#2E8000, H#438000, H#780000, H#650000, H#5E8000, H#714000,
    H#5F4000, H#1CC000, H#4C4000, H#39C000, H#564C00, H#327C00;

/*------------------------------------------------------------*/
/* Tables for function Lsf_lsp() and Lsp_lsf()                */
/* table of cos(x) in Q15                                     */
/*------------------------------------------------------------*/
.VAR/PM/RAM/SEG=Tab_PM    table[65] ;
.INIT24          table: <table.dat>;

/* slope in Q12 used to compute y = acos(x) */
.VAR/PM/RAM/SEG=Tab_PM    slope[64] ;
.INIT24          slope: <slope.dat>;

/*------------------------------------------------------------*/
/* Tables for function Lsf_lsp() and Lsp_lsf()                */
/* table of cos(x) in Q15                                     */
/*------------------------------------------------------------*/
.VAR/PM/RAM/SEG=Tab_PM    table2[64] ;
.INIT24          table2: <cos64.dat>;

/* slope in Q19 used to compute y = cos(x) */
.VAR/PM/RAM/SEG=Tab_PM    slope_cos[64] ;
.INIT24          slope_cos: <cos.dat>;

/* slope in Q12 used to compute y = acos(x) */
.VAR/PM/RAM/SEG=Tab_PM    slope_acos[64] ;
.INIT24          slope_acos: <acos.dat>;

/*------------------------------------------------------------*/
/* Table for routine Pow2().                                  */
/*------------------------------------------------------------*/
.VAR/PM/RAM/SEG=Tab_PM    tabpow[33];
.INIT24          tabpow: <pow.dat>;

/*------------------------------------------------------------*/
/* Table for routine Log2().                                  */
/*------------------------------------------------------------*/
.VAR/PM/RAM/SEG=Tab_PM    tablog[33];
.INIT24          tablog: <log.dat>;

/*------------------------------------------------------------*/
/* Table for routine Inv_sqrt().                              */
/*------------------------------------------------------------*/
.VAR/PM/RAM/SEG=Tab_PM    tabsqr[49];
.INIT24          tabsqr: <sqrt.dat>;

/*------------------------------------------------------------*/
/* Table for taming procedure test_err.                       */
/*------------------------------------------------------------*/
.VAR/PM/RAM/SEG=Tab_PM    tab_zone[PIT_MAX+L_INTERPOL-1];
.INIT24          tab_zone: <zone.dat>;

/*------------------------------------------------------------*/
/* lsp    code book   <../f7s55m1.v2>                         */
/*------------------------------------------------------------*/
.VAR/PM/RAM/SEG=Tab_PM    lspcb1[NC0*M];         /* Q13 */
.INIT24          lspcb1: <lspcb1.dat>;

.VAR/PM/RAM/SEG=Tab_PM    lspcb2[NC1*M];         /* Q13 */
.INIT24          lspcb2: <lspcb2.dat>;

/*------------------------------------------------------------*/
/* Table for code book search                                 */   
/*------------------------------------------------------------*/
.VAR/PM/RAM/SEG=Tab_PM    fg[2*MA_NP*M];        /* Q15 */
.INIT24          fg: <fg.dat>;

.VAR/PM/RAM/SEG=Tab_PM    fg_sum[2*M];       /* Q15 */
.INIT24          fg_sum:
               H#1E7600, H#20FF00, H#200D00, H#206500, H#1FBE00, 
               H#211D00, H#20FF00, H#21FF00, H#235300, H#219C00, 
               H#38F900, H#479D00, H#4D3C00, H#43C000, H#402A00, 
               H#404B00, H#3B3300, H#3B7400, H#3EAB00, H#3D5C00;

.VAR/PM/RAM/SEG=Tab_PM    fg_sum_inv[2*M];       /* Q12 */
.INIT24          fg_sum_inv:
			   H#433A00, H#3E1000, H#3FE500, H#3F3700, H#408400,
			   H#3DD900, H#3E1000, H#3C3D00, H#39F800, H#3CED00,
			   H#23F200, H#1C9800, H#1A8400, H#1E3A00, H#1FEA00,
			   H#1FDA00, H#229800, H#227200, H#20AE00, H#216000;

/*------------------------------------------------------------*/
/*  Table for az_lsf()                                        */
/*  Vector grid[] is in Q15                                   */
/*------------------------------------------------------------*/
.VAR/PM/RAM/SEG=Tab_PM    grid[GRID_POINTS+1];
.INIT24         grid: <grid.dat>;

.VAR/PM/RAM/SEG=Tab_PM    freq_prev_reset[M];  /* Q13 */
.INIT24          freq_prev_reset:     /* PI*(float)(j+1)/(float)(M+1) */
			   H#092300, H#124700, H#1B6A00, H#248E00, H#2DB200,
			   H#36D500, H#3FF900, H#491D00, H#524000, H#5B6400;

/*------------------------------------------------------------*/
/* Tables for pitch related routines .                        */
/* 1/3 resolution interpolation filter  (-3 dB at 3600 Hz)    */
/*------------------------------------------------------------*/
.VAR/PM/RAM/SEG=Tab_PM    inter_3l[FIR_SIZE_SYN] ;
.INIT24          inter_3l:
			   H#730300, H#627700, H#396D00, H#0C4700, H#EECE00,
			   H#E92600, H#F52100, H#04BB00, H#0C3A00, H#08D300,
		       H#000000, H#F98C00, H#F97E00, H#FE3000, H#02F400,
			   H#044B00, H#022600, H#FF0B00, H#FD8600, H#FE3D00,
			   H#000000, H#013400, H#012800, H#004E00, H#FF8800,
			   H#FF5B00, H#FFB100, H#002200, H#005B00, H#004600, 
			   H#000000;
   
/*------------------------------------------------------------*/
/* Tables for gain related routines .                         */
/* MA gain prediction coeff =0.68, 0.58, 0.34, 0.19 in Q13    */
/*------------------------------------------------------------*/
.VAR/PM/RAM/SEG=Tab_PM    pred[4];
.INIT24          pred:  H#15C300, H#128F00, H#0AE100, H#061400;

/* Q14      Q13 */
.VAR/PM/RAM/SEG=Tab_PM    gbk11[NCODE1] ;
.INIT24          gbk11:
			   H#000100, H#060F00, H#072700, H#003900, 
			   H#078100, H#0CAA00, H#016400, H#0A7600;

/* Q14      Q13 */
.VAR/PM/RAM/SEG=Tab_PM    gbk12[NCODE1] ;
.INIT24          gbk12:
               H#05EC00, H#097900, H#139E00, H#151C00, 
			   H#244B00, H#26DD00, H#39A400, H#6A1A00;

.VAR/PM/RAM/SEG=Tab_PM    gbk21[NCODE2] ;
.INIT24          gbk21:
			   H#033A00, H#07CA00, H#141600, H#181000, 
			   H#1F9B00, H#23A000, H#294D00, H#2D3100, 
			   H#33CC00, H#377200, H#3B1C00, H#3B3900, 
			   H#3C4A00, H#3EF000, H#439300, H#4A1D00;

/* Q14       Q13 */
.VAR/PM/RAM/SEG=Tab_PM    gbk22[NCODE2] ;
.INIT24         gbk22:
			   H#07D500, H#000000, H#025000, H#095B00,
			   H#12FD00, H#020D00, H#0B9600, H#04AC00,
			   H#0CB800, H#065E00, H#133200, H#37C400,
			   H#00ED00, H#0D4000, H#074500, H#172F00;

.VAR/PM/RAM/SEG=Tab_PM    map1[NCODE1];
.INIT24          map1: 0x0500, 0x0100, 0x0400, 0x0700, 0x0300, 0x0000, 0x0600, 0x0200;

.VAR/PM/RAM/SEG=Tab_PM    map2[NCODE2] ;
.INIT24         map2: 0x0400, 0x0600, 0x0000, 0x0200, 0x0c00, 0x0e00, 0x0800, 0x0a00,
                     0x0f00, 0x0b00, 0x0900, 0x0d00, 0x0700, 0x0300, 0x0100, 0x0500;

/*  [0][0]      [0][1]       [1][0]     [1][1]    */
/*  Q10         Q14          Q16        Q19       */
.VAR/PM/RAM/SEG=Tab_PM    coef[2*2];
.INIT24          coef: H#7C8900, H#673000, H#7B3C00, H#6CA800;

/*  [0][0]      [0][1]       [1][0]     [1][1]    */
/*  Q26         Q30          Q32        Q35       */
.VAR/PM/RAM/SEG=Tab_PM    coefhi[2*2];
.INIT24          coefhi: H#7C8900, H#673000, H#7B3C00, H#6CA800;

.VAR/PM/RAM/SEG=Tab_PM    coeflo[2*2];
.INIT24          coeflo: H#CE0000, H#488000, H#4F2000, H#9FC000;

.VAR/PM/RAM/SEG=Tab_PM    thr1[NCODE1-NCAN1];   /* Q14 */
.INIT24          thr1: H#2A3800, H#305600, H#4D4200, H#7F3700;

.VAR/PM/RAM/SEG=Tab_PM    thr2[NCODE2-NCAN2];   /* Q15 */
.INIT24          thr2: H#370700, H#3F3C00, H#4F3200, H#534900,
					 H#5BE500, H#629000, H#6CE100, H#774E00;

.VAR/PM/RAM/SEG=Tab_PM    imap1[NCODE1];
.INIT24          imap1: H#0500, H#0100, H#0700, H#0400, H#0200, H#0000, H#0600, H#0300;

.VAR/PM/RAM/SEG=Tab_PM    imap2[NCODE2];
.INIT24          imap2: H#0200, H#0e00, H#0300, H#0d00, H#0000, H#0f00, H#0100, H#0c00, 
                      H#0600, H#0a00, H#0700, H#0900, H#0400, H#0b00, H#0500, H#0800;
/*------------------------------------------------------------*/
/* Tables for routines post_pro() & pre_proc().               */
/* filter coefficients (fc = 100 Hz)                          */
/*------------------------------------------------------------*/
.VAR/PM/RAM/SEG=Tab_PM    b100[3];
.INIT24         b100: H#1E1300, H#C3DA00, H#1E1300;    /* Q13 */
.VAR/PM/RAM/SEG=Tab_PM    a100[2];
.INIT24          a100: H#3DDC00, H#E20D00;              /* Q13 */
/* filter coefficients (fc = 140 Hz, coeff. b[] is divided by 2) */
.VAR/PM/RAM/SEG=Tab_PM    b140[3];
.INIT24          b140: H#076B00, H#F12A00, H#076B00; /* 1/2 in Q12 */
.VAR/PM/RAM/SEG=Tab_PM    a140[2];
.INIT24          a140: H#1E7F00, H#F16B00;           /* Q12 */
/*------------------------------------------------------------*/
/* Tables for routine bits().                                 */
/*------------------------------------------------------------*/
.VAR/PM/RAM/SEG=Tab_PM    bitsno[PRM_SIZE];
.INIT24          bitsno:
					  H#0800,       /* MA + 1st stage   */
                      H#0A00,       /* 2nd stage        */
  H#0800, H#0100, H#0D00, H#0400, H#0700, /* first subframe   */
  H#0500, H#0D00, H#0400, H#0700;         /* second subframe  */

.VAR/PM/RAM/SEG=Tab_PM    bitsno2[4];
.INIT24          bitsno2:
                     H#0100,   /* SID Lsp : MA  */
                     H#0500,   /* SID Lsp : 1st stage */
                     H#0400,   /* SID Lsp : 2nd stage */
                     H#0500 ;  /* SID gain */
/**************************************************************************/
.ENDMOD;

⌨️ 快捷键说明

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