📄 amf_delay_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_Delay_S.c#3 $
// Part of : VisualAudio V2.5.0
// Updated : $Date: 2006/10/12 $ by $Author: Fernando $
#include "AMF_Delay_S.h"
void AMF_Delay_S_Render(AMF_Delay_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
SEG_MOD_FAST_CODE void AMF_Delay_S_Render(AMF_Delay_S * restrict instance,float * restrict * buffers,int tickSize) {
int delay = instance->delay; // delay in samples
float *delayBuffer = &instance->delayBuffer[0]; // delay buffer
int writeIndex = instance->delayWritePtr-delayBuffer; // delay index
int i;
float tmp;
float *in = buffers[0]; // Don't use restrict because we say they can alias (see .h file)
float *out = buffers[1];
float *bufPtr;
int bufferLen = 2*delay;
// weird kludge to get the compiler to actually set the B0 register...
bufPtr = delayBuffer;
bufPtr = __builtin_circptr(bufPtr, writeIndex, delayBuffer, bufferLen);
// the asm does this loop in SIMD
for (i=0; i<2*tickSize; i++) {
tmp = *bufPtr;
*bufPtr = in[i];
bufPtr = __builtin_circptr(bufPtr, 1, delayBuffer, bufferLen);
out[i] = tmp;
}
instance->delayWritePtr = bufPtr;
}
#endif
SEG_MOD_SLOW_CONST const AMF_ModuleClass AMFClassDelay_S = {
/* Flags */
0,
/** Reference to render function. */
(AMF_RenderFunction)AMF_Delay_S_Render,
/* Default bypass */
(void *)0,
/* Input descriptor - 1 input, and it is stereo. */
1, AMF_StereoPin(0),
/* Output descriptor - 1 output, and it is stereo. */
1, AMF_StereoPin(0)
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -