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.4KB

  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. /* @name ltp_coef
  34. * Table of the LTP coefficients
  35. */
  36. static const INTFLOAT ltp_coef[8] = {
  37. Q30(0.570829f), Q30(0.696616f), Q30(0.813004f), Q30(0.911304f),
  38. Q30(0.984900f), Q30(1.067894f), Q30(1.194601f), Q30(1.369533f),
  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 INTFLOAT tns_tmp2_map_1_3[4] = {
  47. Q31(0.00000000f), Q31(-0.43388373f), Q31(0.64278758f), Q31(0.34202015f),
  48. };
  49. static const INTFLOAT tns_tmp2_map_0_3[8] = {
  50. Q31(0.00000000f), Q31(-0.43388373f), Q31(-0.78183150f), Q31(-0.97492790f),
  51. Q31(0.98480773f), Q31( 0.86602539f), Q31( 0.64278758f), Q31( 0.34202015f),
  52. };
  53. static const INTFLOAT tns_tmp2_map_1_4[8] = {
  54. Q31(0.00000000f), Q31(-0.20791170f), Q31(-0.40673664f), Q31(-0.58778524f),
  55. Q31(0.67369562f), Q31( 0.52643216f), Q31( 0.36124167f), Q31( 0.18374951f),
  56. };
  57. static const INTFLOAT tns_tmp2_map_0_4[16] = {
  58. Q31( 0.00000000f), Q31(-0.20791170f), Q31(-0.40673664f), Q31(-0.58778524f),
  59. Q31(-0.74314481f), Q31(-0.86602539f), Q31(-0.95105654f), Q31(-0.99452192f),
  60. Q31( 0.99573416f), Q31( 0.96182561f), Q31( 0.89516330f), Q31( 0.79801720f),
  61. Q31( 0.67369562f), Q31( 0.52643216f), Q31( 0.36124167f), Q31( 0.18374951f),
  62. };
  63. static const INTFLOAT * 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 */