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


;========================================================================== 
;  File Name 
;  ---------- 
;  INTPL3.ASM 
; 
;  Brief Description of the Code: 
;  ------------------------------ 
;  For interpolating the normalized correlation with 1/3 resolution. 
; 
;  Ref 
;  ------ 
;  PITCH.C 
;========================================================================== 
;  Interpol_3 
;--------------------------------------------------------------------------- 
;  Word16 Interpol_3(      /* (o)  : interpolated value  */ 
;    Word16 *x,            /* (i)  : input vector        */ 
;    Word16 frac           /* (i)  : fraction            */ 
;  ) 
;--------------------------------------------------------------------------- 
;  Input : ptr_xn -> x 
;          A = frac (low 16 bits) 
; 
;  Outpur: A = Interpol_3 
; 
;  Modified Registers : AR0, AR2, AR3, AR4, AR5, BRC 
;--------------------------------------------------------------------------- 
		.mmregs 
        .include ..\include\const.h 
        .include ..\include\ld8amem.h 
        .include ..\include\tab_ld8a.h 
 
        .text 
        .def     Interpol_3 
 
        .ref     ptr_xn 
 
        .asg     "AR2", pX1 
        .asg     "AR3", pX2 
        .asg     "AR4", pC1 
        .asg     "AR5", pC2 
 
Interpol_3: 
        STM     #0, BK 
        LD      #UP_SAMP, B 
        STLM    B, AR0 
        MVDM    ptr_xn, pX1 
        XC      2, ALT 
                ADD     B, A 
                MAR     *pX1- 
        MVMM    pX1, pX2 
        MAR     *pX2+ 
        SUB     A, B 
        ADD     #Intpl_3, A 
        STLM    A, pC1 
        ADD     #Intpl_3, B 
 
        STM     #L_INTER4-1, BRC 
        RPTBD   BLK_END-1 
        STLM    B, pC2 
        LD      #0, A 
 
                MAC     *pX1-, *pC1+0%, A 
                MAC     *pX2+, *pC2+0%, A 
BLK_END 
        RET