aacdectab.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * AAC decoder data
  3. * Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
  4. * Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
  5. *
  6. * This file is part of FFmpeg.
  7. *
  8. * FFmpeg is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * FFmpeg is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with FFmpeg; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. */
  22. /**
  23. * @file
  24. * AAC decoder data
  25. * @author Oded Shimon ( ods15 ods15 dyndns org )
  26. * @author Maxim Gavrilov ( maxim.gavrilov gmail com )
  27. */
  28. #ifndef AVCODEC_AACDECTAB_H
  29. #define AVCODEC_AACDECTAB_H
  30. #include "libavutil/channel_layout.h"
  31. #include "aac.h"
  32. #include <stdint.h>
  33. static const int8_t tags_per_config[16] = { 0, 1, 1, 2, 3, 3, 4, 5, 0, 0, 0, 4, 5, 16, 5, 0 };
  34. static const uint8_t aac_channel_layout_map[16][16][3] = {
  35. { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, },
  36. { { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, },
  37. { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, },
  38. { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_SCE, 1, AAC_CHANNEL_BACK }, },
  39. { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, },
  40. { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, },
  41. { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_FRONT }, { TYPE_CPE, 2, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, },
  42. { { 0, } },
  43. { { 0, } },
  44. { { 0, } },
  45. { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, { TYPE_SCE, 1, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, },
  46. { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_SIDE }, { TYPE_CPE, 2, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, },
  47. {
  48. { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, // SCE1 = FC,
  49. { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, // CPE1 = FLc and FRc,
  50. { TYPE_CPE, 1, AAC_CHANNEL_FRONT }, // CPE2 = FL and FR,
  51. { TYPE_CPE, 2, AAC_CHANNEL_SIDE }, // CPE3 = SiL and SiR,
  52. { TYPE_CPE, 3, AAC_CHANNEL_BACK }, // CPE4 = BL and BR,
  53. { TYPE_SCE, 1, AAC_CHANNEL_BACK }, // SCE2 = BC,
  54. { TYPE_LFE, 0, AAC_CHANNEL_LFE }, // LFE1 = LFE1,
  55. { TYPE_LFE, 1, AAC_CHANNEL_LFE }, // LFE2 = LFE2,
  56. { TYPE_SCE, 2, AAC_CHANNEL_FRONT }, // SCE3 = TpFC,
  57. { TYPE_CPE, 4, AAC_CHANNEL_FRONT }, // CPE5 = TpFL and TpFR,
  58. { TYPE_CPE, 5, AAC_CHANNEL_SIDE }, // CPE6 = TpSiL and TpSiR,
  59. { TYPE_SCE, 3, AAC_CHANNEL_FRONT }, // SCE4 = TpC,
  60. { TYPE_CPE, 6, AAC_CHANNEL_BACK }, // CPE7 = TpBL and TpBR,
  61. { TYPE_SCE, 4, AAC_CHANNEL_BACK }, // SCE5 = TpBC,
  62. { TYPE_SCE, 5, AAC_CHANNEL_FRONT }, // SCE6 = BtFC,
  63. { TYPE_CPE, 7, AAC_CHANNEL_FRONT }, // CPE8 = BtFL and BtFR
  64. },
  65. { { 0, } },
  66. /* TODO: Add 7+1 TOP configuration */
  67. };
  68. static const uint64_t aac_channel_layout[16] = {
  69. AV_CH_LAYOUT_MONO,
  70. AV_CH_LAYOUT_STEREO,
  71. AV_CH_LAYOUT_SURROUND,
  72. AV_CH_LAYOUT_4POINT0,
  73. AV_CH_LAYOUT_5POINT0_BACK,
  74. AV_CH_LAYOUT_5POINT1_BACK,
  75. AV_CH_LAYOUT_7POINT1_WIDE_BACK,
  76. 0,
  77. 0,
  78. 0,
  79. AV_CH_LAYOUT_6POINT1,
  80. AV_CH_LAYOUT_7POINT1,
  81. AV_CH_LAYOUT_22POINT2,
  82. 0,
  83. /* AV_CH_LAYOUT_7POINT1_TOP, */
  84. };
  85. #endif /* AVCODEC_AACDECTAB_H */