📄 amf_mixernxm_ds.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_DS.c#3 $
// Part of : VisualAudio V2.5.0
// Updated : $Date: 2006/10/12 $ by $Author: Fernando $
#include "AMF_MixerNxM_DS.h"
void AMF_MixerNxM_DS_Render(AMF_MixerNxM_DS * 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_DS_Render(AMF_MixerNxM_DS * 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++) {
amp0 = amps[2*(inNum*outputCount+outNum)];
amp1 = amps[2*(inNum*outputCount+outNum)+1];
if (amp0 > EPSILON || amp1 > EPSILON) {
in = buffers[inNum];
if (!outWritten) {
outWritten = 1;
for (i=0; i<tickSize*2; i+=2)
// Should be able to use SIMD here
out[i] = in[i] * amp0;
out[i+1] = in[i+1] * amp1;
}
else
for (i=0; i<tickSize*2; i+=2)
// Should be able to use SIMD here
out[i] += in[i] * amp0;
out[i+1] += in[i+1] * amp1;
}
}
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_DS = {
/* Flags */
AMFModuleClassFlag_VARIABLE_PIN_COUNT,
/* Render function */
(AMF_RenderFunction)AMF_MixerNxM_DS_Render,
/* Default bypass */
(void *)0
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -