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

📄 amf_tomono_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_ToMono_Render.asm#3 $ 
// Part of : VisualAudio V2.5.0 
// Updated : $Date: 2006/10/12 $ by $Author: Fernando $




//    Module Name     : AMF_ToMono_Render.asm 
//    DSP Processor   : ADSP21161
//    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/17/03 Tim Stilson: optimized using swap operation
    //
    ////////////////////////////////////////////////////////////////////////////////


//====================================================================================
/*
    int i,j;
    float *in = buffers[0];
    float *out1 = buffers[1];
    float *out2 = buffers[2];
    for (i=0,j=0; i<tickSize; i++,j+=2) {
        out1[i] = in[j];
        out2[i] = in[j+1];
    }
*/
//====================================================================================

#if 1


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

.global    _AMF_ToMono_Render;            ;

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

//====================================================================================
//AMF_ToMono_Render_prologue:
                            
//module entry arguments passed in registers: 
//  r4  = * instance
//  r8  = * buffers (float * restrict)
//  r12 = int tickSize

    puts = mode1;
    r0=i0; puts=r0;
    r0=i1; puts=r0;
                
//------------------------------------------------------------------------------------

    i4=r8;                                //i4->*buffers
    i0=dm(0,i4);        //i0=float *in
    i1=dm(1,i4);        //i1=float *out1
    i4=dm(2,i4);        //i4=float *out2

    r12=lshift r12 by -1;                //r0=tickSize/2

    bit set mode1 PEYEN;                //Enable PEy:SIMD
    m4=2;
                                        
    LCNTR=r12, DO AMF_ToMono_Render_loop_end UNTIL LCE;
        r1=dm(i0,m4);        // r1 = [a(n) b(n)]
        r2=dm(i0,m4);        // r2 = [a(n+1) b(n+1)]
        r2<->s1;        // r1 = [a(n) a(n+1)], r2=[b(n) b(n+1)]
        dm(i1,m4)=r1;        // write a out to in1
AMF_ToMono_Render_loop_end:     
        dm(i4,m4)=r2;        // write b out to in2

    bit clr mode1 PEYEN;                // Disable PEy : SIMD

//====================================================================================

    i1=gets(1);
    i0=gets(2);
    mode1=gets(3);
    alter(3);

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

⌨️ 快捷键说明

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