📄 amf_clipasym_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_ClipAsym_DS.c#3 $
// Part of : VisualAudio V2.5.0
// Updated : $Date: 2006/10/12 $ by $Author: Fernando $
#include "AMF_ClipAsym_DS.h"
void AMF_ClipAsym_DS_Render(AMF_ClipAsym_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
SEG_MOD_FAST_CODE void AMF_ClipAsym_DS_Render(AMF_ClipAsym_DS * restrict instance,float * restrict * buffers,int tickSize) {
int i;
float *in = buffers[0];
float *out = buffers[1];
float clipUpperLeft = instance->clipUpper[0];
float clipUpperRight = instance->clipUpper[1];
float clipLowerLeft = instance->clipLower[0];
float clipLowerRight = instance->clipLower[1];
for (i=0; i<tickSize*2; i+=2) {
// clip left channel
if(in[i]>clipUpperLeft)
out[i] = clipUpperLeft;
else if(in[i]<clipLowerLeft)
out[i] = clipLowerLeft;
else
out[i] = in[i];
// clip right channel
if(in[i+1]>clipUpperRight)
out[i+1] = clipUpperRight;
else if(in[i+1]<clipLowerRight)
out[i+1] = clipLowerRight;
else
out[i+1] = in[i+1];
}
}
#endif
SEG_MOD_SLOW_CONST const AMF_ModuleClass AMFClassClipAsym_DS = {
/* Flags */
0,
/* Render function */
(AMF_RenderFunction)AMF_ClipAsym_DS_Render,
/* Default bypass */
(void *)0,
/* Input descriptor - 2 inputs, and they are stereo. */
2, AMF_StereoPin(0)|AMF_StereoPin(1),
/* Output descriptor - 1 output, and it is stereo. */
1, AMF_StereoPin(0)
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -