📄 amf_graphicequalizer_ds_render.asm
字号:
// Copyright(c) 2007 Analog Devices, Inc. All Rights Reserved.// This software is proprietary and confidential to Analog Devices, Inc. and its licensors.// File : $Id: AMF_GraphicEqualizer_DS_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_DS_Render.asm// DSP Processor : ADSP2136X// Original Author : Bijesh P// Date : 22 July 2007//====================================================================================// Equalizer for Dual stereo Mode // // cycles ~= cycles ~= 36 + 40/sample/band//// 10 band eq ~ 436 cycles/samples // (SIMD used)//==================================================================================== .import "AMF_GraphicEqualizer.h";.extern _AMF_GraphicEqualizer_DS_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 12#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_DS_Render ; #define CONST_2 LOCAL_VAR_START+1 #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_DS_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) = b5; putfdag2(LOCAL_IREG_START+10) = l1; putfdag2(LOCAL_IREG_START+11) = l5; i0 = r4; //instance i1 = r8; //buffers //r12 = tickSize#ifdef ENA_TUNE_IN_DSP putf(TICKSIZE)=r12; r2 = i6; i6 = i7; jump _AMF_GraphicEqualizer_DS_Tune(db); dm(i7,m7) = r2; dm(i7,m7) = pc; modify(i7,2); r12=getf(TICKSIZE); #endif i8 = dm(0,i1); i5 = 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*/ r0 = r12 + r12,f2 = pm(i8,m14) ; l5 = r0; r0 = r12 - 1 , b5 = i5; lcntr=r0, do copy_loop until lce ; dm(i5,m6)=f2,f0 = pm(i8,m14) ; copy_loop: dm(i5,m6)=f0,f2 = pm(i8,m14) ; dm(i5,m6)=f2,f0 = pm(i8,m14) ; dm(i5,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 i1 = 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 /* Circular for C coeff*/ r15 = r12; /* Circular for C coeff*/ b1 = i1; r4 = dm(OFFSETOF(AMF_GraphicEqualizer, numStages),i0); //numStages l1 = r4; m4 = 2; bit set MODE1 PEYEN | BDCST1;nop; lcntr=r0, do band_loop until lce ; //{ f0 = dm(i2,2); //c0 f1 = dm(i3,2); //V f2 = dm(i4,2); ///K r4 = dm(OFFSETOF(AMF_GraphicEqualizer, numStages),i0); //numStages lcntr=r4, do stage_loop until lce ; //{ f4 = dm(i1,1); //c f5 = pm(i8,2); //a0Inv :m14 is always set to 1 f8 = pm(0,i9); //s[0] f12 = pm(2,i9); //s[1] f13 = pm(4,i9); //s[2] 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 */, f9 = pm(6,i9) /*s[3]*/; 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,i5) /* 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] */, pm(6,i9) = f9 ; f6 = f10 - f8 /* x5 */, pm(0,i9) = f8 ; 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,i5); f10 = f10 + f14,pm(2,i9) = f12 ; f10 = f10 * f1,pm(4,i9) = f13 ; f10 = f10 + f11, r15 = l5; sample_loop: r15 = lshift r15 by -1 ,dm(i5,m4) = f10; stage_loop: modify(i9,8); band_loop: nop; //} bit clr MODE1 PEYEN | BDCST1 ; 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); b5 = getf(LOCAL_IREG_START+9); l1 = getf(LOCAL_IREG_START+10); l5 = getf(LOCAL_IREG_START+11); restore_dregs(LOCAL_DREG_START); mode1 = getf(LOCAL_FRAME_START) ; nop;nop; modify(i7,FRAME_SIZE); leaf_exit; //}._AMF_GraphicEqualizer_DS_Render.end: //}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -