1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-27 14:09:33 +02:00
audacity/src/effects/Biquad.h
James Crook e94fa1d65e Fix compilation on MSVC2013 Express.
MSVC2013 Express does not support some initialisation syntax for structs and instead gives error C2905.
This workaround to get us compiling again may need revisiting.
2017-03-18 16:07:15 +00:00

40 lines
1.0 KiB
C

#ifndef __BIQUAD_H__
#define __BIQUAD_H__
#if 0
//initialisations not supported in MSVC 2013.
//Gives error C2905
// Do not make conditional on compiler.
typedef struct {
float* pfIn {};
float* pfOut {};
float fNumerCoeffs [3] { 1.0f, 0.0f, 0.0f }; // B0 B1 B2
float fDenomCoeffs [2] { 0.0f, 0.0f }; // A1 A2
float fPrevIn {};
float fPrevPrevIn {};
float fPrevOut {};
float fPrevPrevOut {};
} BiquadStruct;
#else
// WARNING: This structure may need initialisation.
typedef struct {
float* pfIn;
float* pfOut;
float fNumerCoeffs [3]; // B0 B1 B2
float fDenomCoeffs [2]; // A1 A2
float fPrevIn;
float fPrevPrevIn;
float fPrevOut;
float fPrevPrevOut;
} BiquadStruct;
#endif
void Biquad_Process (BiquadStruct* pBQ, int iNumSamples);
void ComplexDiv (float fNumerR, float fNumerI, float fDenomR, float fDenomI, float* pfQuotientR, float* pfQuotientI);
bool BilinTransform (float fSX, float fSY, float* pfZX, float* pfZY);
float Calc2D_DistSqr (float fX1, float fY1, float fX2, float fY2);
#endif