7 /* These are the necessary scales for first-order HF responses to play over
8 * higher-order 2D (non-periphonic) decoders.
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
29 struct BFormatDec
*bformatdec_alloc();
30 void bformatdec_free(struct BFormatDec
*dec
);
31 int bformatdec_getOrder(const struct BFormatDec
*dec
);
32 void bformatdec_reset(struct BFormatDec
*dec
, const struct AmbDecConf
*conf
, ALsizei chancount
, ALuint srate
, const ALsizei chanmap
[MAX_OUTPUT_CHANNELS
]);
34 /* Decodes the ambisonic input to the given output channels. */
35 void bformatdec_process(struct BFormatDec
*dec
, ALfloat (*restrict OutBuffer
)[BUFFERSIZE
], ALsizei OutChannels
, const ALfloat (*restrict InSamples
)[BUFFERSIZE
], ALsizei SamplesToDo
);
37 /* Up-samples a first-order input to the decoder's configuration. */
38 void bformatdec_upSample(struct BFormatDec
*dec
, ALfloat (*restrict OutBuffer
)[BUFFERSIZE
], const ALfloat (*restrict InSamples
)[BUFFERSIZE
], ALsizei InChannels
, ALsizei SamplesToDo
);
41 /* Stand-alone first-order upsampler. Kept here because it shares some stuff
44 struct AmbiUpsampler
*ambiup_alloc();
45 void ambiup_free(struct AmbiUpsampler
*ambiup
);
46 void ambiup_reset(struct AmbiUpsampler
*ambiup
, const ALCdevice
*device
);
48 void ambiup_process(struct AmbiUpsampler
*ambiup
, ALfloat (*restrict OutBuffer
)[BUFFERSIZE
], ALsizei OutChannels
, const ALfloat (*restrict InSamples
)[BUFFERSIZE
], ALsizei SamplesToDo
);
51 /* Band splitter. Splits a signal into two phase-matching frequency bands. */
52 typedef struct BandSplitter
{
59 void bandsplit_init(BandSplitter
*splitter
, ALfloat freq_mult
);
60 void bandsplit_clear(BandSplitter
*splitter
);
61 void bandsplit_process(BandSplitter
*splitter
, ALfloat
*restrict hpout
, ALfloat
*restrict lpout
,
62 const ALfloat
*input
, ALsizei count
);
64 #endif /* BFORMATDEC_H */