sac_dec_ssc_struct.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. /***************************************************************************\
  2. *
  3. * (C) copyright Fraunhofer - IIS (2007)
  4. * All Rights Reserved
  5. *
  6. * $Id: sac_dec_ssc_struct.h,v 1.3 2012/05/08 20:16:49 audiodsp Exp $
  7. * project : MPEG surround decoder lib
  8. * contents/description: interface - spatial specific config struct
  9. *
  10. * This software and/or program is protected by copyright law and
  11. * international treaties. Any reproduction or distribution of this
  12. * software and/or program, or any portion of it, may result in severe
  13. * civil and criminal penalties, and will be prosecuted to the maximum
  14. * extent possible under law.
  15. *
  16. \***************************************************************************/
  17. #ifndef __SAC_DEC_SSC_STRUCT_H__
  18. #define __SAC_DEC_SSC_STRUCT_H__
  19. #define MAX_NUM_QMF_BANDS (128)
  20. #define MAX_TIME_SLOTS (72)
  21. #define MAX_INPUT_CHANNELS (6)
  22. #define MAX_OUTPUT_CHANNELS (8)
  23. #define MAX_NUM_OTT (5)
  24. #define MAX_NUM_TTT (1)
  25. #define MAX_NUM_EXT_TYPES ( 8 )
  26. #define MAX_PARAMETER_BANDS (28)
  27. #define MAX_ARBITRARY_TREE_LEVELS ( 2 )
  28. #define MAX_OUTPUT_CHANNELS_AT ( MAX_OUTPUT_CHANNELS * (1<<MAX_ARBITRARY_TREE_LEVELS) )
  29. #define MAX_ARBITRARY_TREE_INDEX ( (1<<(MAX_ARBITRARY_TREE_LEVELS+1))-1 )
  30. typedef enum {
  31. SPATIALDEC_FREQ_RES_40 = 40,
  32. SPATIALDEC_FREQ_RES_28 = 28,
  33. SPATIALDEC_FREQ_RES_23 = 23,
  34. SPATIALDEC_FREQ_RES_20 = 20,
  35. SPATIALDEC_FREQ_RES_15 = 15,
  36. SPATIALDEC_FREQ_RES_14 = 14,
  37. SPATIALDEC_FREQ_RES_10 = 10,
  38. SPATIALDEC_FREQ_RES_7 = 7,
  39. SPATIALDEC_FREQ_RES_5 = 5,
  40. SPATIALDEC_FREQ_RES_4 = 4
  41. } SPATIALDEC_FREQ_RES;
  42. typedef enum {
  43. SPATIALDEC_QUANT_FINE_DEF = 0,
  44. SPATIALDEC_QUANT_EDQ1 = 1,
  45. SPATIALDEC_QUANT_EDQ2 = 2,
  46. SPATIALDEC_QUANT_RSVD3 = 3,
  47. SPATIALDEC_QUANT_RSVD4 = 4,
  48. SPATIALDEC_QUANT_RSVD5 = 5,
  49. SPATIALDEC_QUANT_RSVD6 = 6,
  50. SPATIALDEC_QUANT_RSVD7 = 7
  51. } SPATIALDEC_QUANT_MODE;
  52. typedef enum {
  53. SPATIALDEC_MODE_5151 = 0,
  54. SPATIALDEC_MODE_5152 = 1,
  55. SPATIALDEC_MODE_525 = 2,
  56. SPATIALDEC_MODE_RSVD3 = 3,
  57. SPATIALDEC_MODE_RSVD4 = 4,
  58. SPATIALDEC_MODE_RSVD5 = 5,
  59. SPATIALDEC_MODE_RSVD6 = 6,
  60. SPATIALDEC_MODE_RSVD7 = 7,
  61. SPATIALDEC_MODE_RSVD8 = 8,
  62. SPATIALDEC_MODE_RSVD9 = 9,
  63. SPATIALDEC_MODE_RSVD10 = 10,
  64. SPATIALDEC_MODE_RSVD11 = 11,
  65. SPATIALDEC_MODE_RSVD12 = 12,
  66. SPATIALDEC_MODE_RSVD13 = 13,
  67. SPATIALDEC_MODE_RSVD14 = 14,
  68. SPATIALDEC_MODE_SIGNAL
  69. } SPATIALDEC_TREE_CONFIG;
  70. typedef enum {
  71. SPATIALDEC_GAIN_MODE0 = 0,
  72. SPATIALDEC_GAIN_RSVD1 = 1,
  73. SPATIALDEC_GAIN_RSVD2 = 2,
  74. SPATIALDEC_GAIN_RSVD3 = 3,
  75. SPATIALDEC_GAIN_RSVD4 = 4,
  76. SPATIALDEC_GAIN_RSVD5 = 5,
  77. SPATIALDEC_GAIN_RSVD6 = 6,
  78. SPATIALDEC_GAIN_RSVD7 = 7,
  79. SPATIALDEC_GAIN_RSVD8 = 8,
  80. SPATIALDEC_GAIN_RSVD9 = 9,
  81. SPATIALDEC_GAIN_RSVD10 = 10,
  82. SPATIALDEC_GAIN_RSVD11 = 11,
  83. SPATIALDEC_GAIN_RSVD12 = 12,
  84. SPATIALDEC_GAIN_RSVD13 = 13,
  85. SPATIALDEC_GAIN_RSVD14 = 14,
  86. SPATIALDEC_GAIN_RSVD15 = 15
  87. } SPATIALDEC_FIXED_GAINS;
  88. typedef enum {
  89. SPATIALDEC_TS_TPNOWHITE = 0,
  90. SPATIALDEC_TS_TPWHITE = 1,
  91. SPATIALDEC_TS_TES = 2,
  92. SPATIALDEC_TS_NOTS = 3,
  93. SPATIALDEC_TS_RSVD4 = 4,
  94. SPATIALDEC_TS_RSVD5 = 5,
  95. SPATIALDEC_TS_RSVD6 = 6,
  96. SPATIALDEC_TS_RSVD7 = 7,
  97. SPATIALDEC_TS_RSVD8 = 8,
  98. SPATIALDEC_TS_RSVD9 = 9,
  99. SPATIALDEC_TS_RSVD10 = 10,
  100. SPATIALDEC_TS_RSVD11 = 11,
  101. SPATIALDEC_TS_RSVD12 = 12,
  102. SPATIALDEC_TS_RSVD13 = 13,
  103. SPATIALDEC_TS_RSVD14 = 14,
  104. SPATIALDEC_TS_RSVD15 = 15
  105. } SPATIALDEC_TS_CONF;
  106. typedef enum {
  107. SPATIALDEC_DECORR_MODE0 = 0,
  108. SPATIALDEC_DECORR_MODE1 = 1,
  109. SPATIALDEC_DECORR_MODE2 = 2,
  110. SPATIALDEC_DECORR_RSVD3 = 3,
  111. SPATIALDEC_DECORR_RSVD4 = 4,
  112. SPATIALDEC_DECORR_RSVD5 = 5,
  113. SPATIALDEC_DECORR_RSVD6 = 6,
  114. SPATIALDEC_DECORR_RSVD7 = 7,
  115. SPATIALDEC_DECORR_RSVD8 = 8,
  116. SPATIALDEC_DECORR_RSVD9 = 9,
  117. SPATIALDEC_DECORR_RSVD10 = 10,
  118. SPATIALDEC_DECORR_RSVD11 = 11,
  119. SPATIALDEC_DECORR_RSVD12 = 12,
  120. SPATIALDEC_DECORR_RSVD13 = 13,
  121. SPATIALDEC_DECORR_RSVD14 = 14,
  122. SPATIALDEC_DECORR_RSVD15 = 15
  123. } SPATIALDEC_DECORR_CONF;
  124. typedef struct T_SPATIALDEC_TREE_DESC {
  125. /* tbd */
  126. int tmp;
  127. } SPATIALDEC_TREE_DESC;
  128. typedef struct T_SPATIALDEC_OTT_CONF {
  129. int nOttBands;
  130. } SPATIALDEC_OTT_CONF;
  131. typedef enum {
  132. SPATIALDEC_TTT_PRED_DECORR = 0,
  133. SPATIALDEC_TTT_PRED_NODECORR = 1,
  134. SPATIALDEC_TTT_RSVD2 = 2,
  135. SPATIALDEC_TTT_ENERGY_SUB = 3,
  136. SPATIALDEC_TTT_RSVD4 = 4,
  137. SPATIALDEC_TTT_ENERGY_NOSUB = 5,
  138. SPATIALDEC_TTT_RSVD6 = 6,
  139. SPATIALDEC_TTT_RSVD7 = 7
  140. } SPATIALDEC_TTT_MODE;
  141. typedef struct T_SPATIALDEC_TTT_CONF {
  142. int bTttDualMode;
  143. SPATIALDEC_TTT_MODE tttModeLow;
  144. SPATIALDEC_TTT_MODE tttModeHigh;
  145. int nTttBandsLow;
  146. } SPATIALDEC_TTT_CONF;
  147. typedef struct T_SPATIALDEC_RESIDUAL_CONF {
  148. int bResidualPresent;
  149. int nResidualBands;
  150. } SPATIALDEC_RESIDUAL_CONF;
  151. typedef struct T_SPATIAL_SPECIFIC_CONFIG {
  152. int samplingFreq;
  153. int nTimeSlots;
  154. int LdMode;
  155. SPATIALDEC_FREQ_RES freqRes;
  156. SPATIALDEC_TREE_CONFIG treeConfig;
  157. SPATIALDEC_QUANT_MODE quantMode;
  158. int bOneIcc;
  159. int bArbitraryDownmix;
  160. int arbitraryDownmixResidualSamplingFreq;
  161. int arbitraryDownmixResidualFramesPerSpatialFrame;
  162. int arbitraryDownmixResidualBands;
  163. int bResidualCoding;
  164. SPATIALDEC_FIXED_GAINS bsFixedGainSur;
  165. SPATIALDEC_FIXED_GAINS bsFixedGainLFE;
  166. SPATIALDEC_FIXED_GAINS bsFixedGainDMX;
  167. int bMatrixMode;
  168. SPATIALDEC_TS_CONF tempShapeConfig;
  169. SPATIALDEC_DECORR_CONF decorrConfig;
  170. SPATIALDEC_TREE_DESC *pTreeDesc;
  171. int nInputChannels; /* derived from treeConfig */
  172. int nOutputChannels; /* derived from treeConfig */
  173. /* ott config */
  174. int nOttBoxes; /* derived from treeConfig */
  175. SPATIALDEC_OTT_CONF OttConfig[MAX_NUM_OTT]; /* dimension nOttBoxes */
  176. /* ttt config */
  177. int nTttBoxes; /* derived from treeConfig */
  178. SPATIALDEC_TTT_CONF TttConfig[MAX_NUM_TTT]; /* dimension nTttBoxes */
  179. /* residual config */
  180. int residualSamplingFreq;
  181. int nResidualFramesPerSpatialFrame;
  182. SPATIALDEC_RESIDUAL_CONF ResidualConfig[MAX_NUM_OTT+MAX_NUM_TTT]; /* dimension (nOttBoxes + nTttBoxes) */
  183. int sacExtCnt;
  184. int sacExtType[MAX_NUM_EXT_TYPES];
  185. int envQuantMode;
  186. int bArbitraryTree;
  187. int numOutChanAT;
  188. int numOttBoxesAT;
  189. int OutputChannelPosAT[MAX_OUTPUT_CHANNELS_AT];
  190. int OttBoxPresentAT[MAX_OUTPUT_CHANNELS][MAX_ARBITRARY_TREE_INDEX];
  191. int OttDefaultCldAT[MAX_OUTPUT_CHANNELS*MAX_ARBITRARY_TREE_INDEX];
  192. int OttModeLfeAT[MAX_OUTPUT_CHANNELS*MAX_ARBITRARY_TREE_INDEX];
  193. int OttBandsAT[MAX_OUTPUT_CHANNELS*MAX_ARBITRARY_TREE_INDEX];
  194. int b3DaudioMode;
  195. int b3DaudioHRTFset;
  196. int HRTFfreqRes;
  197. int HRTFnumBand;
  198. int HRTFnumChan;
  199. int HRTFasymmetric;
  200. int HRTFlevelLeft[MAX_OUTPUT_CHANNELS][MAX_PARAMETER_BANDS];
  201. int HRTFlevelRight[MAX_OUTPUT_CHANNELS][MAX_PARAMETER_BANDS];
  202. int HRTFphase[MAX_OUTPUT_CHANNELS];
  203. int HRTFphaseLR[MAX_OUTPUT_CHANNELS][MAX_PARAMETER_BANDS];
  204. int HRTFicc[MAX_OUTPUT_CHANNELS];
  205. int HRTFiccLR[MAX_OUTPUT_CHANNELS][MAX_PARAMETER_BANDS];
  206. } SPATIAL_SPECIFIC_CONFIG;
  207. #endif