📄 amf_agcnmultiplier_s.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_AGCNMultiplier_S.c#3 $
// Part of : VisualAudio V2.5.0
// Updated : $Date: 2006/10/12 $ by $Author: Fernando $
#include "AMF_AGCNMultiplier_S.h"
void AMF_AGCNMultiplier_S_Render(AMF_AGCNMultiplier_S * restrict instance,float * restrict * buffers,int tickSize);
void AMF_AGCNMultiplier_S_Bypass(AMF_AGCNMultiplier_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
#pragma optimize_for_speed
SEG_MOD_FAST_CODE void AMF_AGCNMultiplier_S_Render(AMF_AGCNMultiplier_S * restrict instance,float * restrict * buffers,int tickSize) {
int numInputs = instance->b.inputPinCount;
int i,j,k;
float *inMul = buffers[0];
float *stereoIn;
float *out;
for (k=1; k<numInputs; k++) {
stereoIn = buffers[k];
out = buffers[k + numInputs - 1];
for (i=0,j=0; i<tickSize; i++,j+=2) {
out[j] = inMul[i] * stereoIn[j];
out[j+1] = inMul[i] * stereoIn[j+1];
}
}
}
#endif
// custom bypass
// copies inputs to outputs, without multiplying
#pragma optimize_for_speed
SEG_MOD_FAST_CODE void AMF_AGCNMultiplier_S_Bypass(AMF_AGCNMultiplier_S * restrict instance,float * restrict * buffers,int tickSize) {
int numInputs = instance->b.inputPinCount;
int i,j,k;
float *stereoIn;
float *out;
for (k=1; k<numInputs; k++) {
stereoIn = buffers[k];
out = buffers[k + numInputs - 1];
for (i=0,j=0; i<tickSize; i++,j+=2) {
out[j] = stereoIn[j];
out[j+1] = stereoIn[j+1];
}
}
}
SEG_MOD_SLOW_CONST const AMF_ModuleVariableClass AMFClassAGCNMultiplier_S =
{
/* Flags */
AMFModuleClassFlag_VARIABLE_PIN_COUNT,
/* Render function */
(AMF_RenderFunction) AMF_AGCNMultiplier_S_Render,
/* Default bypass */
(AMF_RenderFunction) AMF_AGCNMultiplier_S_Bypass
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -