bformatdec.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef BFORMATDEC_H
  2. #define BFORMATDEC_H
  3. #include "alMain.h"
  4. struct AmbDecConf;
  5. struct BFormatDec;
  6. struct AmbiUpsampler;
  7. enum BFormatDecFlags {
  8. BFDF_DistanceComp = 1<<0
  9. };
  10. struct BFormatDec *bformatdec_alloc();
  11. void bformatdec_free(struct BFormatDec *dec);
  12. int bformatdec_getOrder(const struct BFormatDec *dec);
  13. void bformatdec_reset(struct BFormatDec *dec, const struct AmbDecConf *conf, ALuint chancount, ALuint srate, const ALuint chanmap[MAX_OUTPUT_CHANNELS], int flags);
  14. /* Decodes the ambisonic input to the given output channels. */
  15. void bformatdec_process(struct BFormatDec *dec, ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint OutChannels, const ALfloat (*restrict InSamples)[BUFFERSIZE], ALuint SamplesToDo);
  16. /* Up-samples a first-order input to the decoder's configuration. */
  17. void bformatdec_upSample(struct BFormatDec *dec, ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat (*restrict InSamples)[BUFFERSIZE], ALuint InChannels, ALuint SamplesToDo);
  18. /* Stand-alone first-order upsampler. Kept here because it shares some stuff
  19. * with bformatdec.
  20. */
  21. struct AmbiUpsampler *ambiup_alloc();
  22. void ambiup_free(struct AmbiUpsampler *ambiup);
  23. void ambiup_reset(struct AmbiUpsampler *ambiup, const ALCdevice *device);
  24. void ambiup_process(struct AmbiUpsampler *ambiup, ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint OutChannels, const ALfloat (*restrict InSamples)[BUFFERSIZE], ALuint SamplesToDo);
  25. /* Band splitter. Splits a signal into two phase-matching frequency bands. */
  26. typedef struct BandSplitter {
  27. ALfloat coeff;
  28. ALfloat lp_z1;
  29. ALfloat lp_z2;
  30. ALfloat hp_z1;
  31. } BandSplitter;
  32. void bandsplit_init(BandSplitter *splitter, ALfloat freq_mult);
  33. void bandsplit_clear(BandSplitter *splitter);
  34. void bandsplit_process(BandSplitter *splitter, ALfloat *restrict hpout, ALfloat *restrict lpout,
  35. const ALfloat *input, ALuint count);
  36. #endif /* BFORMATDEC_H */