allpass.h
来自「从FFMPEG转换而来的H264解码程序,VC下编译..」· C头文件 代码 · 共 60 行
H
60 行
// Allpass filter
//
// Written by Jezar at Dreampoint, June 2000
// http://www.dreampoint.co.uk
// This code is public domain
#ifndef _allpass_
#define _allpass_
#include "denormals.h"
class allpass
{
public:
allpass()
{
bufidx = 0;
}
void setbuffer(float *buf, int size)
{
buffer = buf;
bufsize = size;
}
__forceinline float process(float input)
{
float output;
float bufout;
bufout = buffer[bufidx];
undenormalise(bufout);
output = -input + bufout;
buffer[bufidx] = input + (bufout*feedback);
if(++bufidx>=bufsize) bufidx = 0;
return output;
}
void mute()
{
for (int i=0; i<bufsize; i++)
buffer[i]=0;
}
void setfeedback(float val)
{
feedback = val;
}
float getfeedback()
{
return feedback;
}
private:
float feedback;
float *buffer;
int bufsize;
int bufidx;
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?