Use unique_ptr for BFormatDec and AmbiUpsampler
[openal-soft.git] / Alc / filters / nfc.h
blobd59280d00a5077c5f3a4ad42ca90e499347fc6bf
1 #ifndef FILTER_NFC_H
2 #define FILTER_NFC_H
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
8 struct NfcFilter1 {
9 float base_gain, gain;
10 float b1, a1;
11 float z[1];
13 struct NfcFilter2 {
14 float base_gain, gain;
15 float b1, b2, a1, a2;
16 float z[2];
18 struct NfcFilter3 {
19 float base_gain, gain;
20 float b1, b2, b3, a1, a2, a3;
21 float z[3];
24 typedef struct NfcFilter {
25 struct NfcFilter1 first;
26 struct NfcFilter2 second;
27 struct NfcFilter3 third;
28 } NfcFilter;
31 /* NOTE:
32 * w0 = speed_of_sound / (source_distance * sample_rate);
33 * w1 = speed_of_sound / (control_distance * sample_rate);
35 * Generally speaking, the control distance should be approximately the average
36 * speaker distance, or based on the reference delay if outputing NFC-HOA. It
37 * must not be negative, 0, or infinite. The source distance should not be too
38 * small relative to the control distance.
41 void NfcFilterCreate(NfcFilter *nfc, const float w0, const float w1);
42 void NfcFilterAdjust(NfcFilter *nfc, const float w0);
44 /* Near-field control filter for first-order ambisonic channels (1-3). */
45 void NfcFilterProcess1(NfcFilter *nfc, float *RESTRICT dst, const float *RESTRICT src, const int count);
47 /* Near-field control filter for second-order ambisonic channels (4-8). */
48 void NfcFilterProcess2(NfcFilter *nfc, float *RESTRICT dst, const float *RESTRICT src, const int count);
50 /* Near-field control filter for third-order ambisonic channels (9-15). */
51 void NfcFilterProcess3(NfcFilter *nfc, float *RESTRICT dst, const float *RESTRICT src, const int count);
53 #ifdef __cplusplus
54 } // extern "C"
55 #endif
57 #endif /* FILTER_NFC_H */