📄 key16.s
字号:
;************************************************************************
; (c)1997 Copyright LuxSonor, Inc. All rights reserved
;
; Revision 1.0
;
;
; Module: correlation test code
;
; Initial version:Chialun Lu 12/19/96
; Modification: Cecile Foret 02/10/97
; Jinshi Huang 12/1/98 for LS388/LS500
; Calling : none
; Called by: fir6.S
; r11: Return Address
; Return: r2 : current delta(in byte)
; Param in: r5 : start location(in byte address)
; r0 : number of skipped correlation coefficients
; r1 : number of correlation coefficients computed
; Temp reg:
; AGR reg:
; AGR0: pointer for goal sequence (copied in part A of mem)
; AGR5: pointer for search buffer (in part B of memory)
; AGR2:
;
;************************************************************************
.nolist
#include "regdef2.h"
#include "memory2.h"
.list
.data
.global SUB_delta_comp
;*********************** begin module "test" **********************
;********* find the correlation ***********************************
SUB_delta_comp:
movi r3,0 ; zero the delta
#ifdef EFFECT
li r4,0xff800000 //init to min value
#else //EFFECT
movi r4,0x0000 ; zero the r4 maximun cor value
movi r18, 0x8 ; zero the overflow corresponding to r4
#endif //EFFECT
#ifdef EFFECT
mov AGRAdr5, r5 ; set up the start pointer in search
movi AGRInc1,8 //skip each other sample
#else //EFFECT
mov AGRAdr3, r5 ; set up the start pointer in search
#endif //EFFECT
loop r1,cor2 ; r1 = # of corr coeff to be computed
#ifdef EFFECT
mulhf r6, i1,a5(16) ; initialises the correlation computation
// loop 127,cor1
loop 63,cor1
maddhf r6,i1,a5(16) ; take 1 sample on 4
cor1:
add r5,r0 ; increment start pointer in search
mov AGRAdr5, r5 ; set up the start pointer in search
#else //EFFECT
mulhf r6, i1, a3(8) ; initialises the correlation computation
loop 127,cor1
maddhf r6,i1,a3(8) ; take 1 sample on 4
cor1:
add r5,r0 ; increment start pointer in search
mov AGRAdr3, r5 ; set up the start pointer in search
#endif //EFFECT
;********* save the maximun value and location **********************
#ifndef EFFECT
tsts r19,r18
blt no_update
bgt Lmax
#endif //EFFECT
tst r6, r4
blte no_update
Lmax:
#ifndef EFFECT
mov r18,r19
#endif //EFFECT
mov r4, r6 ; save the new max
mov r2, r3 ; save the value of delta
no_update:
; sub r6,r6,r4 ; compare current and previous max
; blt cor_d
; add r4,r6 ; save the new max. num
; mov r2,r3 ; save the value of delta
;cor_d:
add r3,r0 ; increment potential value of delta
cor2:
; movh %max_up,r18
; movh %max_low, r4
nop
j r11 ; return to main program
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -