Update OpenAL-soft to 1.21.1

This commit is contained in:
Miku AuahDark
2021-02-11 18:04:50 +08:00
parent 08f227997e
commit 904cc75ba8
358 changed files with 61122 additions and 60973 deletions
+23 -56
View File
@@ -1,71 +1,38 @@
#ifndef ALCOMPLEX_H
#define ALCOMPLEX_H
#include "AL/al.h"
#include <complex>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct ALcomplex {
ALdouble Real;
ALdouble Imag;
} ALcomplex;
/** Addition of two complex numbers. */
inline ALcomplex complex_add(ALcomplex a, ALcomplex b)
{
ALcomplex result;
result.Real = a.Real + b.Real;
result.Imag = a.Imag + b.Imag;
return result;
}
/** Subtraction of two complex numbers. */
inline ALcomplex complex_sub(ALcomplex a, ALcomplex b)
{
ALcomplex result;
result.Real = a.Real - b.Real;
result.Imag = a.Imag - b.Imag;
return result;
}
/** Multiplication of two complex numbers. */
inline ALcomplex complex_mult(ALcomplex a, ALcomplex b)
{
ALcomplex result;
result.Real = a.Real*b.Real - a.Imag*b.Imag;
result.Imag = a.Imag*b.Real + a.Real*b.Imag;
return result;
}
#include "alspan.h"
/**
* Iterative implementation of 2-radix FFT (In-place algorithm). Sign = -1 is
* FFT and 1 is iFFT (inverse). Fills FFTBuffer[0...FFTSize-1] with the
* Discrete Fourier Transform (DFT) of the time domain data stored in
* FFTBuffer[0...FFTSize-1]. FFTBuffer is an array of complex numbers, FFTSize
* MUST BE power of two.
* FFT and 1 is inverse FFT. Applies the Discrete Fourier Transform (DFT) to
* the data supplied in the buffer, which MUST BE power of two.
*/
void complex_fft(ALcomplex *FFTBuffer, ALsizei FFTSize, ALdouble Sign);
void complex_fft(const al::span<std::complex<double>> buffer, const double sign);
/**
* Calculate the frequency-domain response of the time-domain signal in the
* provided buffer, which MUST BE power of two.
*/
inline void forward_fft(const al::span<std::complex<double>> buffer)
{ complex_fft(buffer, -1.0); }
/**
* Calculate the time-domain signal of the frequency-domain response in the
* provided buffer, which MUST BE power of two.
*/
inline void inverse_fft(const al::span<std::complex<double>> buffer)
{ complex_fft(buffer, 1.0); }
/**
* Calculate the complex helical sequence (discrete-time analytical signal) of
* the given input using the discrete Hilbert transform (In-place algorithm).
* Fills Buffer[0...size-1] with the discrete-time analytical signal stored in
* Buffer[0...size-1]. Buffer is an array of complex numbers, size MUST BE
* power of two.
* Fills the buffer with the discrete-time analytical signal stored in the
* buffer. The buffer is an array of complex numbers and MUST BE power of two,
* and the imaginary components should be cleared to 0.
*/
void complex_hilbert(ALcomplex *Buffer, ALsizei size);
#ifdef __cplusplus
} // extern "C"
#endif
void complex_hilbert(const al::span<std::complex<double>> buffer);
#endif /* ALCOMPLEX_H */