📄 amf_tostereo_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_ToStereo_Render.asm#3 $
// Part of : VisualAudio V2.5.0
// Updated : $Date: 2006/10/12 $ by $Author: Fernando $
// Module Name : AMF_ToStereo_Render.asm
// DSP Processor : ADSP21161
// Description : Mono to stereo converter audio module ASM file.
// Owner : Analog Devices
// Original Author : Mark A Wilson
// Date : 5/28/03
//====================================================================================
// Processor resources used:
// 23 words pmem
// 362 cycles (ticksize=128) (42 + 5*tickSize/2)
////////////////////////////////////////////////////////////////////////////////
//
// History:
//
// 5/28/03 Mark Wilson: created
// 7/02/03 Tim Stilson: optimized using swap operation
//
////////////////////////////////////////////////////////////////////////////////
//====================================================================================
/*
int i,j;
float *in1 = buffers[0];
float *in2 = buffers[1];
float *out = buffers[2];
for (i=0,j=0; i<tickSize; i++,j+=2) {
out[j] = in1[i];
out[j+1] = in2[i];
}
*/
//====================================================================================
#if 1 // ASM render code
#include "processor.h"
#include "AMF_ToStereo.h"
#include "asm_macros.h"
#include "asm_sprt.h"
.global _AMF_ToStereo_Render; ;
.segment /pm SEG_MOD_FAST_CODE;
//.segment /pm seg_pmco;
_AMF_ToStereo_Render:
//====================================================================================
//AMF_ToStereo_Render_prologue:
//module entry arguments passed in registers:
// r4 = * instance
// r8 = * buffers (float * restrict)
// r12 = int tickSize
//Make sure that any stack arguments are retreived before preserving any regs to stack
//module entry arguments passed on stack:
// r0=gets(5); //stack->*outputs
// r1=gets(4); //stack->*inputs
// etc...
//(NOTE: There are no stack arguments passed for this module)
//push call preserve regs to stack here once stack call params are retrieved
puts=mode1;
R0=I0; puts=R0;
R0=I1; puts=R0;
//------------------------------------------------------------------------------------
AMF_ToStereo_Render_setup:
i4=r8; //i4->*buffers
i0=dm(0,i4); //i0=float *in1
i1=dm(1,i4); //i1=float *in2
i4=dm(2,i4); //i4=float *out
r12=lshift r12 by -1; //r0=tickSize/2
bit set mode1 PEYEN; //Enable PEy:SIMD
m4=2;
AMF_ToStereo_Render_loop_start: // for (i=0; i<tickSize; i+=2)
LCNTR=r12, DO AMF_ToStereo_Render_loop_end UNTIL LCE;
r1=dm(i0,m4); // r1 = [a(n) a(n+1)]
r2=dm(i1,m4); // r2 = [b(n) b(n+1)]
r2<->s1; // r1 = [a(n) b(n)], r2 = [a(n+1) b(n+1)]
dm(i4,m4)=r1; // write r1
AMF_ToStereo_Render_loop_end:
dm(i4,m4)=r2; // write r2
bit clr mode1 PEYEN; // Disable PEy: SIMD
//====================================================================================
AMF_ToStereo_Render_epilogue:
I1=gets(1);
I0=gets(2);
mode1=gets(3);
alter(3);
//------------------------------------------------------------------------------------
_AMF_ToStereo_Render.END:
leaf_exit; // C-rth requires this instead of rts
//------------------------------------------------------------------------------------
.endseg;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -