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

📄 amf_mixernxm_s.c

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



#include "AMF_MixerNxM_S.h"

void AMF_MixerNxM_S_Render(AMF_MixerNxM_S * restrict instance,float * restrict * buffers, int tickSize);


// NOTE: The C version of this function is for reference only (it is
//       intended just to show the general algorithm that the module
//       uses), and it may not have been fully tested
#if 0    // Example code

#define EPSILON .0001

#pragma optimize_for_speed
SEG_MOD_FAST_CODE  void AMF_MixerNxM_S_Render(AMF_MixerNxM_S * restrict instance,float * restrict * buffers,int tickSize) {
    int i;
    int inputCount = instance->b.numInputs;
    int outputCount = instance->b.numOutputs;
    int outNum,inNum;
    float * restrict in;
    float * restrict out;
    float pm *amps = &instance->amps[0]; 
    float amp;
    int outWritten; // Boolean

    for (outNum=0; outNum<outputCount; outNum++) {
        out = buffers[inputCount + outNum];
        outWritten = 0;
        for (inNum=0; inNum<inputCount; inNum++) {
            amp = amps[inNum*outputCount+outNum];
            if (amp > EPSILON) {
                in = buffers[inNum];
                if (!outWritten) {
                    outWritten = 1;
                    for (i=0; i<tickSize*2; i++) 
                         // Should be able to use SIMD here                       
                         out[i] = in[i] * amp;
                }
                else 
                    for (i=0; i<tickSize*2; i++) 
                         // Should be able to use SIMD here                       
                        out[i] += in[i] * amp;
            }
        }
        if (!outWritten)
            for (i=0; i<tickSize*2; i++)
                 // Should be able to use SIMD here                       
                out[i] = 0.0;
    }
}
#endif

/*
 * Module baseclass structure describing the module environment.
 */
SEG_MOD_SLOW_CONST const AMF_ModuleVariableClass AMFClassMixerNxM_S = {
    
    /* Flags */
    AMFModuleClassFlag_VARIABLE_PIN_COUNT,
     
    /* Render function */
    (AMF_RenderFunction)AMF_MixerNxM_S_Render, 
    
    /* Default bypass */
    (void *)0
};






⌨️ 快捷键说明

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