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


;========================================================================== 
;  File Name 
;  ---------- 
;  CORR_H_X.ASM 
; 
;  Brief Description of the Code: 
;  ------------------------------ 
;  Compute correlations of input response h[] with the target vector X[]. 
; 
;  Ref 
;  ------ 
;  ACELP_CO.C (Corr_h_x) 
;========================================================================== 
 
 
        .mmregs 
 
        .include  ..\include\const.h 
        .include  ..\include\tab_ld8a.h 
        .include  ..\include\ld8amem.h 
 
        .def      Corr_h_x 
 
 
;---------------------------------------------------------------------- 
;  Corr_h_x 
;---------------------------------------------------------------------- 
;  void Cor_h_x( 
;       Word16 h[],        /* (i) Q12 :Impulse response of filters      */ 
;       Word16 X[],        /* (i)     :Target vector                    */ 
;       Word16 D[]         /* (o)     :Correlations between h[] and D[] */ 
;                          /*          Normalized to 13 bits            */ 
;  ) 
;---------------------------------------------------------------------- 
;  Constants : 
;		 Addr_h1 -> h 
;              	(Addr_xn2 -> x	)it's a wrong description 
;		AR5 -> x 
;              	Addr_DnSing -> DnSign 
;              	Addr_Dn -> D 
;---------------------------------------------------------------------- 
 
        .asg    "AR1", pDn 
        .asg    "AR2", pDnSign 
        .asg    "AR3", plDn 
        .asg    "AR4", pHn 
        .asg    "AR5", pXn 
Corr_h_x: 
        STM     #(L_SUBFR >> 1) - 1, BRC 
        LD      #07fffh, 16, A 
        OR      A, -16 
        RPTBD   EndInitDnSign - 1 
        STM     #Addr_DnSign, pDnSign 
 
                DST     A, *pDnSign+ 
EndInitDnSign: 
	 
        LD      #0,B 
        STM     #L_SUBFR - 1, BRC 
        STM     #Addr_Dn, pDn 
        STM     #Addr_h1, pHn 
        STM     #Addr_DnSign, pDnSign 
        LD      #0, DP 
        LD      #08000h, A 
        STLM    A, TRN 
        MVMM    pDn, plDn 
 
        RPTBD   EndFindDn32 - 1 
        STM     #L_SUBFR, AR0 
 
                LD      #0, A 
                RPT     BRC 
                        MAC     *pXn+, *pHn+, A 
 
                MAR     *pHn-0 
                MAR     *AR0- 
;?if A<0 then MIN_16->pDnSign                 
                XC      1, ALT 
                        ST      TRN, *pDnSign 
 
                MAR     *pXn-0 
                MAR     *pDnSign+ 
                DST     A, *plDn+ 
                ABS     A 
                MAX     B 
EndFindDn32: 
 
        EXP     B 
        STM     #L_SUBFR - 1, BRC 
		LD      T,B 
		LD      T,A 
        SUB     #16,B 
		NOP 
		XC       2,BGT 
		        LD      #16,A 
        		NOP 
		SUB       #18,A 
		STLM      A,T 
        RPTBD   EndNormDn - 1 
        MVMM    pDn, plDn 
        LD      T, ASM 
        DLD     *plDn+, A 
		LD      A,ASM,A 
        STL     A,  *pDn+ 
EndNormDn: 
 
        RET