Remove the separate surround51rear decoder option
[openal-soft.git] / Alc / bformatdec.h
blob97f36d0edbdf748801e65a84440145f1276f78b6
1 #ifndef BFORMATDEC_H
2 #define BFORMATDEC_H
4 #include "alMain.h"
7 /* These are the necessary scales for first-order HF responses to play over
8 * higher-order 2D (non-periphonic) decoders.
9 */
10 #define W_SCALE2D_SECOND 1.224744871f /* sqrt(1.5) */
11 #define XYZ_SCALE2D_SECOND 1.0f
12 #define W_SCALE2D_THIRD 1.414213562f /* sqrt(2) */
13 #define XYZ_SCALE2D_THIRD 1.082392196f
15 /* These are the necessary scales for first-order HF responses to play over
16 * higher-order 3D (periphonic) decoders.
18 #define W_SCALE3D_SECOND 1.341640787f /* sqrt(1.8) */
19 #define XYZ_SCALE3D_SECOND 1.0f
20 #define W_SCALE3D_THIRD 1.695486018f
21 #define XYZ_SCALE3D_THIRD 1.136697713f
24 struct AmbDecConf;
25 struct BFormatDec;
26 struct AmbiUpsampler;
28 enum BFormatDecFlags {
29 BFDF_DistanceComp = 1<<0
32 struct BFormatDec *bformatdec_alloc();
33 void bformatdec_free(struct BFormatDec *dec);
34 int bformatdec_getOrder(const struct BFormatDec *dec);
35 int bformatdec_isPeriphonic(const struct BFormatDec *dec);
36 void bformatdec_reset(struct BFormatDec *dec, const struct AmbDecConf *conf, ALsizei chancount, ALuint srate, const ALsizei chanmap[MAX_OUTPUT_CHANNELS]);
38 /* Decodes the ambisonic input to the given output channels. */
39 void bformatdec_process(struct BFormatDec *dec, ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALsizei OutChannels, const ALfloat (*restrict InSamples)[BUFFERSIZE], ALsizei SamplesToDo);
41 /* Up-samples a first-order input to the decoder's configuration. */
42 void bformatdec_upSample(struct BFormatDec *dec, ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat (*restrict InSamples)[BUFFERSIZE], ALsizei InChannels, ALsizei SamplesToDo);
45 /* Stand-alone first-order upsampler. Kept here because it shares some stuff
46 * with bformatdec.
48 struct AmbiUpsampler *ambiup_alloc();
49 void ambiup_free(struct AmbiUpsampler *ambiup);
50 void ambiup_reset(struct AmbiUpsampler *ambiup, const ALCdevice *device);
52 void ambiup_process(struct AmbiUpsampler *ambiup, ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALsizei OutChannels, const ALfloat (*restrict InSamples)[BUFFERSIZE], ALsizei SamplesToDo);
55 /* Band splitter. Splits a signal into two phase-matching frequency bands. */
56 typedef struct BandSplitter {
57 ALfloat coeff;
58 ALfloat lp_z1;
59 ALfloat lp_z2;
60 ALfloat hp_z1;
61 } BandSplitter;
63 void bandsplit_init(BandSplitter *splitter, ALfloat freq_mult);
64 void bandsplit_clear(BandSplitter *splitter);
65 void bandsplit_process(BandSplitter *splitter, ALfloat *restrict hpout, ALfloat *restrict lpout,
66 const ALfloat *input, ALsizei count);
68 #endif /* BFORMATDEC_H */