📄 amf_panner_render.asm
字号:
// Copyright(c) 2005 Analog Devices, Inc. All Rights Reserved.
// This software is proprietary and confidential to Analog Devices, Inc. and its licensors.
// File : $Id: //depot/development/visualaudio/modules/2.5.0/SHARC/Source/AMF_Panner_Render.asm#3 $
// Part of : VisualAudio V2.5.0
// Updated : $Date: 2006/10/12 $ by $Author: Fernando $
// Module Name : AMF_Panner_Render.asm
// DSP Processor : ADSP21161
// Original Author : Tim Stilson
// Date : 4/21/03
//====================================================================================
// Processor resources used:
// 34 words pmem INTERNAL
// 316 cycles, tickSize=128 (60 + 2*tickSize)
//====================================================================================
// Revision History:
// 8/27/2003 Tim Stilson Created, based on ScalerSmoothed_DS
#if 1
#include "processor.h"
#include "AMF_Panner.h"
#include "asm_macros.h"
#include "asm_sprt.h"
.global _AMF_Panner_Render;
.segment /pm SEG_MOD_FAST_CODE ;
_AMF_Panner_Render:
//====================================================================================
puts=mode1;
r0=i1; puts=r0;
r0=i0; puts=r0;
puts=r13;
//------------------------------------------------------------------------------------
i0=r8; //i0->*buffers
i1=dm(0,i0); //i1=float *in
i4=dm(1,i0); //i4=float *out
i0=r4; //i0->testModuleInstance[0]
f4=dm(AMF_Panner_CosSinSmoothing,i0); // f4/s4 = float cosSinSmoothing = instance->cosSinSmoothing
s4=f4;
// can't do SIMD reads here because may be off chip
f1=dm(AMF_Panner_CosSin,i0); // f1 = instance->CosSin[0]
s1=dm(AMF_Panner_CosSin+1,i0); // s1 = instance->CosSin[1]
f8=dm(AMF_Panner_CosSinTarget,i0); // i0= &instance->CosSinTarget[0]
s8=dm(AMF_Panner_CosSinTarget+1,i0); // i0= &instance->CosSinTarget[1]
bit set mode1 BDCST1 | PEYEN; // Enable PEy:SIMD
m4=2;
f2=1.0; // f2/s2 = 1.0
f2=f2-f4; // f2/s2=(1-r)
f13=f8*f4; // f13/s13 = target*r
f8=f1*f2, f4=dm(i1,m6); // f8/s8 = cur*(1-r), read first input into both f4 and s4
LCNTR=r12, DO AMF_Panner_Render_loop_end UNTIL LCE;
f0=f1*f4, f1=f8+f13, f4=dm(i1,m6); // f0=in*cur, f1=cur=cur*(1-r)+t*r, read next in into f4 and s4
AMF_Panner_Render_loop_end:
f8=f1*f2, dm(i4,m4)=f0; // f8=cur*(1-r) for next iter, write out
bit clr mode1 BDCST1 | PEYEN; // Disable PEy : SIMD
nop;
dm(AMF_Panner_CosSin,i0)=f1; // f1 = instance->CosSin[0]
dm(AMF_Panner_CosSin+1,i0)=s1; // s1 = instance->CosSin[1]
//====================================================================================
AMF_Panner_Render_epilogue:
r13=gets(1);
i0=gets(2);
i1=gets(3);
mode1=gets(4);
alter(4);
//------------------------------------------------------------------------------------
_AMF_Panner_Render.END:
leaf_exit; // C-rth requires this instead of rts
//------------------------------------------------------------------------------------
.endseg;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -