📄 amf_mixer2x1smoothed.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_Mixer2x1Smoothed.c#3 $
// Part of : VisualAudio V2.5.0
// Updated : $Date: 2006/10/12 $ by $Author: Fernando $
#include "AMF_Mixer2x1Smoothed.h"
void AMF_Mixer2x1Smoothed_Render(AMF_Mixer2x1Smoothed * 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
SEG_MOD_FAST_CODE void AMF_Mixer2x1Smoothed_Render(AMF_Mixer2x1Smoothed * restrict instance,float * restrict * buffers,int tickSize) {
int i;
float *in1 = buffers[0];
float *in2 = buffers[1];
float *out = buffers[2];
float amp0Target = instance->amp0Target;
float amp1Target = instance->amp1Target;
float amp0 = instance->amp0;
float amp1 = instance->amp1;
float ampsSmoothing = instance->ampsSmoothing;
float oneMinusRate = 1.0 - ampsSmoothing;
float amp,targetAmp;
for (i=0; i<tickSize; i++) {
// Use SIMD here, if possible
amp0 = amp0 * oneMinusRate + amp0Target * ampsSmoothing;
amp1 = amp1 * oneMinusRate + amp1Target * ampsSmoothing;
out[i] = in1[i] * amp0 + in2[i] * amp1;
}
instance->amp0 = amp0;
instance->amp1 = amp1;
}
#endif
SEG_MOD_SLOW_CONST const AMF_ModuleClass AMFClassMixer2x1Smoothed = {
/* Flags */
0,
/* Render function */
(AMF_RenderFunction)AMF_Mixer2x1Smoothed_Render,
/* Default bypass */
(void *)0,
/* Input descriptor - 2 inputs, and they are mono. */
2, 0,
/* Output descriptor - 1 output, and it is mono. */
1, 0,
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -