1
0

programcfg_c.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /***************************************************************************\
  2. *
  3. * (C) copyright Fraunhofer - IIS (2002)
  4. * All Rights Reserved
  5. *
  6. * $Header: /cvs/root/winamp/aacdec/incs/mp4dec_asc/programcfg_c.h,v 1.3 2012/05/08 20:16:50 audiodsp Exp $
  7. * project : MPEG-4 Audio Decoder
  8. * contents/description: program config specific description
  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 __PROGRAMCFGC_H__
  18. #define __PROGRAMCFGC_H__
  19. #include "mp4dec_helpers/cubuffer_c.h"
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif /* __cplusplus */
  23. struct CSBitStream;
  24. enum
  25. {
  26. /* PCE settings */
  27. CSProgramConfig_FrontRow = 0,
  28. CSProgramConfig_SideRow = 1,
  29. CSProgramConfig_BackRow = 2,
  30. CSProgramConfig_SpeakerRows = 3,
  31. CSProgramConfig_MaximumChannels = 16,
  32. CSProgramConfig_MaximumCommentLength = 256,
  33. /* aac profile definitions */
  34. CAAC_ProfileMain = 0,
  35. CAAC_ProfileLowComplexity,
  36. CAAC_ProfileSSR,
  37. CAAC_ProfileLTP,
  38. CAAC_ProfileScalable,
  39. CAAC_ProfileReserved
  40. };
  41. typedef struct CSProgramConfig
  42. {
  43. /* non-multichannel configuration */
  44. int m_NonMC_ConfigSet;
  45. int m_NonMC_IsCPE;
  46. int m_NonMC_Tag;
  47. /* */
  48. int m_ExplicitMapping;
  49. int m_Profile;
  50. int m_SamplingFrequencyIndex;
  51. int m_NumLfeChannelElements;
  52. int m_NumAssocDataElements;
  53. int m_NumValidCcElements;
  54. int m_MonoMixdownPresent;
  55. int m_MonoMixdownElementNumber;
  56. int m_StereoMixdownPresent;
  57. int m_StereoMixdownElementNumber;
  58. int m_MatrixMixdownIndexPresent;
  59. int m_MatrixMixdownIndex;
  60. int m_PseudoSurroundEnable;
  61. unsigned int m_NumberOfChannels[CSProgramConfig_SpeakerRows];
  62. int m_NumberOfChannelElements[CSProgramConfig_SpeakerRows];
  63. int m_ChannelElementIsCpe[CSProgramConfig_SpeakerRows][CSProgramConfig_MaximumChannels];
  64. unsigned int m_ChannelElementTagSelect[CSProgramConfig_SpeakerRows][CSProgramConfig_MaximumChannels];
  65. unsigned int m_LfeElementTagSelect[CSProgramConfig_MaximumChannels];
  66. unsigned int m_AssocDataElementTagSelect[CSProgramConfig_MaximumChannels];
  67. int m_CcElementIsIndSw[CSProgramConfig_MaximumChannels];
  68. unsigned int m_ValidCcElementTagSelect[CSProgramConfig_MaximumChannels];
  69. int m_CommentFieldBytes;
  70. unsigned char m_Comment[CSProgramConfig_MaximumCommentLength];
  71. } CSProgramConfig, *CSProgramConfigPtr;
  72. /* methods */
  73. void CSProgramConfig_Initialize(CSProgramConfigPtr self);
  74. void CSProgramConfig_Read (CSProgramConfigPtr self, struct CSBitStream *bs);
  75. void CSProgramConfig_ReadExt (CSProgramConfigPtr self, struct CSBitStream *bs, CCompositionUnitPtr cubuffer, const unsigned int tag);
  76. void CSProgramConfig_Copy (CSProgramConfigPtr dst, const CSProgramConfigPtr src);
  77. int CSProgramConfig_AddChannel(CSProgramConfigPtr self, const unsigned int tag, const unsigned int isCPE);
  78. int CSProgramConfig_AddSingleChannel (CSProgramConfigPtr self, const unsigned int tag);
  79. int CSProgramConfig_AddChannelPair (CSProgramConfigPtr self, const unsigned int tag);
  80. int CSProgramConfig_AddCouplingChannel (CSProgramConfigPtr self, const unsigned int tag);
  81. int CSProgramConfig_AddLowFrequencyChannel(CSProgramConfigPtr self, const unsigned int tag);
  82. int CSProgramConfig_IsChannelLocatedAt (CSProgramConfigPtr self, const unsigned int row, const unsigned int tag);
  83. int CSProgramConfig_IsChannelPairLocatedAt(CSProgramConfigPtr self, const unsigned int row, const unsigned int tag);
  84. /* explicit query */
  85. /* query by index */
  86. int CSProgramConfig_GetNumberOfElements(CSProgramConfigPtr self, const unsigned int row);
  87. int CSProgramConfig_GetNumberOfChannels(CSProgramConfigPtr self);
  88. int CSProgramConfig_GetNumberOfChannelsPerRow(CSProgramConfigPtr self, const unsigned int row);
  89. int CSProgramConfig_GetElementTag(CSProgramConfigPtr self, const unsigned int row, const unsigned int index);
  90. int CSProgramConfig_IsChannelPair(CSProgramConfigPtr self, const unsigned int row, const unsigned int index);
  91. int CSProgramConfig_GetNumberOfLowFrequencyChannels(CSProgramConfigPtr self);
  92. int CSProgramConfig_GetLowFrequencyChannelTag (CSProgramConfigPtr self, const unsigned int index);
  93. /* */
  94. int CSProgramConfig_GetSamplingRateIndex(CSProgramConfigPtr self);
  95. int CSProgramConfig_GetProfile (CSProgramConfigPtr self);
  96. #ifdef __cplusplus
  97. }
  98. #endif
  99. #endif