📄 amf_scalersmoothed_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_ScalerSmoothed_Render.asm#3 $
// Part of : VisualAudio V2.5.0
// Updated : $Date: 2006/10/12 $ by $Author: Fernando $
// Module Name : AMF_ScalerSmoothed_Render.asm
// DSP Processor : ADSP21161
// Original Author : Mark A Wilson
// Date : 4/18/03
//====================================================================================
// Processor resources used:
// 31 words pmem INTERNAL
// 179 cycles, tickSize=128 (51 + 2*tickSize/2)
//====================================================================================
// Revision History:
// 4/18/2003 Mark Wilson Created
// 7/15/2003 Tim Stilson Optimized
#if 1
#include "processor.h"
#include "AMF_ScalerSmoothed.h"
#include "asm_macros.h"
#include "asm_sprt.h"
.global _AMF_ScalerSmoothed_Render;
.segment /pm SEG_MOD_FAST_CODE;
_AMF_ScalerSmoothed_Render:
//====================================================================================
puts=mode1;
puts=r13;
R0=I0; puts=R0;
R0=I1; puts=R0;
//------------------------------------------------------------------------------------
AMF_ScalerSmoothed_Render_setup:
i1=r8; //i1->*buffers
i0=dm(0,i1); //r0=buffers[0]
i4=dm(1,i1); //r0=buffers[1]
i1=r4; //i1->testModuleInstance[0]
r12 = lshift r12 by -1;
f4=dm(AMF_ScalerSmoothed_AmpSmoothing,i1); // f4/s4 = float AmpSmoothing = instance->AmpSmoothing
f0=1.0;
f2=f0-f4, f8=dm(AMF_ScalerSmoothed_AmpTarget,i1); // f2/s2 = (1-r), f8/s8 = float AmpTarget = instance->AmpTarget
nop; // get around a multiplier-stall anomaly
// fixup (1-r) and r for updating every other sample... (1-r) -> (1-r)^2, r -> 1-((1-r)^2) (i.e. new(r) = 1 - new(1-r))
f2=f2*f2, f1=dm(AMF_ScalerSmoothed_Amp,i1); // f2/s2 = new(1-r) = (1-r)^2, f1/s1 = float Amp = instance->Amp
f4=f0-f2; // f4/s4 = new(r) = (1-new(1-r))
f13=f8*f4; // f12= ampTarget * ampSmoothing
f8=f1*f2; // f8 = Amp * oneMinusRate, read first input
s1=f1; // the above calculations are done in SISD because we can't use broadcast loads since the struct may be off-chip
s2=f2;
s8=f8;
s13=f13;
bit set mode1 PEYEN;
m4=2;
f4=dm(i0,m4); // read first input
LCNTR=r12, DO AMF_ScalerSmoothed_Render_loop_end UNTIL LCE;
f0=f1*f4, f1=f8+f13, f4=dm(i0,m4); // f0=in*cur, f1=cur=cur*(1-r)+t*r, read next in
AMF_ScalerSmoothed_Render_loop_end:
f8=f1*f2, dm(i4,m4)=f0; // f8=cur*(1-r) for next iter, write out
bit clr mode1 PEYEN;
nop;
dm(AMF_ScalerSmoothed_Amp,i1)=f1; //instance->amp=f1
//====================================================================================
I1=gets(1);
I0=gets(2);
r13=gets(3);
mode1=gets(4);
alter(4);
//------------------------------------------------------------------------------------
_AMF_ScalerSmoothed_Render.END:
leaf_exit; // C-rth requires this instead of rts
//------------------------------------------------------------------------------------
.endseg;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -