⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 amf_delayoffchip.c

📁 ADI SHARC DSP 音频算法标准模块库
💻 C
字号:

// Copyright(c) 2005 Analog Devices, Inc. All Rights Reserved. ADI Confidential.

#include "AMF_DelayOffChip.h"

void AMF_DelayOffChip_Render(AMF_DelayOffChip * restrict instance,float * restrict * buffers,int tickSize);


#if 0
SEG_MOD_FAST_CODE  void AMF_DelayOffChip_Render(AMF_DelayOffChip * 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;
	
	// weird kludge to get the compiler to actually set the B0 register...
	bufPtr = delayBuffer;
	bufPtr = __builtin_circptr(bufPtr, writeIndex, delayBuffer, delay);		

#if 0

#pragma loop_count(8,1024,8)
	for (i=0; i<tickSize; i++) {
		tmp = *bufPtr;
		*bufPtr = in[i];
		bufPtr = __builtin_circptr(bufPtr, 1, delayBuffer, delay);		
 		out[i] = tmp;
    }    
   	instance->delayWritePtr = bufPtr;

#else
   	
#pragma loop_count(8,1024,8)
	for (i=0; i<tickSize; i++) {
 		out[i] = *bufPtr;
		bufPtr = __builtin_circptr(bufPtr, 1, delayBuffer, delay);		
    }    

	// weird kludge to get the compiler to actually set the B0 register...
	bufPtr = delayBuffer;
	bufPtr = __builtin_circptr(bufPtr, writeIndex, delayBuffer, delay);		

#pragma loop_count(8,1024,8)
	for (i=0; i<tickSize; i++) {
		*bufPtr = in[i];
		bufPtr = __builtin_circptr(bufPtr, 1, delayBuffer, delay);		
    }    
   	instance->delayWritePtr = bufPtr;
#endif
}
#endif


SEG_MOD_SLOW_CONST const AMF_ModuleClass AMFClassDelayOffChip = {
    
    /* Flags */
	0,

	/** Reference to render function. */
	(AMF_RenderFunction)AMF_DelayOffChip_Render,  // render function 

    /* Default bypass */
	(void *)0,

	/* Input descriptor - 1 input, and it is mono. */
	1, 0,

	/* Output descriptor - 1 output, and it is mono. */
    1, 0,
};


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -