L2tables.h
上传用户:lusi_8715
上传日期:2007-01-08
资源大小:199k
文件大小:9k
源码类别:

流媒体/Mpeg4/MP4

开发平台:

Visual C++

  1. /**************************************************************************************
  2.  *                                                                                    *
  3.  * This application contains code from OpenDivX and is released as a "Larger Work"    *
  4.  * under that license. Consistant with that license, this application is released     *
  5.  * under the GNU General Public License.                                              *
  6.  *                                                                                    *
  7.  * The OpenDivX license can be found at: http://www.projectmayo.com/opendivx/docs.php *
  8.  * The GPL can be found at: http://www.gnu.org/copyleft/gpl.html                      *
  9.  *                                                                                    *
  10.  * Authors: Damien Chavarria <roy204 at projectmayo.com>                              *
  11.  *                                                                                    *
  12.  **************************************************************************************/
  13.  /*
  14.  * Layer 2 Alloc tables .. 
  15.  * most other tables are calculated on program start (which is (of course)
  16.  * not ISO-conform) .. 
  17.  * Layer-3 huffman table is in huffman.h
  18.  */
  19. struct al_table
  20. {
  21.   short bits;
  22.   short d;
  23. };
  24. struct al_table alloc_0[] = {
  25. {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
  26. {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
  27. {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
  28. {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
  29. {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
  30. {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
  31. {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
  32. {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
  33. {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
  34. {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
  35. {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
  36. {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
  37. {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
  38. {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
  39. {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
  40. {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
  41. {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
  42. {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
  43. {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
  44. {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
  45. {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
  46. {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
  47. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  48. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  49. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  50. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  51. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  52. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  53. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  54. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  55. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  56. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  57. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  58. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  59. {2,0},{5,3},{7,5},{16,-32767},
  60. {2,0},{5,3},{7,5},{16,-32767},
  61. {2,0},{5,3},{7,5},{16,-32767},
  62. {2,0},{5,3},{7,5},{16,-32767} };
  63. struct al_table alloc_1[] = {
  64. {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
  65. {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
  66. {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
  67. {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
  68. {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
  69. {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
  70. {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
  71. {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
  72. {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
  73. {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
  74. {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
  75. {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
  76. {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
  77. {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
  78. {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
  79. {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
  80. {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
  81. {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
  82. {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
  83. {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
  84. {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
  85. {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
  86. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  87. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  88. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  89. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  90. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  91. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  92. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  93. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  94. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  95. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  96. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  97. {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
  98. {2,0},{5,3},{7,5},{16,-32767},
  99. {2,0},{5,3},{7,5},{16,-32767},
  100. {2,0},{5,3},{7,5},{16,-32767},
  101. {2,0},{5,3},{7,5},{16,-32767},
  102. {2,0},{5,3},{7,5},{16,-32767},
  103. {2,0},{5,3},{7,5},{16,-32767},
  104. {2,0},{5,3},{7,5},{16,-32767} };
  105. struct al_table alloc_2[] = {
  106. {4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},
  107. {10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},
  108. {4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},
  109. {10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},
  110. {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
  111. {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
  112. {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
  113. {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
  114. {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
  115. {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63} };
  116. struct al_table alloc_3[] = {
  117. {4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},
  118. {10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},
  119. {4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},
  120. {10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},
  121. {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
  122. {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
  123. {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
  124. {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
  125. {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
  126. {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
  127. {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
  128. {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
  129. {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
  130. {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63} };
  131. struct al_table alloc_4[] = {
  132. {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
  133. {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},
  134. {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
  135. {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},
  136. {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
  137. {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},
  138. {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
  139. {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},
  140. {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
  141. {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
  142. {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
  143. {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
  144. {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
  145. {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
  146. {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
  147. {2,0},{5,3},{7,5},{10,9},
  148. {2,0},{5,3},{7,5},{10,9},
  149. {2,0},{5,3},{7,5},{10,9},
  150. {2,0},{5,3},{7,5},{10,9},
  151. {2,0},{5,3},{7,5},{10,9},
  152. {2,0},{5,3},{7,5},{10,9},
  153. {2,0},{5,3},{7,5},{10,9},
  154. {2,0},{5,3},{7,5},{10,9},
  155. {2,0},{5,3},{7,5},{10,9},
  156. {2,0},{5,3},{7,5},{10,9},
  157. {2,0},{5,3},{7,5},{10,9},
  158.     {2,0},{5,3},{7,5},{10,9},
  159.     {2,0},{5,3},{7,5},{10,9},
  160.     {2,0},{5,3},{7,5},{10,9},
  161.     {2,0},{5,3},{7,5},{10,9},
  162.     {2,0},{5,3},{7,5},{10,9},
  163.     {2,0},{5,3},{7,5},{10,9},
  164.     {2,0},{5,3},{7,5},{10,9},
  165.     {2,0},{5,3},{7,5},{10,9}  };