📄 amf_graphicequalizer_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: AMF_GraphicEqualizer_Render.asm 197 2007-06-22 13:05:57Z bijeshp $ // Part of : VisualAudio V2.5.0 // Updated : $Date: 2007-06-22 18:35:57 +0530 (Fri, 22 Jun 2007) $ by $Author: bijeshp $// Module Name : AMF_GraphicEqualizer_Render.asm // DSP Processor : ADSP2136X// Original Author : Bijesh P// Date : 22 July 2007//====================================================================================// // // cycles ~= cycles ~= 36 + 20/sample/band//// 10 band eq ~ 230 cycles/samples // (SIMD used)//==================================================================================== .import "AMF_GraphicEqualizer.h";.extern _AMF_GraphicEqualizer_Tune ; #define PEYEN 1<<21#define BDCST9 1<<22#define BDCST1 1<<23 #define putf(x) dm(-(x),i6)#define putfdag2(x) pm(-(x),i12) #define getf(x) putf(x)#define save_dregs(x) putf(x)=r3 ; putf(x+1)=r5 ; putf(x+2)=r6 ; putf(x+3)=r7; \ putf(x+4)=r9 ; putf(x+5)=r10 ; putf(x+6)=r11 ; \ putf(x+7)=r13 ; putf(x+8)=r14 ; putf(x+9)=r15 #define restore_dregs(x) r3 = getf(x); r5 = getf(x+1); r6 = getf(x+2); r7 =getf(x+3);\ r9 =getf(x+4); r10 =getf(x+5); r11 =getf(x+6);\ r13 =getf(x+7); r14 =getf(x+8); r15 =getf(x+9) #define leaf_exit i12=dm(m7,i6); jump (m14,i12) (db); i7=i6; i6=dm(0,I6)#define LOCAL_FRAME_START 2 #define NUM_STATUS_SAVED 1 #define LOCAL_DREG_START (LOCAL_FRAME_START+1) #define NUM_DREGS_SAVED 10#define LOCAL_IREG_START (LOCAL_DREG_START+NUM_DREGS_SAVED) #define NUM_IREGS_SAVED 10#define LOCAL_VAR_START (LOCAL_IREG_START+NUM_IREGS_SAVED) #define NUM_LOCAL_VARS 3 #define FRAME_SIZE (NUM_DREGS_SAVED+NUM_IREGS_SAVED+NUM_LOCAL_VARS+NUM_STATUS_SAVED) .global _AMF_GraphicEqualizer_Render ; #define CONST_2 LOCAL_VAR_START #define TICKSIZE CONST_2+1 .section /pm seg_pmco; //i6 - > fp i6,b6,l6,m6-> do not modify//i7 - > sp i7,b7,l7,m7-> do not modify// m5, m13, m4, m15 .. do not mdoify //{ _AMF_GraphicEqualizer_Render: modify(i7, -FRAME_SIZE); i12 = i6; putf(LOCAL_FRAME_START) = mode1 ; save_dregs(LOCAL_DREG_START) ; putfdag2(LOCAL_IREG_START) = i0; putfdag2(LOCAL_IREG_START+1) = i1; putfdag2(LOCAL_IREG_START+2) = i2; putfdag2(LOCAL_IREG_START+3) = i3; putfdag2(LOCAL_IREG_START+4) = i4; putfdag2(LOCAL_IREG_START+5) = i5; putf(LOCAL_IREG_START+6) = i8; putf(LOCAL_IREG_START+7) = i9; putfdag2(LOCAL_IREG_START+8) = b1; putfdag2(LOCAL_IREG_START+9) = l1; i0 = r4; //instance i1 = r8; //buffers //r12 = tickSize#ifdef ENA_TUNE_IN_DSP putf(TICKSIZE)=r12; r2 = i6; i6 = i7; jump _AMF_GraphicEqualizer_Tune(db); dm(i7,m7) = r2; dm(i7,m7) = pc; modify(i7,2); r12=getf(TICKSIZE); #endif i8 = dm(0,i1); i1 = dm(1,i1); f0 = 2.0; putf(CONST_2) = f0; putf(CONST_2-1) = f0; r0 = r12 - 1; if le jump eq_exit ; /* Copy input to output*/ /* This copy can be removed by having a seperate filter loop for first band first stage*/ /* compromise between code size and cycles*/ l1 = r12; r0 = lshift r12 by -1 , f2 = pm(i8,m14) ; r0 = r0 - 1 , b1 = i1; lcntr=r0, do copy_loop until lce ; dm(i1,m6)=f2,f0 = pm(i8,m14) ; copy_loop: dm(i1,m6)=f0,f2 = pm(i8,m14) ; dm(i1,m6)=f2,f0 = pm(i8,m14) ; dm(i1,m6)=f0; i2 = dm(OFFSETOF(AMF_GraphicEqualizer, pC0), i0); //pC0 i3 = dm(OFFSETOF(AMF_GraphicEqualizer, pV), i0); //pV i4 = dm(OFFSETOF(AMF_GraphicEqualizer, pK), i0); //pK i5 = dm(OFFSETOF(AMF_GraphicEqualizer, pC), i0); //pC i8 = dm(OFFSETOF(AMF_GraphicEqualizer, pA0Inv), i0); //pA0Inv i9 = dm(OFFSETOF(AMF_GraphicEqualizer, pStates), i0); //pStates r0 = dm(OFFSETOF(AMF_GraphicEqualizer, numBands),i0); //numBands m12 = 2; r15 = r12; lcntr=r0, do band_loop until lce ; //{ f2 = dm(i4,1); ///K bit set MODE1 PEYEN;nop; r4 = dm(OFFSETOF(AMF_GraphicEqualizer, numStages),i0); //numStages f4 = dm(i5,m5),f5 = pm(i8,m12); //a0Inv //c f8 = pm(0,i9); //s[0] f12 = pm(2,i9); //s[1] f13 = pm(4,i9); //s[2] f9 = pm(6,i9); //s[3] bit clr MODE1 PEYEN;nop; f6 = f8 - f12,f0 = dm(i2,1); //c0 /* x4 */; f10 = f0 * f6 /* x10 */ , f6 = f9 - f13 /* x4 */, f3 = getf(CONST_2); f14 = f0 * f6 /* x11 */ , f6 = f10 - f12 /* x12 */, f12 = f10 ; f15 = f3 * f6 /* x6 */ , f7 = f9 + f14 /* x7 */, f11 = f14/* x11 */; f3 = f3 * f7 /* x9 */ , f9 = f11 + f13 /* s[3]*/, f11 = f7 /* x7 */; f14 = f3 * f4 /* x12 */ , f6 = f11 - f15 /* x8 */, f13 = f6 /* s[2]*/; f10 = f2 * f6 /* x4 */ , f12 = f8 - f12 /* s[1]*/, f7 = dm(0,i1) /* output[i] */; f8 = f2 * f7 /* x10 */ , f6 = f10 - f14 /* x4 */, f10 = f6 /* x8 */; f6 = f2 * f6 /* x4 */ , f14 = f11 + f15, f1 = dm(i3,1); //V /* x6 */; f6 = f6 + f14 /* x4 */, f14 = f11; f3 = f6 - f8, sf0=f0 /* x4 */; f8 = f3 * f5, sf1=f1 /* x9 , s[0] */; f6 = f10 - f8, sf2=f2 /* x5 */; f6 = f2 * f6 /* x5 */, f3 = f8 + f14 /*x4 */ ; f14 = f3 * f4 /* x4*/, f11 = f6; f14 = f1 * f6 /* x10 */ , f10 = f11 - f14 /* x4 */, f3 = getf(CONST_2); f10 = f3 * f10 , f11 = dm(0,i1); f10 = f10 + f14; f10 = f10 * f1; f10 = f10 + f11, r15 = l1; r15 = r15 - 1 ,dm(i1,0) = f10; bit set MODE1 PEYEN;nop; lcntr=r15, do sample_loop until lce ; //{ //s[0] = f8 s[1] = f12 s[2]=f13 , s[3]= f9 //c0 = f0 f4 = c //V = f1 f5 = a0Inv //K = f2 f6 = f8 - f12 /* x4 */; f10 = f0 * f6 /* x10 */ , f6 = f9 - f13 /* x4 */, f3 = getf(CONST_2); f14 = f0 * f6 /* x11 */ , f6 = f10 - f12 /* x12 */, f12 = f10 ; f15 = f3 * f6 /* x6 */ , f7 = f9 + f14 /* x7 */, f11 = f14/* x11 */; f3 = f3 * f7 /* x9 */ , f9 = f11 + f13 /* s[3]*/, f11 = f7 /* x7 */; f14 = f3 * f4 /* x12 */ , f6 = f11 - f15 /* x8 */, f13 = f6 /* s[2]*/; f10 = f2 * f6 /* x4 */ , f12 = f8 - f12 /* s[1]*/, sf7 = dm(m5,i1) /* output[i] m5 = 0*/; f8 = f2 * f7 /* x10 */ , f6 = f10 - f14 /* x4 */, f10 = f6 /* x8 */; f6 = f2 * f6 /* x4 */ , f14 = f11 + f15 /* x6 */; f6 = f6 + f14 /* x4 */, f14 = f11; f3 = f6 - f8 /* x4 */; f8 = f3 * f5 /* x9 , s[0] */; f6 = f10 - f8 /* x5 */,pm(4,i9) = f13; f6 = f2 * f6 /* x5 */, f3 = f8 + f14 /*x4 */ , pm(2,i9) = f12; f14 = f3 * f4 /* x4*/, f11 = f6 ; f14 = f1 * f6 /* x10 */ , f10 = f11 - f14 /* x4 */, f3 = getf(CONST_2); f10 = f3 * f10 , s11 = dm(m5,i1); //m5=0 f10 = f10 + f14,pm(6,i9) = f9 ; f10 = f10 * f1, pm(0,i9) = f8; f10 = f10 + f11, r15 = l1; sample_loop: dm(i1,m6) = sf10; //} f6 = f8 - f12 /* x4 */; f10 = f0 * f6 /* x10 */ , f6 = f9 - f13 /* x4 */, f3 = getf(CONST_2); f14 = f0 * f6 /* x11 */ , f6 = f10 - f12 /* x12 */, f12 = f10 ; f15 = f3 * f6 /* x6 */ , f7 = f9 + f14 /* x7 */, f11 = f14/* x11 */; f3 = f3 * f7 /* x9 */ , f9 = f11 + f13 /* s[3]*/, f11 = f7 /* x7 */; f14 = f3 * f4 /* x12 */ , f6 = f11 - f15 /* x8 */, f13 = f6 /* s[2]*/; f10 = f2 * f6 /* x4 */ , f12 = f8 - f12 /* s[1]*/, sf7 = dm(m5,i1) /* output[i] */; f8 = f2 * f7 /* x10 */ , f6 = f10 - f14 /* x4 */, f10 = f6 /* x8 */; f6 = f2 * f6 /* x4 */ , f14 = f11 + f15 /* x6 */; f6 = f6 + f14 /* x4 */, f14 = f11; f3 = f6 - f8 /* x4 */; f8 = f3 * f5 /* x9 , s[0] */; f6 = f10 - f8 /* x5 */; f6 = f2 * f6 /* x5 */, f3 = f8 + f14 /*x4 */ ; f14 = f3 * f4 /* x4*/, f11 = f6; f14 = f1 * f6 /* x10 */ , f10 = f11 - f14 /* x4 */, f3 = getf(CONST_2); f10 = f3 * f10 , s11 = dm(m5,i1); f10 = f10 + f14; f10 = f10 * f1, modify(i9,m14) ; f10 = f10 + f11, r15 = l1; bit clr MODE1 PEYEN;nop; dm(i1,m6) = sf10; pm(i9,m12) = sf8 ; pm(i9,m12) = sf12 ; pm(i9,m12) = sf13 ; band_loop: pm(i9,m14) = sf9 ; //} eq_exit: i0 = getf(LOCAL_IREG_START); i1 = getf(LOCAL_IREG_START+1); i2 = getf(LOCAL_IREG_START+2); i3 = getf(LOCAL_IREG_START+3); i4 = getf(LOCAL_IREG_START+4); i5 = getf(LOCAL_IREG_START+5); i8 = getf(LOCAL_IREG_START+6); i9 = getf(LOCAL_IREG_START+7); b2 = getf(LOCAL_IREG_START+8); l1 = getf(LOCAL_IREG_START+9); restore_dregs(LOCAL_DREG_START); mode1 = getf(LOCAL_FRAME_START);nop;nop; modify(i7,FRAME_SIZE); leaf_exit; //}._AMF_GraphicEqualizer_Render.end:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -