mpegaudio.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * copyright (c) 2001 Fabrice Bellard
  3. *
  4. * This file is part of FFmpeg.
  5. *
  6. * FFmpeg is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * FFmpeg is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with FFmpeg; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. /**
  21. * @file
  22. * mpeg audio declarations for both encoder and decoder.
  23. */
  24. #ifndef AVCODEC_MPEGAUDIO_H
  25. #define AVCODEC_MPEGAUDIO_H
  26. #ifndef USE_FLOATS
  27. # define USE_FLOATS 0
  28. #endif
  29. #include <stdint.h>
  30. #include "libavutil/internal.h"
  31. /* max frame size, in samples */
  32. #define MPA_FRAME_SIZE 1152
  33. /* max compressed frame size */
  34. #define MPA_MAX_CODED_FRAME_SIZE 1792
  35. #define MPA_MAX_CHANNELS 2
  36. #define SBLIMIT 32 /* number of subbands */
  37. #define MPA_STEREO 0
  38. #define MPA_JSTEREO 1
  39. #define MPA_DUAL 2
  40. #define MPA_MONO 3
  41. #ifndef FRAC_BITS
  42. #define FRAC_BITS 23 /* fractional bits for sb_samples and dct */
  43. #define WFRAC_BITS 16 /* fractional bits for window */
  44. #endif
  45. #define IMDCT_SCALAR 1.759
  46. #define FRAC_ONE (1 << FRAC_BITS)
  47. #define FIX(a) ((int)((a) * FRAC_ONE))
  48. #if USE_FLOATS
  49. # define INTFLOAT float
  50. # define SUINTFLOAT float
  51. typedef float MPA_INT;
  52. typedef float OUT_INT;
  53. #elif FRAC_BITS <= 15
  54. # define INTFLOAT int
  55. # define SUINTFLOAT SUINT
  56. typedef int16_t MPA_INT;
  57. typedef int16_t OUT_INT;
  58. #else
  59. # define INTFLOAT int
  60. # define SUINTFLOAT SUINT
  61. typedef int32_t MPA_INT;
  62. typedef int16_t OUT_INT;
  63. #endif
  64. int ff_mpa_l2_select_table(int bitrate, int nb_channels, int freq, int lsf);
  65. #endif /* AVCODEC_MPEGAUDIO_H */