syslib_channelMapDescr.h 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. /* -----------------------------------------------------------------------------
  2. Software License for The Fraunhofer FDK AAC Codec Library for Android
  3. © Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
  4. Forschung e.V. All rights reserved.
  5. 1. INTRODUCTION
  6. The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
  7. that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
  8. scheme for digital audio. This FDK AAC Codec software is intended to be used on
  9. a wide variety of Android devices.
  10. AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
  11. general perceptual audio codecs. AAC-ELD is considered the best-performing
  12. full-bandwidth communications codec by independent studies and is widely
  13. deployed. AAC has been standardized by ISO and IEC as part of the MPEG
  14. specifications.
  15. Patent licenses for necessary patent claims for the FDK AAC Codec (including
  16. those of Fraunhofer) may be obtained through Via Licensing
  17. (www.vialicensing.com) or through the respective patent owners individually for
  18. the purpose of encoding or decoding bit streams in products that are compliant
  19. with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
  20. Android devices already license these patent claims through Via Licensing or
  21. directly from the patent owners, and therefore FDK AAC Codec software may
  22. already be covered under those patent licenses when it is used for those
  23. licensed purposes only.
  24. Commercially-licensed AAC software libraries, including floating-point versions
  25. with enhanced sound quality, are also available from Fraunhofer. Users are
  26. encouraged to check the Fraunhofer website for additional applications
  27. information and documentation.
  28. 2. COPYRIGHT LICENSE
  29. Redistribution and use in source and binary forms, with or without modification,
  30. are permitted without payment of copyright license fees provided that you
  31. satisfy the following conditions:
  32. You must retain the complete text of this software license in redistributions of
  33. the FDK AAC Codec or your modifications thereto in source code form.
  34. You must retain the complete text of this software license in the documentation
  35. and/or other materials provided with redistributions of the FDK AAC Codec or
  36. your modifications thereto in binary form. You must make available free of
  37. charge copies of the complete source code of the FDK AAC Codec and your
  38. modifications thereto to recipients of copies in binary form.
  39. The name of Fraunhofer may not be used to endorse or promote products derived
  40. from this library without prior written permission.
  41. You may not charge copyright license fees for anyone to use, copy or distribute
  42. the FDK AAC Codec software or your modifications thereto.
  43. Your modified versions of the FDK AAC Codec must carry prominent notices stating
  44. that you changed the software and the date of any change. For modified versions
  45. of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
  46. must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
  47. AAC Codec Library for Android."
  48. 3. NO PATENT LICENSE
  49. NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
  50. limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
  51. Fraunhofer provides no warranty of patent non-infringement with respect to this
  52. software.
  53. You may use this FDK AAC Codec software or modifications thereto only for
  54. purposes that are authorized by appropriate patent licenses.
  55. 4. DISCLAIMER
  56. This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
  57. holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  58. including but not limited to the implied warranties of merchantability and
  59. fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  60. CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
  61. or consequential damages, including but not limited to procurement of substitute
  62. goods or services; loss of use, data, or profits, or business interruption,
  63. however caused and on any theory of liability, whether in contract, strict
  64. liability, or tort (including negligence), arising in any way out of the use of
  65. this software, even if advised of the possibility of such damage.
  66. 5. CONTACT INFORMATION
  67. Fraunhofer Institute for Integrated Circuits IIS
  68. Attention: Audio and Multimedia Departments - FDK AAC LL
  69. Am Wolfsmantel 33
  70. 91058 Erlangen, Germany
  71. www.iis.fraunhofer.de/amm
  72. amm-info@iis.fraunhofer.de
  73. ----------------------------------------------------------------------------- */
  74. /************************* System integration library **************************
  75. Author(s): Thomas Dietzen
  76. Description:
  77. *******************************************************************************/
  78. /** \file syslib_channelMapDescr.h
  79. * \brief Function and structure declarations for the channel map descriptor implementation.
  80. */
  81. #ifndef SYSLIB_CHANNELMAPDESCR_H
  82. #define SYSLIB_CHANNELMAPDESCR_H
  83. #include "machine_type.h"
  84. /**
  85. * \brief Contains information needed for a single channel map.
  86. */
  87. typedef struct {
  88. const UCHAR*
  89. pChannelMap; /*!< Actual channel mapping for one single configuration. */
  90. UCHAR numChannels; /*!< The number of channels for the channel map which is
  91. the maximum used channel index+1. */
  92. } CHANNEL_MAP_INFO;
  93. /**
  94. * \brief This is the main data struct. It contains the mapping for all
  95. * channel configurations such as administration information.
  96. *
  97. * CAUTION: Do not access this structure directly from a algorithm specific
  98. * library. Always use one of the API access functions below!
  99. */
  100. typedef struct {
  101. const CHANNEL_MAP_INFO* pMapInfoTab; /*!< Table of channel maps. */
  102. UINT mapInfoTabLen; /*!< Length of the channel map table array. */
  103. UINT fPassThrough; /*!< Flag that defines whether the specified mapping shall
  104. be applied (value: 0) or the input just gets passed
  105. through (MPEG mapping). */
  106. } FDK_channelMapDescr;
  107. #ifdef __cplusplus
  108. extern "C" {
  109. #endif
  110. /**
  111. * \brief Initialize a given channel map descriptor.
  112. *
  113. * \param pMapDescr Pointer to a channel map descriptor to be initialized.
  114. * \param pMapInfoTab Table of channel maps to initizalize the descriptor
  115. with.
  116. * If a NULL pointer is given a default table for
  117. WAV-like mapping will be used.
  118. * \param mapInfoTabLen Length of the channel map table array (pMapInfoTab).
  119. If a zero length is given a default table for WAV-like mapping will be used.
  120. * \param fPassThrough If the flag is set the reordering (given by
  121. pMapInfoTab) will be bypassed.
  122. */
  123. void FDK_chMapDescr_init(FDK_channelMapDescr* const pMapDescr,
  124. const CHANNEL_MAP_INFO* const pMapInfoTab,
  125. const UINT mapInfoTabLen, const UINT fPassThrough);
  126. /**
  127. * \brief Change the channel reordering state of a given channel map
  128. * descriptor.
  129. *
  130. * \param pMapDescr Pointer to a (initialized) channel map descriptor.
  131. * \param fPassThrough If the flag is set the reordering (given by
  132. * pMapInfoTab) will be bypassed.
  133. * \return Value unequal to zero if set operation was not
  134. * successful. And zero on success.
  135. */
  136. int FDK_chMapDescr_setPassThrough(FDK_channelMapDescr* const pMapDescr,
  137. UINT fPassThrough);
  138. /**
  139. * \brief Get the mapping value for a specific channel and map index.
  140. *
  141. * \param pMapDescr Pointer to channel map descriptor.
  142. * \param chIdx Channel index.
  143. * \param mapIdx Mapping index (corresponding to the channel configuration
  144. * index).
  145. * \return Mapping value.
  146. */
  147. UCHAR FDK_chMapDescr_getMapValue(const FDK_channelMapDescr* const pMapDescr,
  148. const UCHAR chIdx, const UINT mapIdx);
  149. /**
  150. * \brief Evaluate whether channel map descriptor is reasonable or not.
  151. *
  152. * \param pMapDescr Pointer to channel map descriptor.
  153. * \return Value unequal to zero if descriptor is valid, otherwise
  154. * zero.
  155. */
  156. int FDK_chMapDescr_isValid(const FDK_channelMapDescr* const pMapDescr);
  157. /**
  158. * Extra variables for setting up Wg4 channel mapping.
  159. */
  160. extern const CHANNEL_MAP_INFO FDK_mapInfoTabWg4[];
  161. extern const UINT FDK_mapInfoTabLenWg4;
  162. #ifdef __cplusplus
  163. }
  164. #endif
  165. #endif /* !defined(SYSLIB_CHANNELMAPDESCR_H) */