fmdcode.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * Copyright (c) 1983-2013 Richard Dobson and Composers Desktop Project Ltd
  3. * http://people.bath.ac.uk/masrwd
  4. * http://www.composersdesktop.com
  5. * This file is part of the CDP System.
  6. * The CDP System is free software; you can redistribute it
  7. * and/or modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * The CDP System is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. * See the GNU Lesser General Public License for more details.
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with the CDP System; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. *
  19. */
  20. /* fmdcode.h */
  21. /*
  22. Channel order is WXYZ,RSTUV,KLMNOPQ
  23. The number of channels defines the order of the soundfield:
  24. 2 channel = UHJ
  25. 3 channel = h = 1st order horizontal
  26. 4 channel = f = 1st order 3-D
  27. 5 channel = hh = 2nd order horizontal
  28. 6 channel = fh = 2nd order horizontal + 1st order height (formerly
  29. called 2.5 order)
  30. 7 channel = hhh = 3rd order horizontal
  31. 8 channel = fhh = 3rd order horizontal + 1st order height
  32. 9 channel = ff = 2nd order 3-D
  33. 11 channel = ffh = 3rd order horizontal + 2nd order height
  34. 16 channel = fff = 3rd order 3-D
  35. Horizontal Height Soundfield Number of Channels
  36. order order type channels
  37. 1 0 horizontal 3 WXY
  38. 1 1 full-sphere 4 WXYZ
  39. 2 0 horizontal 5 WXY....UV
  40. 2 1 mixed-order 6 WXYZ...UV
  41. 2 2 full-sphere 9 WXYZRSTUV
  42. 3 0 horizontal 7 WXY....UV.....PQ
  43. 3 1 mixed-order 8 WXYZ...UV.....PQ
  44. 3 2 mixed-order 11 WXYZRSTUV.....PQ
  45. 3 3 full-sphere 16 WXYZRSTUVKLMNOPQ
  46. */
  47. typedef struct abf_samp {
  48. float W;
  49. float X;
  50. float Y;
  51. float Z;
  52. float R;
  53. float S;
  54. float T;
  55. float U;
  56. float V;
  57. } ABFSAMPLE;
  58. typedef void (*fmhcopyfunc)(ABFSAMPLE*,const float*);
  59. typedef void (*fmhdecodefunc)(const ABFSAMPLE*, float*,unsigned int);
  60. //void bfdcode4(float *inbuf,long numframes);
  61. void fmhcopy_3(ABFSAMPLE* abf,const float*buf);
  62. void fmhcopy_4(ABFSAMPLE* abf,const float*buf);
  63. void fmhcopy_5(ABFSAMPLE* abf,const float*buf);
  64. void fmhcopy_6(ABFSAMPLE* abf,const float*buf);
  65. void fmhcopy_7(ABFSAMPLE* abf,const float*buf);
  66. void fmhcopy_8(ABFSAMPLE* abf,const float*buf);
  67. void fmhcopy_9(ABFSAMPLE* abf,const float*buf);
  68. void fmhcopy_11(ABFSAMPLE* abf,const float*buf);
  69. void fmhcopy_16(ABFSAMPLE* abf,const float*buf);
  70. // i1 = inphase 1st order, etc
  71. void fm_i1_mono(const ABFSAMPLE *inbuf,float *outbuf,unsigned int numframes);
  72. void fm_i1_stereo(const ABFSAMPLE *inbuf,float *outbuf,unsigned int numframes);
  73. void fm_i1_square(const ABFSAMPLE *inbuf,float *outbuf,unsigned int numframes);
  74. void fm_i2_square(const ABFSAMPLE *inbuf,float *outbuf,unsigned int numframes);
  75. void fm_i1_quad(const ABFSAMPLE *inbuf,float *outbuf,unsigned int numframes);
  76. void fm_i2_quad(const ABFSAMPLE *inbuf,float *outbuf,unsigned int numframes);
  77. void fm_i1_pent(const ABFSAMPLE *inbuf,float *outbuf,unsigned int numframes);
  78. void fm_i2_pent(const ABFSAMPLE *inbuf,float *outbuf,unsigned int numframes);
  79. void fm_i1_surr(const ABFSAMPLE *inbuf,float *outbuf,unsigned int numframes);
  80. void fm_i2_surr(const ABFSAMPLE *inbuf,float*outbuf,unsigned int numframes);
  81. void fm_i1_surr6(const ABFSAMPLE *inbuf,float *outbuf,unsigned int numframes);
  82. void fm_i2_surr6(const ABFSAMPLE *inbuf,float*outbuf,unsigned int numframes);
  83. void dm_i1_surr(const ABFSAMPLE *inbuf,float*outbuf,unsigned int numframes);
  84. void dm_i1_surr6(const ABFSAMPLE *inbuf,float*outbuf,unsigned int numframes);
  85. void dm_i2_surr(const ABFSAMPLE *inbuf,float*outbuf,unsigned int numframes);
  86. void dm_i2_surr6(const ABFSAMPLE *inbuf,float*outbuf,unsigned int numframes);
  87. void fm_i1_hex(const ABFSAMPLE *inbuf,float *outbuf,unsigned int numframes);
  88. void fm_i2_hex(const ABFSAMPLE *inbuf,float *outbuf,unsigned int numframes);
  89. void fm_i1_oct1(const ABFSAMPLE *inbuf,float *outbuf,unsigned int numframes);
  90. void fm_i2_oct1(const ABFSAMPLE *inbuf,float *outbuf,unsigned int numframes);
  91. void fm_i1_oct2(const ABFSAMPLE *inbuf,float *outbuf,unsigned int numframes);
  92. void fm_i2_oct2(const ABFSAMPLE *inbuf,float *outbuf,unsigned int numframes);
  93. void fm_i1_cube(const ABFSAMPLE *inbuf,float *outbuf,unsigned int numframes);
  94. void fm_i2_cube(const ABFSAMPLE *inbuf,float *outbuf,unsigned int numframes);
  95. void fm_i1_cubex(const ABFSAMPLE *inbuf,float *outbuf,unsigned int numframes);
  96. void fm_i2_cubex(const ABFSAMPLE *inbuf,float *outbuf,unsigned int numframes);