⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 amf_scaler_ds_render.asm

📁 ADI SHARC DSP 音频算法标准模块库
💻 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_Scaler_DS_Render.asm#3 $ 
// Part of : VisualAudio V2.5.0 
// Updated : $Date: 2006/10/12 $ by $Author: Fernando $




//    Module Name     : AMF_Scaler_DS_Render.asm 
//    DSP Processor   : ADSP21161
//    Original Author : Mark A Wilson    
//    Date               : 4/24/03
//====================================================================================
// Processor resources used:
//        283  dsp core cycles (ticksize=128) (27 + 2*tickSize)
//        23   words Program memory (internal)
//====================================================================================
/*
    // In assembly version, this should use SIMD
    for (i=0; i<tickSize*2; i+=2) {
        currentAmp[0] = currentAmp[0] * oneMinusRate + targetAmp[0] * ampFilterRate;
        currentAmp[1] = currentAmp[1] * oneMinusRate + targetAmp[1] * ampFilterRate;
        out[i]        = in[i] * currentAmp[0];
        out[i+1]      = in[i+1] * currentAmp[1];
    }
    instance->aux->currentAmp[0] = fx = currentAmp[0];
    instance->aux->currentAmp[1] = sx = currentAmp[1];    
*/        
//====================================================================================


#if 1

#include "processor.h"
#include "AMF_Scaler_DS.h"
#include "asm_macros.h"
#include "asm_sprt.h"

.global    _AMF_Scaler_DS_Render;            ;

.segment /pm SEG_MOD_FAST_CODE;
//.segment /pm seg_pmco;
_AMF_Scaler_DS_Render:

//====================================================================================
//MF_Scaler_DS_Render_prologue:
    entry;    
                            
//module entry arguments passed in registers: 
//  r4  = instance    (AMF_Scaler_DS * restrict)
//  r8  = * buffers (float * restrict)
//  r12 = int tickSize
    
    puts=mode1;
    r0=i0; puts=r0;
                    
//------------------------------------------------------------------------------------
AMF_Scaler_DS_Render_setup:
    i4=r4;                                //i4->testModuleInstance[0]
    
    f2=dm(AMF_Scaler_DS_Amp0,i4);            //i12 = instance->amps[0]
    s2=dm(AMF_Scaler_DS_Amp1,i4);            //i12 = instance->amps[1]

    i4=r8;                                //i4->*buffers
    
    i0=dm(0,i4);                        //r2=buffers[0]=&in
    i4=dm(1,i4);                        //r2=buffers[1]=&out
        
    bit set mode1 PEYEN;                // Enable PEy:SIMD
    m4=2;                                // DAG index used inside loop
                                        
    f1=dm(i0,m4);

    LCNTR=r12, DO AMF_Scaler_DS_Render_loop_end UNTIL LCE;
        f0=f1*f2,     f1=dm(i0,m4);        // out[i/i+1] = in[i/i+1] * amps[0/1]
AMF_Scaler_DS_Render_loop_end: 
        dm(i4,m4)=f0;

    bit clr mode1 PEYEN;                // Disable PEy : SIMD

//====================================================================================
AMF_Scaler_DS_Render_epilogue:

    I0=gets(1);
    mode1=gets(2);
    alter(2);

//------------------------------------------------------------------------------------
_AMF_Scaler_DS_Render.END:
    leaf_exit; // C-rth requires this instead of rts
//------------------------------------------------------------------------------------
.endseg;
#endif    

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -