www.pudn.com > g729Decoder.rar > LSP_LPC.asm


;========================================================================== 
;  File Name 
;  ---------- 
;  LSP_INTP.ASM 
; 
;  Brief Description of the Code: 
;  ------------------------------ 
;  Compute the LPC coefficients from lsp (order=10) 
; 
;  Ref 
;  ------ 
;  LPCFUNC.C 
;========================================================================== 
; Procedure Lsp_Az: 
;           ~~~~~~ 
; Compute the LPC coefficients from lsp (order=10) 
;--------------------------------------------------------------------- 
;  Lsp_Az 
;--------------------------------------------------------------------- 
;  void Lsp_Az( 
;    Word16 lsp[],    /* (i) Q15 : line spectral frequencies            */ 
;    Word16 a[]       /* (o) Q12 : predictor coefficients (order = 10)  */ 
;  ) 
;--------------------------------------------------------------------- 
;               C code          Asm code 
;               ------          -------- 
;               a[0] = 1        skip 
;               a[1]       =    a[0] 
;               a[2]       =    a[1] 
;                 :        :      : 
;               a[10]      =    a[9] 
;--------------------------------------------------------------------- 
;  Pointers  : ptr_Az -> a 
;              ptr_lsp_coef -> lsp 
; 
;  Modified Registers: AR2, AR3, AR4, AR5 
; 
;  Note : No saturate and rounding 
;--------------------------------------------------------------------- 
		.mmregs 
        .include ..\include\const.h 
        .include ..\include\ld8amem.h 
 
        .text 
        .def     lsp_lpc 
         
        .ref     Get_lsp_pol 
 
        .asg     "AR2", pf1 
        .asg     "AR3", pf2 
        .asg     "AR4", pLpcCoef1 
        .asg     "AR5", pLpcCoef2 
 
        .asg     "Addr_local_buf1", f1 
        .asg     "Addr_local_buf1+16", f2 
        .asg     "ptr_lsp_coef", pLsp 
        .asg     "ptr_Az", pAz 
 
lsp_lpc: 
        STM     #f1, AR2 
        STM     #f2, AR3 
        CALLD   Get_lsp_pol 
        MVDM    #pLsp, AR4 
 
 
        MVDM    ptr_Az, pLpcCoef2 
        STM     #5-1, BRC 
        MAR     *pLpcCoef2+0                  ; AR0 = 4 
        MVMM    pLpcCoef2, pLpcCoef1 
        MAR     *pLpcCoef2+ 
 
        STM     #f1 + 10, pf1                 ; pf1 -> &f1[5] 
 
        RPTBD   BLK_END-1 
        STM     #f2 + 10, pf2                 ; pf2 -> &f2[5] 
 
                DLD      *pf1-, A 
                DADD     *pf1,  A 
                DLD      *pf2-, B 
                DSUB     *pf2, B 
 
                ADD      #1, 12, A            ; rounding 
 
                ADD      B, A 
                STL      A, -13, *pLpcCoef1- 
                SUB      B, 1, A 
                STL      A, -13, *pLpcCoef2+ 
BLK_END 
        RET