📄 amf_delayallpassoffchip_s_render.asm
字号:
// Copyright(c) 2005 Analog Devices, Inc. All Rights Reserved. ADI Confidential.
// Module Name : AMF_DelayAllpassOffChip_S_Render.asm
// DSP Processor : ADSP21367,368,369 (LX3)
// Description : Delay-based Allpass, off chip, stereo audio module ASM file.
// Owner : Analog Devices
// Original Author : Min Guo, modified from AMF_DelayAllpassOffChip_Render.asm by Tim Stilson
// Date : 11/18/05
// Revision : 01/11/06 Change from 4-coefficient to 1-coefficient topology
//====================================================================================
// Processor resources used:
// words pmem INTERNAL
// cycles (off-chip delay buf, 21369 (TickSize=64) ( + *tickSize)
// (SIMD used)
//====================================================================================
#if 1
#include "processor.h"
#include "asm_sprt.h"
#include "AudioProcessing.h"
.import "AMF_DelayAllpassOffChip_S.h";
// global routines
.global _AMF_DelayAllpassOffChip_S_Render;
.segment /pm SEG_MOD_FAST_CODE;
_AMF_DelayAllpassOffChip_S_Render:
// push context on stack
r0=i2; puts=r0;
r0=i1; puts=r0;
r0=i0; puts=r0;
puts=r3;
i4=r8; // i4->*buffers
// initialize input and output samples pointers
s9=dm(0,i4); // buffers[0], input
s10=dm(1,i4); // buffers[1], output
s11=dm(2,i4); // buffers[2], scratch (tmpbuf)
i4=r4; //i4->testModuleInstance[0]
r4 = r12; // MG r4 = tickSize
// initialize delay buffer pointer
//MG l12=dm(OFFSETOF(AMF_DelayAllpassOffChip_S,delay),i4); // length of delay buffer in samples
r0=dm(OFFSETOF(AMF_DelayAllpassOffChip_S,delay),i4); // length of delay buffer in samples
r0=lshift r0 by 1; // length * 2 for stereo samples
l12=r0; // MG stereo delay length
b12=dm(OFFSETOF(AMF_DelayAllpassOffChip_S,delayBuffer),i4); // buffer base
s12=dm(OFFSETOF(AMF_DelayAllpassOffChip_S,delayWritePtr),i4); // current delay pointer
i12=s12;
i2 = s10;
// copy from delay buff into output
r12=lshift r12 by 1; // MG tickSize*2
r0=pm(i12,m14); // r0 = delay[index++];
lcntr=r12, do AMF_DelayAllpassOffChip_S_Loop1 until lce;
AMF_DelayAllpassOffChip_S_Loop1:
dm(i2,m6)=r0, r0=pm(i12,m14); // out[i++] = r0, r0 = delay[index++];
//MG r4 = ashift r12 by -1;
f2=dm(OFFSETOF(AMF_DelayAllpassOffChip_S,coef),i4);
s2=f2;
bit set MODE1 PEYEN;
m4 = 2;
i0 = s9; // in[]
i1 = s11; // tmpbuf[]
i2 = s10; // out[]
// process delay line
f0 = dm(i0,m4); // f0 = in[]
f8 = f0*f2, f1 = dm(i2,m5); // f8 = coef*in[], f1 = out[] = tmpbuf[]
f8 = f1+f8; // f8 = tmp = tmpbuf[]+coef*in[]
lcntr=r4, do AMF_DelayAllpassOffChip_Loop2 until lce;
f1 = f2*f8, dm(i2,m4) = f8; // store tmp to out[]; // f1 = coef*tmp
f3 = f0-f1, f0 = dm(i0,m4); // f3 = in[] - coef*tmp, f0 = in[]
f8 = f0*f2, f1 = dm(i2,m5); // f8 = coef*in[], f1 = out[] = tmpbuf[]
AMF_DelayAllpassOffChip_Loop2:
f8 = f1+f8, dm(i1,m4) = f3; // store f3 to tmpbuf[]; // f8 = tmp = tmpbuf[]+coef*in[]
bit clr MODE1 PEYEN;
i12 = s12;// reset back to where delayptr was at start of tick
i0 = s11; // tmpbuf[]
// copy from tmpbuf into delay buff
r0=dm(i0,m6); // r0 = tmpbuf[i++];
lcntr=r12, do AMF_DelayAllpassOffChip_S_Loop3 until lce;
AMF_DelayAllpassOffChip_S_Loop3:
r0=dm(i0,m6), pm(i12,m14)=r0; // delay[index++] = r0, r0 = tmpbuf[i++];
r0=i12;
dm(OFFSETOF(AMF_DelayAllpassOffChip_S,delayWritePtr),i4)=r0; // store away current delay pointer
l12 = 0;
// pop context off stack
r3=gets(1);
i0=gets(2);
i1=gets(3);
i2=gets(4);
alter(4);
//------------------------------------------------------------------------------------
_AMF_DelayAllpassOffChip_S_Render.END:
leaf_exit; // C-rth requires this instead of rts
//------------------------------------------------------------------------------------
.endseg;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -