mpg123.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /*
  2. * Copyright (C) 1999-2010 The L.A.M.E. project
  3. *
  4. * Initially written by Michael Hipp, see also AUTHORS and README.
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Library General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2 of the License, or (at your option) any later version.
  10. *
  11. * This library 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. * Library General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Library General Public
  17. * License along with this library; if not, write to the
  18. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19. * Boston, MA 02111-1307, USA.
  20. */
  21. #ifndef MPG123_H_INCLUDED
  22. #define MPG123_H_INCLUDED
  23. #include <stdio.h>
  24. #ifdef STDC_HEADERS
  25. # include <string.h>
  26. #else
  27. # ifndef HAVE_STRCHR
  28. # define strchr index
  29. # define strrchr rindex
  30. # endif
  31. char *strchr(), *strrchr();
  32. # ifndef HAVE_MEMCPY
  33. # define memcpy(d, s, n) bcopy ((s), (d), (n))
  34. # define memmove(d, s, n) bcopy ((s), (d), (n))
  35. # endif
  36. #endif
  37. #include <signal.h>
  38. #if defined(__riscos__) && defined(FPA10)
  39. #include "ymath.h"
  40. #else
  41. #include <math.h>
  42. #endif
  43. #ifndef M_PI
  44. #define M_PI 3.14159265358979323846
  45. #endif
  46. #ifndef M_SQRT2
  47. #define M_SQRT2 1.41421356237309504880
  48. #endif
  49. #ifndef FALSE
  50. #define FALSE 0
  51. #endif
  52. #ifndef TRUE
  53. #define TRUE 1
  54. #endif
  55. #undef REAL_IS_FLOAT
  56. #define REAL_IS_FLOAT
  57. #ifdef REAL_IS_FLOAT
  58. # define real float
  59. #elif defined(REAL_IS_LONG_DOUBLE)
  60. # define real long double
  61. #else
  62. # define real double
  63. #endif
  64. #define FALSE 0
  65. #define TRUE 1
  66. #define SBLIMIT 32
  67. #define SSLIMIT 18
  68. #define MPG_MD_STEREO 0
  69. #define MPG_MD_JOINT_STEREO 1
  70. #define MPG_MD_DUAL_CHANNEL 2
  71. #define MPG_MD_MONO 3
  72. #define MAXFRAMESIZE 2880
  73. /* AF: ADDED FOR LAYER1/LAYER2 */
  74. #define SCALE_BLOCK 12
  75. /* Pre Shift fo 16 to 8 bit converter table */
  76. #define AUSHIFT (3)
  77. struct frame {
  78. int stereo;
  79. int single; /* single channel (monophonic) */
  80. int lsf; /* 0 = MPEG-1, 1 = MPEG-2/2.5 */
  81. int mpeg25; /* 1 = MPEG-2.5, 0 = MPEG-1/2 */
  82. int header_change;
  83. int lay; /* Layer */
  84. int error_protection; /* 1 = CRC-16 code following header */
  85. int bitrate_index;
  86. int sampling_frequency; /* sample rate of decompressed audio in Hz */
  87. int padding;
  88. int extension;
  89. int mode;
  90. int mode_ext;
  91. int copyright;
  92. int original;
  93. int emphasis;
  94. int framesize; /* computed framesize */
  95. /* AF: ADDED FOR LAYER1/LAYER2 */
  96. int II_sblimit;
  97. struct al_table2 const *alloc;
  98. int down_sample_sblimit;
  99. int down_sample;
  100. };
  101. struct gr_info_s {
  102. int scfsi;
  103. unsigned part2_3_length;
  104. unsigned big_values;
  105. unsigned scalefac_compress;
  106. unsigned block_type;
  107. unsigned mixed_block_flag;
  108. unsigned table_select[3];
  109. unsigned subblock_gain[3];
  110. unsigned maxband[3];
  111. unsigned maxbandl;
  112. unsigned maxb;
  113. unsigned region1start;
  114. unsigned region2start;
  115. unsigned preflag;
  116. unsigned scalefac_scale;
  117. unsigned count1table_select;
  118. real *full_gain[3];
  119. real *pow2gain;
  120. };
  121. struct III_sideinfo {
  122. unsigned main_data_begin;
  123. unsigned private_bits;
  124. struct {
  125. struct gr_info_s gr[2];
  126. } ch[2];
  127. };
  128. #endif