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.

89 lines
2.6KB

  1. /*
  2. * AAC definitions and structures
  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 aac.h
  24. * AAC definitions and structures
  25. * @author Oded Shimon ( ods15 ods15 dyndns org )
  26. * @author Maxim Gavrilov ( maxim.gavrilov gmail com )
  27. */
  28. #ifndef FFMPEG_AAC_H
  29. #define FFMPEG_AAC_H
  30. #include "avcodec.h"
  31. #include "dsputil.h"
  32. #include "mpeg4audio.h"
  33. #include <stdint.h>
  34. #define AAC_INIT_VLC_STATIC(num, size) \
  35. INIT_VLC_STATIC(&vlc_spectral[num], 6, ff_aac_spectral_sizes[num], \
  36. ff_aac_spectral_bits[num], sizeof( ff_aac_spectral_bits[num][0]), sizeof( ff_aac_spectral_bits[num][0]), \
  37. ff_aac_spectral_codes[num], sizeof(ff_aac_spectral_codes[num][0]), sizeof(ff_aac_spectral_codes[num][0]), \
  38. size);
  39. #define IVQUANT_SIZE 1024
  40. enum WindowSequence {
  41. ONLY_LONG_SEQUENCE,
  42. LONG_START_SEQUENCE,
  43. EIGHT_SHORT_SEQUENCE,
  44. LONG_STOP_SEQUENCE,
  45. };
  46. enum ChannelType {
  47. AAC_CHANNEL_FRONT = 1,
  48. AAC_CHANNEL_SIDE = 2,
  49. AAC_CHANNEL_BACK = 3,
  50. AAC_CHANNEL_LFE = 4,
  51. AAC_CHANNEL_CC = 5,
  52. };
  53. /**
  54. * main AAC context
  55. */
  56. typedef struct {
  57. AVCodecContext * avccontext;
  58. /**
  59. * @defgroup tables Computed / set up during initialization.
  60. * @{
  61. */
  62. MDCTContext mdct;
  63. MDCTContext mdct_small;
  64. DSPContext dsp;
  65. /** @} */
  66. /**
  67. * @defgroup output Members used for output interleaving and down-mixing.
  68. * @{
  69. */
  70. float add_bias; ///< offset for dsp.float_to_int16
  71. float sf_scale; ///< Pre-scale for correct IMDCT and dsp.float_to_int16.
  72. int sf_offset; ///< offset into pow2sf_tab as appropriate for dsp.float_to_int16
  73. /** @} */
  74. } AACContext;
  75. #endif /* FFMPEG_AAC_H */