tables.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * MPEG layer 3 tables include file
  3. *
  4. * Copyright (c) 1999 Albert L Faber
  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 LAME_TABLES_H
  22. #define LAME_TABLES_H
  23. #include "machine.h"
  24. typedef struct {
  25. unsigned char no;
  26. unsigned char width;
  27. unsigned char minval_2;
  28. float quiet_thr;
  29. float norm;
  30. float bark;
  31. } type1_t;
  32. typedef struct {
  33. unsigned char no;
  34. unsigned char width;
  35. float quiet_thr;
  36. float norm;
  37. float SNR;
  38. float bark;
  39. } type2_t;
  40. typedef struct {
  41. unsigned int no : 5;
  42. unsigned int cbw : 3;
  43. unsigned int bu : 6;
  44. unsigned int bo : 6;
  45. unsigned int w1_576 : 10;
  46. unsigned int w2_576 : 10;
  47. } type34_t;
  48. typedef struct {
  49. size_t len1;
  50. const type1_t* const tab1;
  51. size_t len2;
  52. const type2_t* const tab2;
  53. size_t len3;
  54. const type34_t* const tab3;
  55. size_t len4;
  56. const type34_t* const tab4;
  57. } type5_t;
  58. extern const type5_t table5 [6];
  59. #define HTN 34
  60. struct huffcodetab {
  61. const int xlen; /* max. x-index+ */
  62. const int linmax; /* max number to be stored in linbits */
  63. const short* table; /* pointer to array[xlen][ylen] */
  64. const char* hlen; /* pointer to array[xlen][ylen] */
  65. };
  66. extern const struct huffcodetab ht [HTN];
  67. /* global memory block */
  68. /* array of all huffcodtable headers */
  69. /* 0..31 Huffman code table 0..31 */
  70. /* 32,33 count1-tables */
  71. extern const char t32l [];
  72. extern const char t33l [];
  73. extern const unsigned int largetbl [16*16];
  74. extern const unsigned int table23 [3*3];
  75. extern const unsigned int table56 [4*4];
  76. #endif /* LAME_TABLES_H */