You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

118 lines
4.1KB

  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 Libav.
  7. *
  8. * Libav 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. * Libav 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 Libav; 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. /* @name ltp_coef
  34. * Table of the LTP coefficients
  35. */
  36. static const float ltp_coef[8] = {
  37. 0.570829, 0.696616, 0.813004, 0.911304,
  38. 0.984900, 1.067894, 1.194601, 1.369533,
  39. };
  40. /* @name tns_tmp2_map
  41. * Tables of the tmp2[] arrays of LPC coefficients used for TNS.
  42. * The suffix _M_N[] indicate the values of coef_compress and coef_res
  43. * respectively.
  44. * @{
  45. */
  46. static const float tns_tmp2_map_1_3[4] = {
  47. 0.00000000, -0.43388373, 0.64278758, 0.34202015,
  48. };
  49. static const float tns_tmp2_map_0_3[8] = {
  50. 0.00000000, -0.43388373, -0.78183150, -0.97492790,
  51. 0.98480773, 0.86602539, 0.64278758, 0.34202015,
  52. };
  53. static const float tns_tmp2_map_1_4[8] = {
  54. 0.00000000, -0.20791170, -0.40673664, -0.58778524,
  55. 0.67369562, 0.52643216, 0.36124167, 0.18374951,
  56. };
  57. static const float tns_tmp2_map_0_4[16] = {
  58. 0.00000000, -0.20791170, -0.40673664, -0.58778524,
  59. -0.74314481, -0.86602539, -0.95105654, -0.99452192,
  60. 0.99573416, 0.96182561, 0.89516330, 0.79801720,
  61. 0.67369562, 0.52643216, 0.36124167, 0.18374951,
  62. };
  63. static const float * const tns_tmp2_map[4] = {
  64. tns_tmp2_map_0_3,
  65. tns_tmp2_map_0_4,
  66. tns_tmp2_map_1_3,
  67. tns_tmp2_map_1_4
  68. };
  69. // @}
  70. static const int8_t tags_per_config[16] = { 0, 1, 1, 2, 3, 3, 4, 5, 0, 0, 0, 4, 5, 0, 5, 0 };
  71. static const uint8_t aac_channel_layout_map[16][5][3] = {
  72. { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, },
  73. { { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, },
  74. { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, },
  75. { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_SCE, 1, AAC_CHANNEL_BACK }, },
  76. { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, },
  77. { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, },
  78. { { 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 }, },
  79. { { 0, } },
  80. { { 0, } },
  81. { { 0, } },
  82. { { 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 }, },
  83. { { 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 }, },
  84. { { 0, } },
  85. /* TODO: Add 7+1 TOP configuration */
  86. };
  87. static const uint64_t aac_channel_layout[16] = {
  88. AV_CH_LAYOUT_MONO,
  89. AV_CH_LAYOUT_STEREO,
  90. AV_CH_LAYOUT_SURROUND,
  91. AV_CH_LAYOUT_4POINT0,
  92. AV_CH_LAYOUT_5POINT0_BACK,
  93. AV_CH_LAYOUT_5POINT1_BACK,
  94. AV_CH_LAYOUT_7POINT1_WIDE_BACK,
  95. 0,
  96. 0,
  97. 0,
  98. AV_CH_LAYOUT_6POINT1,
  99. AV_CH_LAYOUT_7POINT1,
  100. 0,
  101. /* AV_CH_LAYOUT_7POINT1_TOP, */
  102. };
  103. #endif /* AVCODEC_AACDECTAB_H */