dcahuff.h 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076
  1. /*
  2. * DCA compatible decoder - huffman tables
  3. * Copyright (C) 2004 Gildas Bazin
  4. * Copyright (C) 2007 Konstantin Shishkov
  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. #ifndef AVCODEC_DCAHUFF_H
  23. #define AVCODEC_DCAHUFF_H
  24. #include <stdint.h>
  25. #include <stdlib.h>
  26. #define TMODE_COUNT 4
  27. static const uint8_t tmode_vlc_bits[TMODE_COUNT] = { 3, 3, 3, 2 };
  28. static const uint16_t tmode_codes[TMODE_COUNT][4] = {
  29. { 0x0000, 0x0002, 0x0006, 0x0007 },
  30. { 0x0002, 0x0006, 0x0007, 0x0000 },
  31. { 0x0006, 0x0007, 0x0000, 0x0002 },
  32. { 0x0000, 0x0001, 0x0002, 0x0003 }
  33. };
  34. static const uint8_t tmode_bits[TMODE_COUNT][4] = {
  35. { 1, 2, 3, 3 },
  36. { 2, 3, 3, 1 },
  37. { 3, 3, 1, 2 },
  38. { 2, 2, 2, 2 }
  39. };
  40. #define BITALLOC_12_COUNT 5
  41. #define BITALLOC_12_VLC_BITS 9
  42. static const uint8_t bitalloc_12_vlc_bits[BITALLOC_12_COUNT] = {
  43. 9, 7, 7, 9, 9
  44. };
  45. static const uint16_t bitalloc_12_codes[BITALLOC_12_COUNT][12] = {
  46. {
  47. 0x0000, 0x0002, 0x0006, 0x000E, 0x001E, 0x003E, 0x00FF, 0x00FE,
  48. 0x01FB, 0x01FA, 0x01F9, 0x01F8,
  49. },
  50. {
  51. 0x0001, 0x0000, 0x0002, 0x000F, 0x000C, 0x001D, 0x0039, 0x0038,
  52. 0x0037, 0x0036, 0x0035, 0x0034,
  53. },
  54. {
  55. 0x0000, 0x0007, 0x0005, 0x0004, 0x0002, 0x000D, 0x000C, 0x0006,
  56. 0x000F, 0x001D, 0x0039, 0x0038,
  57. },
  58. {
  59. 0x0003, 0x0002, 0x0000, 0x0002, 0x0006, 0x000E, 0x001E, 0x003E,
  60. 0x007E, 0x00FE, 0x01FF, 0x01FE,
  61. },
  62. {
  63. 0x0001, 0x0000, 0x0002, 0x0006, 0x000E, 0x003F, 0x003D, 0x007C,
  64. 0x0079, 0x0078, 0x00FB, 0x00FA,
  65. }
  66. };
  67. static const uint8_t bitalloc_12_bits[BITALLOC_12_COUNT][12] = {
  68. { 1, 2, 3, 4, 5, 6, 8, 8, 9, 9, 9, 9 },
  69. { 1, 2, 3, 5, 5, 6, 7, 7, 7, 7, 7, 7 },
  70. { 2, 3, 3, 3, 3, 4, 4, 4, 5, 6, 7, 7 },
  71. { 2, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10 },
  72. { 1, 2, 3, 4, 5, 7, 7, 8, 8, 8, 9, 9 }
  73. };
  74. #define SCALES_COUNT 5
  75. #define SCALES_VLC_BITS 9
  76. static const uint16_t scales_codes[SCALES_COUNT][129] = {
  77. {
  78. 0x3AB0, 0x3AB2, 0x3AB4, 0x3AB6, 0x3AB8, 0x3ABA, 0x3ABC, 0x3ABE,
  79. 0x3AC0, 0x3AC2, 0x3AC4, 0x3AC6, 0x3AC8, 0x3ACA, 0x3ACC, 0x3ACE,
  80. 0x3AD0, 0x3AD2, 0x3AD4, 0x3AD6, 0x3AD8, 0x3ADA, 0x3ADC, 0x3ADE,
  81. 0x3AE0, 0x3AE2, 0x3AE4, 0x3AE6, 0x3AE8, 0x3AEA, 0x3AEC, 0x3AEE,
  82. 0x3AF0, 0x3AF2, 0x3AF4, 0x3AF6, 0x3AF8, 0x3AFA, 0x3AFC, 0x3AFE,
  83. 0x0540, 0x0542, 0x0544, 0x0546, 0x0548, 0x054A, 0x054C, 0x054E,
  84. 0x0558, 0x055E, 0x02AD, 0x0154, 0x0754, 0x03A8, 0x0056, 0x0028,
  85. 0x00E8, 0x004A, 0x000B, 0x003B, 0x0013, 0x0003, 0x000F, 0x0005,
  86. 0x0001, 0x0006, 0x0000, 0x0008, 0x001C, 0x0004, 0x0024, 0x004B,
  87. 0x00E9, 0x0029, 0x0057, 0x03A9, 0x0755, 0x0155, 0x02AE, 0x055F,
  88. 0x0559, 0x054F, 0x054D, 0x054B, 0x0549, 0x0547, 0x0545, 0x0543,
  89. 0x0541, 0x3AFF, 0x3AFD, 0x3AFB, 0x3AF9, 0x3AF7, 0x3AF5, 0x3AF3,
  90. 0x3AF1, 0x3AEF, 0x3AED, 0x3AEB, 0x3AE9, 0x3AE7, 0x3AE5, 0x3AE3,
  91. 0x3AE1, 0x3ADF, 0x3ADD, 0x3ADB, 0x3AD9, 0x3AD7, 0x3AD5, 0x3AD3,
  92. 0x3AD1, 0x3ACF, 0x3ACD, 0x3ACB, 0x3AC9, 0x3AC7, 0x3AC5, 0x3AC3,
  93. 0x3AC1, 0x3ABF, 0x3ABD, 0x3ABB, 0x3AB9, 0x3AB7, 0x3AB5, 0x3AB3,
  94. 0x3AB1,
  95. },
  96. {
  97. 0x0F60, 0x0F62, 0x0F64, 0x0F66, 0x0F68, 0x0F6A, 0x0F6C, 0x0F6E,
  98. 0x0F70, 0x0F72, 0x0F74, 0x0F76, 0x0F78, 0x0F7A, 0x0F7C, 0x0F7E,
  99. 0x0F80, 0x0F82, 0x0F84, 0x0F86, 0x0F88, 0x0F8A, 0x0F8C, 0x0F8E,
  100. 0x0F90, 0x0F92, 0x0F94, 0x0F96, 0x0F98, 0x0F9A, 0x0F9C, 0x0F9E,
  101. 0x0FA0, 0x0FA2, 0x0FA4, 0x0FA6, 0x0FA8, 0x0FAA, 0x0FAC, 0x0FAE,
  102. 0x0FB0, 0x0FB2, 0x0FB4, 0x0FB6, 0x0FB8, 0x0FBA, 0x0FBC, 0x0FBE,
  103. 0x07A0, 0x07A2, 0x03D2, 0x01EA, 0x00FC, 0x007F, 0x001C, 0x000C,
  104. 0x0004, 0x0034, 0x0010, 0x001B, 0x0009, 0x000B, 0x000E, 0x0001,
  105. 0x0003, 0x0002, 0x000F, 0x000C, 0x000A, 0x0000, 0x0011, 0x0035,
  106. 0x0005, 0x000D, 0x001D, 0x003C, 0x00FD, 0x01EB, 0x03D3, 0x07A3,
  107. 0x07A1, 0x0FBF, 0x0FBD, 0x0FBB, 0x0FB9, 0x0FB7, 0x0FB5, 0x0FB3,
  108. 0x0FB1, 0x0FAF, 0x0FAD, 0x0FAB, 0x0FA9, 0x0FA7, 0x0FA5, 0x0FA3,
  109. 0x0FA1, 0x0F9F, 0x0F9D, 0x0F9B, 0x0F99, 0x0F97, 0x0F95, 0x0F93,
  110. 0x0F91, 0x0F8F, 0x0F8D, 0x0F8B, 0x0F89, 0x0F87, 0x0F85, 0x0F83,
  111. 0x0F81, 0x0F7F, 0x0F7D, 0x0F7B, 0x0F79, 0x0F77, 0x0F75, 0x0F73,
  112. 0x0F71, 0x0F6F, 0x0F6D, 0x0F6B, 0x0F69, 0x0F67, 0x0F65, 0x0F63,
  113. 0x0F61,
  114. },
  115. {
  116. 0x51D0, 0x51D2, 0x51D4, 0x51D6, 0x51D8, 0x51DA, 0x51DC, 0x51DE,
  117. 0x51E0, 0x51E2, 0x51E4, 0x51E6, 0x51E8, 0x51EA, 0x51EC, 0x51EE,
  118. 0x51F0, 0x51F2, 0x51F4, 0x51F6, 0x51F8, 0x51FA, 0x51FC, 0x51FE,
  119. 0x70C0, 0x70C2, 0x70C4, 0x70C6, 0x70C8, 0x70CA, 0x70CC, 0x70CE,
  120. 0x70EC, 0x10EA, 0x3868, 0x3877, 0x0876, 0x1C35, 0x0434, 0x0A34,
  121. 0x0E1B, 0x021B, 0x051B, 0x070F, 0x010F, 0x0380, 0x0080, 0x0140,
  122. 0x01C1, 0x0041, 0x00A1, 0x00E2, 0x0022, 0x0052, 0x0072, 0x0012,
  123. 0x002A, 0x003A, 0x000A, 0x0016, 0x001E, 0x0006, 0x000C, 0x0000,
  124. 0x0004, 0x0001, 0x000D, 0x0007, 0x001F, 0x0017, 0x000B, 0x003B,
  125. 0x002B, 0x0013, 0x0073, 0x0053, 0x0023, 0x00E3, 0x00A2, 0x0042,
  126. 0x01C2, 0x0141, 0x0081, 0x0381, 0x028C, 0x010C, 0x051C, 0x021C,
  127. 0x0E1C, 0x0A35, 0x0435, 0x1C3A, 0x0877, 0x0874, 0x3869, 0x10EB,
  128. 0x70ED, 0x70CF, 0x70CD, 0x70CB, 0x70C9, 0x70C7, 0x70C5, 0x70C3,
  129. 0x70C1, 0x51FF, 0x51FD, 0x51FB, 0x51F9, 0x51F7, 0x51F5, 0x51F3,
  130. 0x51F1, 0x51EF, 0x51ED, 0x51EB, 0x51E9, 0x51E7, 0x51E5, 0x51E3,
  131. 0x51E1, 0x51DF, 0x51DD, 0x51DB, 0x51D9, 0x51D7, 0x51D5, 0x51D3,
  132. 0x51D1,
  133. },
  134. {
  135. 0x6F64, 0x6F66, 0x6F68, 0x6F6A, 0x6F6C, 0x6F6E, 0x6F70, 0x6F72,
  136. 0x6F74, 0x6F76, 0x6F78, 0x6F7A, 0x6F7C, 0x6F7E, 0x6F80, 0x6F82,
  137. 0x6F84, 0x6F86, 0x6F88, 0x6F8A, 0x6F8C, 0x6F8E, 0x6F90, 0x6F92,
  138. 0x6F94, 0x6F96, 0x6F98, 0x6F9A, 0x6F9C, 0x6F9E, 0x6FA0, 0x6FA2,
  139. 0x6FA4, 0x6FA6, 0x6FA8, 0x6FAA, 0x6FAC, 0x6FAE, 0x6FB0, 0x6FB2,
  140. 0x6FB4, 0x6FB6, 0x17B4, 0x37DC, 0x0BDB, 0x1BEF, 0x05EE, 0x0DF8,
  141. 0x02F8, 0x06FD, 0x017D, 0x037F, 0x00BF, 0x0040, 0x00C0, 0x0021,
  142. 0x0061, 0x0011, 0x0031, 0x0009, 0x0019, 0x0006, 0x000E, 0x0004,
  143. 0x0000, 0x0005, 0x000F, 0x0007, 0x001A, 0x000A, 0x0036, 0x0016,
  144. 0x006E, 0x002E, 0x00C1, 0x0041, 0x01BC, 0x00BC, 0x037A, 0x017A,
  145. 0x02F9, 0x0DF9, 0x05EF, 0x05EC, 0x1BD8, 0x37DD, 0x17B5, 0x6FB7,
  146. 0x6FB5, 0x6FB3, 0x6FB1, 0x6FAF, 0x6FAD, 0x6FAB, 0x6FA9, 0x6FA7,
  147. 0x6FA5, 0x6FA3, 0x6FA1, 0x6F9F, 0x6F9D, 0x6F9B, 0x6F99, 0x6F97,
  148. 0x6F95, 0x6F93, 0x6F91, 0x6F8F, 0x6F8D, 0x6F8B, 0x6F89, 0x6F87,
  149. 0x6F85, 0x6F83, 0x6F81, 0x6F7F, 0x6F7D, 0x6F7B, 0x6F79, 0x6F77,
  150. 0x6F75, 0x6F73, 0x6F71, 0x6F6F, 0x6F6D, 0x6F6B, 0x6F69, 0x6F67,
  151. 0x6F65,
  152. },
  153. {
  154. 0xDF54, 0xDF56, 0xDFC8, 0xDFCA, 0xDFCC, 0xDFCE, 0xDFD0, 0xDFD2,
  155. 0xDFD4, 0xDFD6, 0xDFD8, 0xDFDA, 0xDFDC, 0xDFDE, 0xDFE0, 0xDFE2,
  156. 0x0FE8, 0x2FEA, 0x6FA8, 0x6FF6, 0x07F5, 0x07F7, 0x37D2, 0x37F9,
  157. 0x03F8, 0x0BF8, 0x0BFB, 0x1BEB, 0x01FA, 0x05FA, 0x09FA, 0x0DFA,
  158. 0x0DFF, 0x00FF, 0x02FF, 0x06FB, 0x007C, 0x017C, 0x027C, 0x027F,
  159. 0x003C, 0x00BC, 0x013C, 0x01BC, 0x001C, 0x005C, 0x009C, 0x00DC,
  160. 0x000C, 0x002C, 0x004C, 0x006C, 0x0004, 0x0014, 0x0024, 0x0034,
  161. 0x0000, 0x0008, 0x0010, 0x0018, 0x001E, 0x0002, 0x0006, 0x000A,
  162. 0x000E, 0x000B, 0x0007, 0x0003, 0x001F, 0x0019, 0x0011, 0x0009,
  163. 0x0001, 0x0035, 0x0025, 0x0015, 0x0005, 0x006D, 0x004D, 0x002D,
  164. 0x000D, 0x00DD, 0x009D, 0x005D, 0x001D, 0x01BD, 0x013D, 0x00BD,
  165. 0x003D, 0x037C, 0x027D, 0x017D, 0x007D, 0x06FC, 0x04FC, 0x02FC,
  166. 0x00FC, 0x0DFB, 0x09FB, 0x05FB, 0x01FB, 0x1BF8, 0x1BE8, 0x0BF9,
  167. 0x03F9, 0x37FA, 0x37D3, 0x17F4, 0x07F6, 0x6FF7, 0x6FA9, 0x2FEB,
  168. 0x0FE9, 0xDFE3, 0xDFE1, 0xDFDF, 0xDFDD, 0xDFDB, 0xDFD9, 0xDFD7,
  169. 0xDFD5, 0xDFD3, 0xDFD1, 0xDFCF, 0xDFCD, 0xDFCB, 0xDFC9, 0xDF57,
  170. 0xDF55,
  171. }
  172. };
  173. static const uint8_t scales_bits[SCALES_COUNT][129] = {
  174. {
  175. 14, 14, 14, 14, 14, 14, 14, 14,
  176. 14, 14, 14, 14, 14, 14, 14, 14,
  177. 14, 14, 14, 14, 14, 14, 14, 14,
  178. 14, 14, 14, 14, 14, 14, 14, 14,
  179. 14, 14, 14, 14, 14, 14, 14, 14,
  180. 13, 13, 13, 13, 13, 13, 13, 13,
  181. 13, 13, 12, 11, 11, 10, 9, 8,
  182. 8, 7, 6, 6, 5, 4, 4, 3,
  183. 2, 3, 3, 4, 5, 5, 6, 7,
  184. 8, 8, 9, 10, 11, 11, 12, 13,
  185. 13, 13, 13, 13, 13, 13, 13, 13,
  186. 13, 14, 14, 14, 14, 14, 14, 14,
  187. 14, 14, 14, 14, 14, 14, 14, 14,
  188. 14, 14, 14, 14, 14, 14, 14, 14,
  189. 14, 14, 14, 14, 14, 14, 14, 14,
  190. 14, 14, 14, 14, 14, 14, 14, 14,
  191. 14,
  192. },
  193. {
  194. 15, 15, 15, 15, 15, 15, 15, 15,
  195. 15, 15, 15, 15, 15, 15, 15, 15,
  196. 15, 15, 15, 15, 15, 15, 15, 15,
  197. 15, 15, 15, 15, 15, 15, 15, 15,
  198. 15, 15, 15, 15, 15, 15, 15, 15,
  199. 15, 15, 15, 15, 15, 15, 15, 15,
  200. 14, 14, 13, 12, 11, 10, 8, 7,
  201. 6, 6, 5, 5, 4, 4, 4, 3,
  202. 3, 3, 4, 4, 4, 4, 5, 6,
  203. 6, 7, 8, 9, 11, 12, 13, 14,
  204. 14, 15, 15, 15, 15, 15, 15, 15,
  205. 15, 15, 15, 15, 15, 15, 15, 15,
  206. 15, 15, 15, 15, 15, 15, 15, 15,
  207. 15, 15, 15, 15, 15, 15, 15, 15,
  208. 15, 15, 15, 15, 15, 15, 15, 15,
  209. 15, 15, 15, 15, 15, 15, 15, 15,
  210. 15,
  211. },
  212. {
  213. 15, 15, 15, 15, 15, 15, 15, 15,
  214. 15, 15, 15, 15, 15, 15, 15, 15,
  215. 15, 15, 15, 15, 15, 15, 15, 15,
  216. 15, 15, 15, 15, 15, 15, 15, 15,
  217. 15, 14, 14, 14, 13, 13, 12, 12,
  218. 12, 11, 11, 11, 10, 10, 9, 9,
  219. 9, 8, 8, 8, 7, 7, 7, 6,
  220. 6, 6, 5, 5, 5, 4, 4, 3,
  221. 3, 3, 4, 4, 5, 5, 5, 6,
  222. 6, 6, 7, 7, 7, 8, 8, 8,
  223. 9, 9, 9, 10, 10, 10, 11, 11,
  224. 12, 12, 12, 13, 13, 13, 14, 14,
  225. 15, 15, 15, 15, 15, 15, 15, 15,
  226. 15, 15, 15, 15, 15, 15, 15, 15,
  227. 15, 15, 15, 15, 15, 15, 15, 15,
  228. 15, 15, 15, 15, 15, 15, 15, 15,
  229. 15,
  230. },
  231. {
  232. 15, 15, 15, 15, 15, 15, 15, 15,
  233. 15, 15, 15, 15, 15, 15, 15, 15,
  234. 15, 15, 15, 15, 15, 15, 15, 15,
  235. 15, 15, 15, 15, 15, 15, 15, 15,
  236. 15, 15, 15, 15, 15, 15, 15, 15,
  237. 15, 15, 14, 14, 13, 13, 12, 12,
  238. 11, 11, 10, 10, 9, 8, 8, 7,
  239. 7, 6, 6, 5, 5, 4, 4, 3,
  240. 2, 3, 4, 4, 5, 5, 6, 6,
  241. 7, 7, 8, 8, 9, 9, 10, 10,
  242. 11, 12, 12, 12, 13, 14, 14, 15,
  243. 15, 15, 15, 15, 15, 15, 15, 15,
  244. 15, 15, 15, 15, 15, 15, 15, 15,
  245. 15, 15, 15, 15, 15, 15, 15, 15,
  246. 15, 15, 15, 15, 15, 15, 15, 15,
  247. 15, 15, 15, 15, 15, 15, 15, 15,
  248. 15,
  249. },
  250. {
  251. 16, 16, 16, 16, 16, 16, 16, 16,
  252. 16, 16, 16, 16, 16, 16, 16, 16,
  253. 15, 15, 15, 15, 14, 14, 14, 14,
  254. 13, 13, 13, 13, 12, 12, 12, 12,
  255. 12, 11, 11, 11, 10, 10, 10, 10,
  256. 9, 9, 9, 9, 8, 8, 8, 8,
  257. 7, 7, 7, 7, 6, 6, 6, 6,
  258. 5, 5, 5, 5, 5, 4, 4, 4,
  259. 4, 4, 4, 4, 5, 5, 5, 5,
  260. 5, 6, 6, 6, 6, 7, 7, 7,
  261. 7, 8, 8, 8, 8, 9, 9, 9,
  262. 9, 10, 10, 10, 10, 11, 11, 11,
  263. 11, 12, 12, 12, 12, 13, 13, 13,
  264. 13, 14, 14, 14, 14, 15, 15, 15,
  265. 15, 16, 16, 16, 16, 16, 16, 16,
  266. 16, 16, 16, 16, 16, 16, 16, 16,
  267. 16,
  268. }
  269. };
  270. static const uint16_t bitalloc_3_codes[3] =
  271. {
  272. 0x0003, 0x0000, 0x0002,
  273. };
  274. static const uint8_t bitalloc_3_bits[3] =
  275. {
  276. 2, 1, 2,
  277. };
  278. static const uint16_t bitalloc_5_codes_a[5] =
  279. {
  280. 0x000F, 0x0006, 0x0000, 0x0002, 0x000E,
  281. };
  282. static const uint16_t bitalloc_5_codes_b[5] =
  283. {
  284. 0x0007, 0x0001, 0x0002, 0x0000, 0x0006,
  285. };
  286. static const uint16_t bitalloc_5_codes_c[5] =
  287. {
  288. 0x0007, 0x0005, 0x0000, 0x0004, 0x0006,
  289. };
  290. static const uint8_t bitalloc_5_bits_a[5] =
  291. {
  292. 4, 3, 1, 2, 4,
  293. };
  294. static const uint8_t bitalloc_5_bits_b[5] =
  295. {
  296. 3, 2, 2, 2, 3,
  297. };
  298. static const uint8_t bitalloc_5_bits_c[5] =
  299. {
  300. 3, 3, 1, 3, 3,
  301. };
  302. static const uint16_t bitalloc_7_codes_a[7] =
  303. {
  304. 0x001E, 0x000E, 0x0005, 0x0000, 0x0006, 0x0004, 0x001F,
  305. };
  306. static const uint16_t bitalloc_7_codes_b[7] =
  307. {
  308. 0x0014, 0x000B, 0x0000, 0x0003, 0x0001, 0x0004, 0x0015,
  309. };
  310. static const uint16_t bitalloc_7_codes_c[7] =
  311. {
  312. 0x0000, 0x0002, 0x0001, 0x0003, 0x0002, 0x0003, 0x0001,
  313. };
  314. static const uint8_t bitalloc_7_bits_a[7] =
  315. {
  316. 5, 4, 3, 1, 3, 3, 5,
  317. };
  318. static const uint8_t bitalloc_7_bits_b[7] =
  319. {
  320. 5, 4, 2, 2, 2, 3, 5,
  321. };
  322. static const uint8_t bitalloc_7_bits_c[7] =
  323. {
  324. 4, 4, 2, 2, 2, 4, 4,
  325. };
  326. static const uint16_t bitalloc_9_codes_a[9] =
  327. {
  328. 0x0030, 0x0019, 0x0009, 0x0005, 0x0000, 0x0007, 0x000D, 0x0008,
  329. 0x0031,
  330. };
  331. static const uint16_t bitalloc_9_codes_b[9] =
  332. {
  333. 0x0018, 0x001A, 0x0002, 0x0007, 0x0002, 0x0000, 0x0003, 0x001B,
  334. 0x0019,
  335. };
  336. static const uint16_t bitalloc_9_codes_c[9] =
  337. {
  338. 0x001C, 0x000F, 0x0002, 0x0007, 0x0002, 0x0000, 0x0006, 0x0006,
  339. 0x001D,
  340. };
  341. static const uint8_t bitalloc_9_bits_a[9] =
  342. {
  343. 6, 5, 4, 3, 1, 3, 4, 4, 6,
  344. };
  345. static const uint8_t bitalloc_9_bits_b[9] =
  346. {
  347. 5, 5, 3, 3, 2, 2, 3, 5, 5,
  348. };
  349. static const uint8_t bitalloc_9_bits_c[9] =
  350. {
  351. 6, 5, 3, 3, 2, 2, 3, 4, 6,
  352. };
  353. static const uint16_t bitalloc_13_codes_a[13] =
  354. {
  355. 0x0070, 0x002E, 0x0039, 0x001D, 0x000C, 0x000F, 0x0000, 0x0004,
  356. 0x000D, 0x000A, 0x0016, 0x002F, 0x0071,
  357. };
  358. static const uint16_t bitalloc_13_codes_b[13] =
  359. {
  360. 0x0038, 0x0010, 0x001D, 0x0007, 0x000F, 0x0005, 0x0000, 0x0006,
  361. 0x0002, 0x0009, 0x0006, 0x0011, 0x0039,
  362. };
  363. static const uint16_t bitalloc_13_codes_c[13] =
  364. {
  365. 0x0004, 0x001A, 0x0003, 0x000E, 0x0000, 0x0003, 0x0005, 0x0004,
  366. 0x0002, 0x000F, 0x000C, 0x001B, 0x0005,
  367. };
  368. static const uint8_t bitalloc_13_bits_a[13] =
  369. {
  370. 7, 6, 6, 5, 4, 4, 1, 3, 4, 4, 5, 6, 7,
  371. };
  372. static const uint8_t bitalloc_13_bits_b[13] =
  373. {
  374. 6, 5, 5, 4, 4, 3, 2, 3, 3, 4, 4, 5, 6,
  375. };
  376. static const uint8_t bitalloc_13_bits_c[13] =
  377. {
  378. 5, 5, 4, 4, 3, 3, 3, 3, 3, 4, 4, 5, 5,
  379. };
  380. static const uint16_t bitalloc_17_codes_a[17] =
  381. {
  382. 0x0154, 0x00AB, 0x002B, 0x000B, 0x0003, 0x000A, 0x0001, 0x0006,
  383. 0x0001, 0x0007, 0x0004, 0x000B, 0x0000, 0x0004, 0x0014, 0x0054,
  384. 0x0155,
  385. };
  386. static const uint16_t bitalloc_17_codes_b[17] =
  387. {
  388. 0x007C, 0x003F, 0x0019, 0x000D, 0x001C, 0x0008, 0x000F, 0x0005,
  389. 0x0000, 0x0006, 0x0002, 0x0009, 0x001D, 0x000E, 0x001E, 0x0018,
  390. 0x007D,
  391. };
  392. static const uint16_t bitalloc_17_codes_c[17] =
  393. {
  394. 0x002C, 0x0017, 0x0005, 0x001C, 0x0003, 0x000A, 0x000F, 0x0003,
  395. 0x0006, 0x0004, 0x0000, 0x000B, 0x0004, 0x001D, 0x000A, 0x0004,
  396. 0x002D,
  397. };
  398. static const uint16_t bitalloc_17_codes_d[17] =
  399. {
  400. 0x0100, 0x0102, 0x0082, 0x0042, 0x0022, 0x0012, 0x000A, 0x0006,
  401. 0x0000, 0x0007, 0x000B, 0x0013, 0x0023, 0x0043, 0x0083, 0x0103,
  402. 0x0101,
  403. };
  404. static const uint16_t bitalloc_17_codes_e[17] =
  405. {
  406. 0x00E8, 0x00F6, 0x0075, 0x0034, 0x003B, 0x001B, 0x001F, 0x0004,
  407. 0x0000, 0x0005, 0x000C, 0x001C, 0x003C, 0x0035, 0x007A, 0x00F7,
  408. 0x00E9,
  409. };
  410. static const uint16_t bitalloc_17_codes_f[17] =
  411. {
  412. 0x0004, 0x0003, 0x001E, 0x0001, 0x0001, 0x000E, 0x0001, 0x0004,
  413. 0x0006, 0x0005, 0x0002, 0x000F, 0x0006, 0x000E, 0x001F, 0x0000,
  414. 0x0005,
  415. };
  416. static const uint16_t bitalloc_17_codes_g[17] =
  417. {
  418. 0x0060, 0x007E, 0x0031, 0x0019, 0x000D, 0x0004, 0x0000, 0x0006,
  419. 0x0002, 0x0007, 0x0001, 0x0005, 0x000E, 0x001E, 0x003E, 0x007F,
  420. 0x0061,
  421. };
  422. static const uint8_t bitalloc_17_bits_a[17] =
  423. {
  424. 12, 11, 9, 7, 5, 4, 3, 3, 2, 3, 3, 4, 4, 6, 8, 10,
  425. 12,
  426. };
  427. static const uint8_t bitalloc_17_bits_b[17] =
  428. {
  429. 8, 7, 6, 5, 5, 4, 4, 3, 2, 3, 3, 4, 5, 5, 6, 6,
  430. 8,
  431. };
  432. static const uint8_t bitalloc_17_bits_c[17] =
  433. {
  434. 7, 6, 5, 5, 4, 4, 4, 3, 3, 3, 3, 4, 4, 5, 5, 5,
  435. 7,
  436. };
  437. static const uint8_t bitalloc_17_bits_d[17] =
  438. {
  439. 9, 9, 8, 7, 6, 5, 4, 3, 1, 3, 4, 5, 6, 7, 8, 9,
  440. 9,
  441. };
  442. static const uint8_t bitalloc_17_bits_e[17] =
  443. {
  444. 8, 8, 7, 6, 6, 5, 5, 3, 1, 3, 4, 5, 6, 6, 7, 8,
  445. 8,
  446. };
  447. static const uint8_t bitalloc_17_bits_f[17] =
  448. {
  449. 8, 7, 6, 5, 4, 4, 3, 3, 3, 3, 3, 4, 4, 5, 6, 6,
  450. 8,
  451. };
  452. static const uint8_t bitalloc_17_bits_g[17] =
  453. {
  454. 8, 8, 7, 6, 5, 4, 3, 3, 2, 3, 3, 4, 5, 6, 7, 8,
  455. 8,
  456. };
  457. static const uint16_t bitalloc_25_codes_a[25] =
  458. {
  459. 0x2854, 0x142B, 0x050B, 0x0143, 0x00A2, 0x0052, 0x002E, 0x0015,
  460. 0x0004, 0x000E, 0x0000, 0x0003, 0x0006, 0x0004, 0x0001, 0x000F,
  461. 0x0005, 0x0016, 0x002F, 0x0053, 0x00A3, 0x00A0, 0x0284, 0x0A14,
  462. 0x2855,
  463. };
  464. static const uint16_t bitalloc_25_codes_b[25] =
  465. {
  466. 0x001C, 0x000F, 0x0005, 0x0000, 0x0030, 0x0036, 0x000E, 0x0019,
  467. 0x0001, 0x0008, 0x000E, 0x0001, 0x0005, 0x0002, 0x000F, 0x0009,
  468. 0x0006, 0x001A, 0x000F, 0x0037, 0x0031, 0x0001, 0x0006, 0x0004,
  469. 0x001D,
  470. };
  471. static const uint16_t bitalloc_25_codes_c[25] =
  472. {
  473. 0x004C, 0x0027, 0x006D, 0x0028, 0x0037, 0x000E, 0x0015, 0x0000,
  474. 0x0005, 0x0008, 0x000B, 0x000E, 0x0001, 0x000F, 0x000C, 0x0009,
  475. 0x0006, 0x0001, 0x001A, 0x000F, 0x0008, 0x0029, 0x0012, 0x006C,
  476. 0x004D,
  477. };
  478. static const uint16_t bitalloc_25_codes_d[25] =
  479. {
  480. 0x0780, 0x0782, 0x03C2, 0x01E2, 0x00FE, 0x0079, 0x003D, 0x001C,
  481. 0x000C, 0x0004, 0x0000, 0x0006, 0x0002, 0x0007, 0x0001, 0x0005,
  482. 0x000D, 0x001D, 0x003E, 0x007E, 0x00FF, 0x01E3, 0x03C3, 0x0783,
  483. 0x0781,
  484. };
  485. static const uint16_t bitalloc_25_codes_e[25] =
  486. {
  487. 0x003C, 0x0092, 0x0018, 0x001F, 0x004E, 0x000D, 0x0025, 0x0004,
  488. 0x0010, 0x0000, 0x000A, 0x0002, 0x0003, 0x0003, 0x000B, 0x0001,
  489. 0x0011, 0x0005, 0x0026, 0x000E, 0x004F, 0x0048, 0x0019, 0x0093,
  490. 0x003D,
  491. };
  492. static const uint16_t bitalloc_25_codes_f[25] =
  493. {
  494. 0x0324, 0x0193, 0x00CE, 0x0065, 0x0024, 0x000C, 0x0013, 0x0004,
  495. 0x0007, 0x000A, 0x000D, 0x000F, 0x0001, 0x0000, 0x000E, 0x000B,
  496. 0x0008, 0x0005, 0x0018, 0x000D, 0x0025, 0x0066, 0x00CF, 0x00C8,
  497. 0x0325,
  498. };
  499. static const uint16_t bitalloc_25_codes_g[25] =
  500. {
  501. 0x03A8, 0x03AE, 0x01D5, 0x0094, 0x0014, 0x004B, 0x000B, 0x003B,
  502. 0x0013, 0x0003, 0x000F, 0x0005, 0x0001, 0x0006, 0x0000, 0x0008,
  503. 0x001C, 0x0004, 0x0024, 0x0074, 0x0015, 0x0095, 0x01D6, 0x03AF,
  504. 0x03A9,
  505. };
  506. static const uint8_t bitalloc_25_bits_a[25] =
  507. {
  508. 14, 13, 11, 9, 8, 7, 6, 5, 4, 4, 3, 3, 3, 3, 3, 4,
  509. 4, 5, 6, 7, 8, 8, 10, 12, 14,
  510. };
  511. static const uint8_t bitalloc_25_bits_b[25] =
  512. {
  513. 9, 8, 7, 6, 6, 6, 5, 5, 4, 4, 4, 3, 3, 3, 4, 4,
  514. 4, 5, 5, 6, 6, 6, 7, 7, 9,
  515. };
  516. static const uint8_t bitalloc_25_bits_c[25] =
  517. {
  518. 8, 7, 7, 6, 6, 5, 5, 4, 4, 4, 4, 4, 3, 4, 4, 4,
  519. 4, 4, 5, 5, 5, 6, 6, 7, 8,
  520. };
  521. static const uint8_t bitalloc_25_bits_d[25] =
  522. {
  523. 12, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 3, 2, 3, 3, 4,
  524. 5, 6, 7, 8, 9, 10, 11, 12, 12,
  525. };
  526. static const uint8_t bitalloc_25_bits_e[25] =
  527. {
  528. 8, 8, 7, 7, 7, 6, 6, 5, 5, 4, 4, 3, 2, 3, 4, 4,
  529. 5, 5, 6, 6, 7, 7, 7, 8, 8,
  530. };
  531. static const uint8_t bitalloc_25_bits_f[25] =
  532. {
  533. 10, 9, 8, 7, 6, 5, 5, 4, 4, 4, 4, 4, 3, 3, 4, 4,
  534. 4, 4, 5, 5, 6, 7, 8, 8, 10,
  535. };
  536. static const uint8_t bitalloc_25_bits_g[25] =
  537. {
  538. 10, 10, 9, 8, 7, 7, 6, 6, 5, 4, 4, 3, 2, 3, 3, 4,
  539. 5, 5, 6, 7, 7, 8, 9, 10, 10,
  540. };
  541. static const uint16_t bitalloc_33_codes_a[33] =
  542. {
  543. 0x1580, 0x1582, 0x0AC2, 0x0562, 0x02B2, 0x015E, 0x00AD, 0x0054,
  544. 0x001C, 0x003C, 0x000F, 0x001F, 0x0008, 0x000B, 0x000D, 0x0000,
  545. 0x0002, 0x0001, 0x000E, 0x000C, 0x0009, 0x0006, 0x0014, 0x003D,
  546. 0x001D, 0x0055, 0x00AE, 0x015F, 0x02B3, 0x0563, 0x0AC3, 0x1583,
  547. 0x1581,
  548. };
  549. static const uint16_t bitalloc_33_codes_b[33] =
  550. {
  551. 0x030C, 0x0187, 0x006D, 0x0028, 0x0037, 0x0066, 0x0015, 0x0031,
  552. 0x0000, 0x000B, 0x0012, 0x001A, 0x0001, 0x0007, 0x000A, 0x000E,
  553. 0x0001, 0x000F, 0x000B, 0x0008, 0x0004, 0x001B, 0x0013, 0x000C,
  554. 0x0001, 0x0032, 0x001A, 0x0067, 0x0060, 0x0029, 0x00C2, 0x006C,
  555. 0x030D,
  556. };
  557. static const uint16_t bitalloc_33_codes_c[33] =
  558. {
  559. 0x00CC, 0x0067, 0x0005, 0x0070, 0x0003, 0x001A, 0x0039, 0x003F,
  560. 0x000A, 0x0012, 0x0018, 0x001D, 0x0001, 0x0003, 0x0007, 0x000A,
  561. 0x000D, 0x000B, 0x0008, 0x0004, 0x0002, 0x001E, 0x0019, 0x0013,
  562. 0x000B, 0x0000, 0x003E, 0x001B, 0x0018, 0x0071, 0x0032, 0x0004,
  563. 0x00CD,
  564. };
  565. static const uint16_t bitalloc_33_codes_d[33] =
  566. {
  567. 0x3AF8, 0x3AFA, 0x1D7E, 0x0EBC, 0x075C, 0x03AC, 0x01D4, 0x0094,
  568. 0x0014, 0x004B, 0x000B, 0x003B, 0x0013, 0x0003, 0x000F, 0x0005,
  569. 0x0001, 0x0006, 0x0000, 0x0008, 0x001C, 0x0004, 0x0024, 0x0074,
  570. 0x0015, 0x0095, 0x01D5, 0x03AD, 0x075D, 0x0EBD, 0x1D7F, 0x3AFB,
  571. 0x3AF9,
  572. };
  573. static const uint16_t bitalloc_33_codes_e[33] =
  574. {
  575. 0x01C8, 0x01E6, 0x0064, 0x00E2, 0x00E5, 0x0030, 0x0033, 0x0073,
  576. 0x007A, 0x001A, 0x003A, 0x0002, 0x001A, 0x001F, 0x0007, 0x0001,
  577. 0x0002, 0x0002, 0x000C, 0x0000, 0x001B, 0x0003, 0x003B, 0x001B,
  578. 0x007B, 0x0078, 0x0070, 0x0031, 0x00F2, 0x00E3, 0x0065, 0x01E7,
  579. 0x01C9,
  580. };
  581. static const uint16_t bitalloc_33_codes_f[33] =
  582. {
  583. 0x0724, 0x0393, 0x01CE, 0x00E5, 0x002C, 0x0008, 0x0017, 0x003E,
  584. 0x0005, 0x0014, 0x001D, 0x0000, 0x0003, 0x0006, 0x0008, 0x000B,
  585. 0x000D, 0x000C, 0x0009, 0x0007, 0x0004, 0x0001, 0x001E, 0x0015,
  586. 0x000A, 0x003F, 0x0038, 0x0009, 0x002D, 0x00E6, 0x01CF, 0x01C8,
  587. 0x0725,
  588. };
  589. static const uint16_t bitalloc_33_codes_g[33] =
  590. {
  591. 0x0284, 0x0042, 0x0140, 0x0143, 0x003E, 0x00BE, 0x0011, 0x0051,
  592. 0x0009, 0x0029, 0x0005, 0x0015, 0x0000, 0x0008, 0x000E, 0x0002,
  593. 0x0006, 0x0003, 0x000F, 0x0009, 0x0001, 0x0016, 0x0006, 0x002E,
  594. 0x000E, 0x005E, 0x001E, 0x00BF, 0x003F, 0x0020, 0x0141, 0x0043,
  595. 0x0285,
  596. };
  597. static const uint8_t bitalloc_33_bits_a[33] =
  598. {
  599. 13, 13, 12, 11, 10, 9, 8, 7, 6, 6, 5, 5, 4, 4, 4, 3,
  600. 3, 3, 4, 4, 4, 4, 5, 6, 6, 7, 8, 9, 10, 11, 12, 13,
  601. 13,
  602. };
  603. static const uint8_t bitalloc_33_bits_b[33] =
  604. {
  605. 10, 9, 8, 7, 7, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4,
  606. 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 7, 7, 8, 8,
  607. 10,
  608. };
  609. static const uint8_t bitalloc_33_bits_c[33] =
  610. {
  611. 9, 8, 7, 7, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4,
  612. 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7,
  613. 9,
  614. };
  615. static const uint8_t bitalloc_33_bits_d[33] =
  616. {
  617. 14, 14, 13, 12, 11, 10, 9, 8, 7, 7, 6, 6, 5, 4, 4, 3,
  618. 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9, 10, 11, 12, 13, 14,
  619. 14,
  620. };
  621. static const uint8_t bitalloc_33_bits_e[33] =
  622. {
  623. 9, 9, 8, 8, 8, 7, 7, 7, 7, 6, 6, 5, 5, 5, 4, 3,
  624. 2, 3, 4, 4, 5, 5, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9,
  625. 9,
  626. };
  627. static const uint8_t bitalloc_33_bits_f[33] =
  628. {
  629. 11, 10, 9, 8, 7, 6, 6, 6, 5, 5, 5, 4, 4, 4, 4, 4,
  630. 4, 4, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 8, 9, 9,
  631. 11,
  632. };
  633. static const uint8_t bitalloc_33_bits_g[33] =
  634. {
  635. 10, 9, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 4, 3,
  636. 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 8, 9, 9,
  637. 10,
  638. };
  639. static const uint16_t bitalloc_65_codes_a[65] =
  640. {
  641. 0x9E5C, 0x9E5E, 0x4F2C, 0x2794, 0x13C4, 0x1E44, 0x09E3, 0x0F23,
  642. 0x04F3, 0x0792, 0x027E, 0x03CE, 0x013D, 0x01E5, 0x009C, 0x00CC,
  643. 0x0040, 0x0058, 0x0067, 0x001E, 0x0021, 0x002D, 0x003D, 0x0007,
  644. 0x0011, 0x0014, 0x0017, 0x001A, 0x001C, 0x001F, 0x0001, 0x0004,
  645. 0x0006, 0x0005, 0x0002, 0x0000, 0x001D, 0x001B, 0x0018, 0x0015,
  646. 0x0012, 0x000E, 0x0006, 0x0032, 0x0026, 0x001F, 0x0078, 0x0059,
  647. 0x0041, 0x00CD, 0x009D, 0x01E6, 0x013E, 0x03CF, 0x027F, 0x0793,
  648. 0x0790, 0x04F0, 0x09E4, 0x1E45, 0x13C5, 0x2795, 0x4F2D, 0x9E5F,
  649. 0x9E5D,
  650. };
  651. static const uint16_t bitalloc_65_codes_b[65] =
  652. {
  653. 0x0A8C, 0x0547, 0x01B5, 0x0008, 0x00DB, 0x0152, 0x0005, 0x000B,
  654. 0x008E, 0x00AE, 0x00E4, 0x0003, 0x0037, 0x0039, 0x0055, 0x006C,
  655. 0x0073, 0x0003, 0x0015, 0x001D, 0x0028, 0x0030, 0x0037, 0x003E,
  656. 0x0006, 0x000B, 0x000F, 0x0012, 0x0016, 0x0019, 0x001D, 0x0001,
  657. 0x0004, 0x0002, 0x001E, 0x001A, 0x0017, 0x0013, 0x0010, 0x000C,
  658. 0x0007, 0x003F, 0x0038, 0x0031, 0x0029, 0x0022, 0x001A, 0x0014,
  659. 0x0000, 0x006D, 0x0056, 0x0046, 0x0038, 0x0004, 0x00E5, 0x00AF,
  660. 0x008F, 0x006C, 0x000A, 0x0153, 0x0150, 0x0009, 0x02A2, 0x01B4,
  661. 0x0A8D,
  662. };
  663. static const uint16_t bitalloc_65_codes_c[65] =
  664. {
  665. 0x045C, 0x022F, 0x03F5, 0x01BC, 0x01FB, 0x0059, 0x00D0, 0x00DF,
  666. 0x000A, 0x002D, 0x002F, 0x0052, 0x0069, 0x0078, 0x007F, 0x000A,
  667. 0x0010, 0x001C, 0x0023, 0x002A, 0x0035, 0x003A, 0x003D, 0x0000,
  668. 0x0003, 0x0006, 0x0009, 0x000C, 0x000F, 0x0012, 0x0016, 0x0018,
  669. 0x001C, 0x0019, 0x0017, 0x0013, 0x0010, 0x000D, 0x000A, 0x0007,
  670. 0x0004, 0x0001, 0x003E, 0x003B, 0x0036, 0x002B, 0x0028, 0x001D,
  671. 0x0011, 0x000B, 0x0004, 0x0079, 0x006E, 0x0053, 0x0044, 0x002E,
  672. 0x000B, 0x00FC, 0x00D1, 0x008A, 0x0058, 0x01BD, 0x0116, 0x03F4,
  673. 0x045D,
  674. };
  675. static const uint16_t bitalloc_65_codes_d[65] =
  676. {
  677. 0x70B0, 0x70B2, 0x70B4, 0x2852, 0x385B, 0x142E, 0x1C2E, 0x0A15,
  678. 0x0E14, 0x0214, 0x0704, 0x0104, 0x010B, 0x0383, 0x0083, 0x0143,
  679. 0x01C3, 0x0043, 0x00A2, 0x00E2, 0x0022, 0x0052, 0x0072, 0x0012,
  680. 0x002A, 0x003A, 0x000A, 0x0016, 0x001E, 0x0006, 0x000C, 0x0000,
  681. 0x0004, 0x0001, 0x000D, 0x0007, 0x001F, 0x0017, 0x000B, 0x003B,
  682. 0x002B, 0x0013, 0x0073, 0x0053, 0x0023, 0x00E3, 0x00A3, 0x00A0,
  683. 0x0040, 0x01C0, 0x0084, 0x0384, 0x0284, 0x0105, 0x0705, 0x0215,
  684. 0x0E15, 0x0A16, 0x1C2F, 0x142F, 0x1428, 0x2853, 0x70B5, 0x70B3,
  685. 0x70B1,
  686. };
  687. static const uint16_t bitalloc_65_codes_e[65] =
  688. {
  689. 0x032C, 0x0332, 0x0378, 0x037E, 0x008C, 0x014A, 0x0188, 0x0197,
  690. 0x019E, 0x01BD, 0x0044, 0x0047, 0x00AA, 0x00C5, 0x00CD, 0x00DC,
  691. 0x001C, 0x002C, 0x0053, 0x0063, 0x0068, 0x0008, 0x000F, 0x0017,
  692. 0x002B, 0x0035, 0x0005, 0x0009, 0x0016, 0x001C, 0x0006, 0x000F,
  693. 0x0004, 0x0000, 0x0007, 0x001D, 0x0017, 0x000A, 0x0006, 0x0036,
  694. 0x0030, 0x0028, 0x0010, 0x0009, 0x0069, 0x0064, 0x0054, 0x002D,
  695. 0x001D, 0x00DD, 0x00CE, 0x00CA, 0x00AB, 0x00A4, 0x0045, 0x01BE,
  696. 0x019F, 0x0198, 0x0189, 0x014B, 0x008D, 0x037F, 0x0379, 0x0333,
  697. 0x032D,
  698. };
  699. static const uint16_t bitalloc_65_codes_f[65] =
  700. {
  701. 0x0FE0, 0x0FE2, 0x0FE8, 0x0FEA, 0x0FEC, 0x0FEE, 0x0FF0, 0x0FF2,
  702. 0x0FF4, 0x2FF2, 0x07F2, 0x07FB, 0x03F6, 0x0BFA, 0x0BFD, 0x01FF,
  703. 0x05FF, 0x02FC, 0x007C, 0x017C, 0x003C, 0x00BC, 0x001C, 0x005C,
  704. 0x000C, 0x002C, 0x0004, 0x0014, 0x0000, 0x0008, 0x000E, 0x0002,
  705. 0x0006, 0x0003, 0x000F, 0x0009, 0x0001, 0x0015, 0x0005, 0x002D,
  706. 0x000D, 0x005D, 0x001D, 0x00BD, 0x003D, 0x017D, 0x007D, 0x02FD,
  707. 0x00FC, 0x05FC, 0x01FA, 0x0BFB, 0x03F7, 0x17F8, 0x07F3, 0x2FF3,
  708. 0x0FF5, 0x0FF3, 0x0FF1, 0x0FEF, 0x0FED, 0x0FEB, 0x0FE9, 0x0FE3,
  709. 0x0FE1,
  710. };
  711. static const uint16_t bitalloc_65_codes_g[65] =
  712. {
  713. 0x010C, 0x038A, 0x0608, 0x0786, 0x0084, 0x0087, 0x0302, 0x0305,
  714. 0x0040, 0x00E0, 0x00E3, 0x0183, 0x001E, 0x005E, 0x009E, 0x00DE,
  715. 0x00F1, 0x0011, 0x0039, 0x0061, 0x0079, 0x0009, 0x001D, 0x0031,
  716. 0x003D, 0x0005, 0x000F, 0x0019, 0x001F, 0x0003, 0x0006, 0x000A,
  717. 0x000E, 0x000B, 0x0008, 0x0004, 0x0000, 0x001A, 0x0012, 0x000A,
  718. 0x0002, 0x0036, 0x0026, 0x0016, 0x0006, 0x006E, 0x004E, 0x002E,
  719. 0x000E, 0x00DF, 0x009F, 0x005F, 0x001F, 0x01E0, 0x0180, 0x00E1,
  720. 0x0041, 0x03C2, 0x0303, 0x01C4, 0x0085, 0x0787, 0x0609, 0x038B,
  721. 0x010D,
  722. };
  723. static const uint8_t bitalloc_65_bits_a[65] =
  724. {
  725. 16, 16, 15, 14, 13, 13, 12, 12, 11, 11, 10, 10, 9, 9, 8, 8,
  726. 7, 7, 7, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 4, 4,
  727. 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 7, 7,
  728. 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 12, 13, 13, 14, 15, 16,
  729. 16,
  730. };
  731. static const uint8_t bitalloc_65_bits_b[65] =
  732. {
  733. 12, 11, 10, 9, 9, 9, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7,
  734. 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 4,
  735. 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6,
  736. 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 10, 10,
  737. 12,
  738. };
  739. static const uint8_t bitalloc_65_bits_c[65] =
  740. {
  741. 11, 10, 10, 9, 9, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 6,
  742. 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5,
  743. 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6,
  744. 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 10,
  745. 11,
  746. };
  747. static const uint8_t bitalloc_65_bits_d[65] =
  748. {
  749. 15, 15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10, 10, 9, 9,
  750. 9, 8, 8, 8, 7, 7, 7, 6, 6, 6, 5, 5, 5, 4, 4, 3,
  751. 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8,
  752. 8, 9, 9, 10, 10, 10, 11, 11, 12, 12, 13, 13, 13, 14, 15, 15,
  753. 15,
  754. };
  755. static const uint8_t bitalloc_65_bits_e[65] =
  756. {
  757. 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8,
  758. 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4,
  759. 3, 3, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7,
  760. 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10,
  761. 10,
  762. };
  763. static const uint8_t bitalloc_65_bits_f[65] =
  764. {
  765. 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 12, 12, 12, 11,
  766. 11, 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 4, 3,
  767. 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10,
  768. 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14,
  769. 14,
  770. };
  771. static const uint8_t bitalloc_65_bits_g[65] =
  772. {
  773. 11, 11, 11, 11, 10, 10, 10, 10, 9, 9, 9, 9, 8, 8, 8, 8,
  774. 8, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, 4,
  775. 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7,
  776. 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11,
  777. 11,
  778. };
  779. static const uint16_t bitalloc_129_codes_a[129] =
  780. {
  781. 0x0660, 0x0666, 0x06EC, 0x0722, 0x0760, 0x076E, 0x004C, 0x004E,
  782. 0x00F4, 0x010A, 0x0148, 0x0156, 0x01D4, 0x01F2, 0x0331, 0x0370,
  783. 0x0377, 0x0396, 0x03B1, 0x0024, 0x0064, 0x007B, 0x008A, 0x00A5,
  784. 0x00D4, 0x00EB, 0x00FA, 0x019A, 0x01B9, 0x01C9, 0x01D9, 0x0010,
  785. 0x0030, 0x0033, 0x0043, 0x0053, 0x006B, 0x007A, 0x00CA, 0x00D2,
  786. 0x00DE, 0x00E6, 0x00F6, 0x000E, 0x001F, 0x0023, 0x002B, 0x003B,
  787. 0x003F, 0x0067, 0x0070, 0x0077, 0x0005, 0x000D, 0x0012, 0x001B,
  788. 0x002C, 0x0035, 0x003A, 0x0004, 0x000B, 0x0017, 0x001F, 0x0009,
  789. 0x0008, 0x000A, 0x0000, 0x0018, 0x000C, 0x0005, 0x003C, 0x0036,
  790. 0x002D, 0x001C, 0x0013, 0x000E, 0x0006, 0x007A, 0x0071, 0x0068,
  791. 0x0064, 0x003C, 0x0034, 0x0028, 0x0020, 0x000F, 0x00F7, 0x00E7,
  792. 0x00DF, 0x00D3, 0x00CB, 0x007B, 0x0074, 0x0054, 0x0044, 0x003C,
  793. 0x0031, 0x0011, 0x01DA, 0x01CA, 0x01BA, 0x019B, 0x00FB, 0x00F8,
  794. 0x00D5, 0x00AA, 0x008B, 0x0084, 0x0065, 0x0025, 0x03B6, 0x0397,
  795. 0x0390, 0x0371, 0x0332, 0x01F3, 0x01D5, 0x0157, 0x0149, 0x010B,
  796. 0x00F5, 0x004F, 0x004D, 0x076F, 0x0761, 0x0723, 0x06ED, 0x0667,
  797. 0x0661,
  798. };
  799. static const uint16_t bitalloc_129_codes_b[129] =
  800. {
  801. 0x29DC, 0x14EF, 0x0455, 0x0E9C, 0x022B, 0x0489, 0x0740, 0x074F,
  802. 0x0172, 0x0245, 0x0247, 0x030A, 0x03A1, 0x001C, 0x008B, 0x00D6,
  803. 0x010C, 0x0148, 0x014F, 0x0186, 0x01D1, 0x0008, 0x000F, 0x0046,
  804. 0x005D, 0x0078, 0x0087, 0x0096, 0x00A5, 0x00BC, 0x00D8, 0x00DE,
  805. 0x00F6, 0x0005, 0x0014, 0x0024, 0x002F, 0x003A, 0x003D, 0x0049,
  806. 0x0050, 0x0058, 0x005F, 0x0066, 0x006D, 0x0075, 0x007C, 0x0004,
  807. 0x000B, 0x0013, 0x0018, 0x001B, 0x001F, 0x0022, 0x0026, 0x002A,
  808. 0x002D, 0x0031, 0x0034, 0x0038, 0x003B, 0x003F, 0x0003, 0x0006,
  809. 0x000A, 0x0007, 0x0004, 0x0000, 0x003C, 0x0039, 0x0035, 0x0032,
  810. 0x002E, 0x002B, 0x0027, 0x0023, 0x0020, 0x001C, 0x0019, 0x0016,
  811. 0x0010, 0x0005, 0x007D, 0x007A, 0x006E, 0x0067, 0x0060, 0x0059,
  812. 0x0051, 0x004A, 0x0042, 0x003B, 0x0034, 0x0025, 0x0015, 0x0006,
  813. 0x00F7, 0x00DF, 0x00D9, 0x00BD, 0x00A6, 0x0097, 0x0090, 0x0079,
  814. 0x006A, 0x0047, 0x0044, 0x0009, 0x01D2, 0x0187, 0x0184, 0x0149,
  815. 0x010D, 0x00D7, 0x00B8, 0x001D, 0x03A6, 0x030B, 0x029C, 0x0246,
  816. 0x0173, 0x0114, 0x0741, 0x053A, 0x0488, 0x0E9D, 0x0A76, 0x0454,
  817. 0x29DD,
  818. };
  819. static const uint16_t bitalloc_129_codes_c[129] =
  820. {
  821. 0x0E5C, 0x072F, 0x001D, 0x0724, 0x000F, 0x010D, 0x0324, 0x0393,
  822. 0x03E9, 0x0080, 0x0087, 0x00FA, 0x0164, 0x0193, 0x01DE, 0x01F5,
  823. 0x0010, 0x002A, 0x0041, 0x0064, 0x0073, 0x008E, 0x00A4, 0x00B3,
  824. 0x00D6, 0x00E5, 0x00F4, 0x00FB, 0x0002, 0x0009, 0x0013, 0x001E,
  825. 0x0026, 0x002C, 0x0033, 0x003F, 0x0041, 0x004C, 0x0053, 0x005E,
  826. 0x0065, 0x0070, 0x0073, 0x0078, 0x007B, 0x007E, 0x0002, 0x0005,
  827. 0x0007, 0x000B, 0x000D, 0x0011, 0x0014, 0x0017, 0x001A, 0x001D,
  828. 0x0021, 0x0024, 0x0027, 0x002A, 0x002D, 0x0030, 0x0033, 0x0036,
  829. 0x003A, 0x0037, 0x0034, 0x0031, 0x002E, 0x002B, 0x0028, 0x0025,
  830. 0x0022, 0x001E, 0x001B, 0x0018, 0x0015, 0x0012, 0x000E, 0x000C,
  831. 0x0008, 0x0006, 0x0003, 0x007F, 0x007C, 0x0079, 0x0076, 0x0071,
  832. 0x006A, 0x005F, 0x0058, 0x004D, 0x0046, 0x0040, 0x0038, 0x002D,
  833. 0x0027, 0x001F, 0x0014, 0x0012, 0x0003, 0x0000, 0x00F5, 0x00EE,
  834. 0x00D7, 0x00C8, 0x00A5, 0x008F, 0x007C, 0x0065, 0x0042, 0x002B,
  835. 0x0011, 0x0002, 0x01DF, 0x01C8, 0x0165, 0x00FB, 0x00E4, 0x0081,
  836. 0x0006, 0x03E8, 0x0325, 0x01CA, 0x010C, 0x0725, 0x0396, 0x001C,
  837. 0x0E5D,
  838. };
  839. static const uint16_t bitalloc_129_codes_d[129] =
  840. {
  841. 0xA598, 0xA59A, 0xA59C, 0xA59E, 0xC598, 0xE586, 0x3ACC, 0x52CA,
  842. 0x62CD, 0x0D48, 0x1D67, 0x2978, 0x3167, 0x3966, 0x06A5, 0x0EBC,
  843. 0x14BD, 0x1CB1, 0x0350, 0x0353, 0x075F, 0x0A5F, 0x0C5E, 0x0E5E,
  844. 0x01AE, 0x03AD, 0x052D, 0x062D, 0x072D, 0x00D5, 0x01D4, 0x0294,
  845. 0x0314, 0x0394, 0x0014, 0x0094, 0x0114, 0x0174, 0x01B4, 0x01F4,
  846. 0x000B, 0x004B, 0x008B, 0x00BB, 0x00DB, 0x00FB, 0x001B, 0x003B,
  847. 0x0053, 0x0063, 0x0073, 0x0003, 0x0013, 0x0023, 0x002F, 0x0037,
  848. 0x003F, 0x0007, 0x000F, 0x0015, 0x0019, 0x001D, 0x0001, 0x0005,
  849. 0x0009, 0x0006, 0x0002, 0x001E, 0x001A, 0x0016, 0x0010, 0x0008,
  850. 0x0000, 0x0038, 0x0030, 0x0028, 0x001C, 0x000C, 0x007C, 0x006C,
  851. 0x005C, 0x0044, 0x0024, 0x0004, 0x00E4, 0x00C4, 0x00A4, 0x0074,
  852. 0x0034, 0x01F5, 0x01B5, 0x0175, 0x0115, 0x0095, 0x0015, 0x0395,
  853. 0x0315, 0x0295, 0x01D5, 0x00D6, 0x072E, 0x062E, 0x052E, 0x03AE,
  854. 0x01AF, 0x0E5F, 0x0C5F, 0x0C58, 0x0A58, 0x0758, 0x0351, 0x1CB2,
  855. 0x18B2, 0x0EBD, 0x0EB2, 0x3967, 0x3960, 0x2979, 0x2964, 0x0D49,
  856. 0x72C2, 0x52CB, 0x3ACD, 0xE587, 0xC599, 0xA59F, 0xA59D, 0xA59B,
  857. 0xA599,
  858. };
  859. static const uint16_t bitalloc_129_codes_e[129] =
  860. {
  861. 0xA13C, 0xC720, 0xA13F, 0xA13E, 0xA13D, 0xE722, 0x5090, 0x6393,
  862. 0x7392, 0x2849, 0x31CE, 0x39CE, 0x1425, 0x18E5, 0x1CE5, 0x0844,
  863. 0x0A1C, 0x0C7C, 0x036C, 0x0423, 0x050F, 0x063F, 0x01B7, 0x0216,
  864. 0x0285, 0x031D, 0x039D, 0x0109, 0x0140, 0x0180, 0x01C8, 0x01CF,
  865. 0x007A, 0x008A, 0x00A2, 0x00C1, 0x00E5, 0x0014, 0x0037, 0x0043,
  866. 0x004E, 0x0056, 0x0061, 0x006C, 0x007C, 0x000B, 0x001C, 0x001F,
  867. 0x0023, 0x0025, 0x0029, 0x002C, 0x002E, 0x0032, 0x0034, 0x0037,
  868. 0x003A, 0x003C, 0x003F, 0x0001, 0x0003, 0x0006, 0x0008, 0x000A,
  869. 0x000C, 0x000B, 0x0009, 0x0007, 0x0004, 0x0002, 0x0000, 0x003D,
  870. 0x003B, 0x0038, 0x0035, 0x0033, 0x002F, 0x002D, 0x002A, 0x0026,
  871. 0x0024, 0x0020, 0x001D, 0x001A, 0x007D, 0x006D, 0x0062, 0x0057,
  872. 0x004F, 0x0044, 0x003C, 0x0015, 0x00E6, 0x00C6, 0x00A3, 0x008B,
  873. 0x007B, 0x006C, 0x01C9, 0x0181, 0x0141, 0x010A, 0x00DA, 0x031E,
  874. 0x0286, 0x0217, 0x0210, 0x0738, 0x0638, 0x0508, 0x036D, 0x0C7D,
  875. 0x0A1D, 0x0845, 0x1CE6, 0x18E6, 0x1426, 0x39CF, 0x31CF, 0x284E,
  876. 0x7393, 0x7390, 0x5091, 0xE723, 0xC724, 0xC725, 0xC722, 0xC723,
  877. 0xC721,
  878. };
  879. static const uint16_t bitalloc_129_codes_f[129] =
  880. {
  881. 0x762C, 0x3B17, 0x1555, 0x0608, 0x0AAB, 0x0FF2, 0x0305, 0x0307,
  882. 0x0763, 0x0046, 0x010C, 0x01BC, 0x02AB, 0x03B6, 0x03FD, 0x0080,
  883. 0x0087, 0x00DF, 0x0156, 0x01D9, 0x01F8, 0x01FF, 0x002A, 0x0041,
  884. 0x0061, 0x0094, 0x00D4, 0x00EA, 0x00F2, 0x00FD, 0x0009, 0x000B,
  885. 0x001A, 0x0026, 0x0031, 0x0040, 0x004B, 0x006B, 0x0073, 0x0077,
  886. 0x007A, 0x007C, 0x0000, 0x0002, 0x0006, 0x0008, 0x000B, 0x000E,
  887. 0x0011, 0x0014, 0x0016, 0x0019, 0x001C, 0x001E, 0x0021, 0x0023,
  888. 0x0026, 0x0028, 0x002B, 0x002D, 0x002F, 0x0031, 0x0033, 0x0036,
  889. 0x0038, 0x0037, 0x0034, 0x0032, 0x0030, 0x002E, 0x002C, 0x0029,
  890. 0x0027, 0x0024, 0x0022, 0x001F, 0x001D, 0x001A, 0x0017, 0x0015,
  891. 0x0012, 0x000F, 0x000C, 0x0009, 0x0007, 0x0003, 0x0001, 0x007D,
  892. 0x007B, 0x0078, 0x0074, 0x0072, 0x0054, 0x0041, 0x0036, 0x0027,
  893. 0x001B, 0x0014, 0x000A, 0x00FE, 0x00F3, 0x00EB, 0x00D5, 0x0095,
  894. 0x006E, 0x0042, 0x002B, 0x0010, 0x01F9, 0x01DA, 0x0157, 0x0154,
  895. 0x00C0, 0x0081, 0x0022, 0x03B7, 0x03B0, 0x01BD, 0x010D, 0x0047,
  896. 0x07F8, 0x0554, 0x0306, 0x0FF3, 0x0EC4, 0x0609, 0x1D8A, 0x1554,
  897. 0x762D,
  898. };
  899. static const uint16_t bitalloc_129_codes_g[129] =
  900. {
  901. 0x1E20, 0x1E5E, 0x031C, 0x051A, 0x0718, 0x0916, 0x0B14, 0x0D12,
  902. 0x0F11, 0x0090, 0x018F, 0x028E, 0x038D, 0x048C, 0x058B, 0x068A,
  903. 0x0789, 0x0049, 0x00C8, 0x0148, 0x01C7, 0x0247, 0x02C6, 0x0346,
  904. 0x03C5, 0x0025, 0x0065, 0x00A5, 0x00E4, 0x0124, 0x0164, 0x01A4,
  905. 0x01E3, 0x0013, 0x0033, 0x0053, 0x0073, 0x0093, 0x00B3, 0x00D3,
  906. 0x00F3, 0x000A, 0x001A, 0x002A, 0x003A, 0x004A, 0x005A, 0x006A,
  907. 0x007A, 0x0006, 0x000E, 0x0016, 0x001E, 0x0026, 0x002E, 0x0036,
  908. 0x003E, 0x0004, 0x0008, 0x000C, 0x0010, 0x0014, 0x0018, 0x001C,
  909. 0x0000, 0x001D, 0x0019, 0x0015, 0x0011, 0x000D, 0x0009, 0x0005,
  910. 0x003F, 0x0037, 0x002F, 0x0027, 0x001F, 0x0017, 0x000F, 0x0007,
  911. 0x007B, 0x006B, 0x005B, 0x004B, 0x003B, 0x002B, 0x001B, 0x000B,
  912. 0x0008, 0x00F0, 0x00D0, 0x00B0, 0x0090, 0x0070, 0x0050, 0x0030,
  913. 0x01E4, 0x01A5, 0x0165, 0x0125, 0x00E5, 0x00E2, 0x00A2, 0x0062,
  914. 0x03CA, 0x0347, 0x02C7, 0x02C4, 0x0244, 0x0149, 0x00C9, 0x00C6,
  915. 0x0796, 0x068B, 0x0688, 0x048D, 0x048A, 0x028F, 0x028C, 0x0091,
  916. 0x0F2E, 0x0D13, 0x0B15, 0x0917, 0x0719, 0x051B, 0x031D, 0x1E5F,
  917. 0x1E21,
  918. };
  919. static const uint8_t bitalloc_129_bits_a[129] =
  920. {
  921. 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
  922. 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8,
  923. 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7,
  924. 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 4,
  925. 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7,
  926. 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  927. 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10,
  928. 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11,
  929. 11,
  930. };
  931. static const uint8_t bitalloc_129_bits_b[129] =
  932. {
  933. 14, 13, 12, 12, 11, 11, 11, 11, 10, 10, 10, 10, 10, 9, 9, 9,
  934. 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  935. 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6,
  936. 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5,
  937. 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
  938. 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
  939. 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9,
  940. 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12,
  941. 14,
  942. };
  943. static const uint8_t bitalloc_129_bits_c[129] =
  944. {
  945. 13, 12, 11, 11, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9,
  946. 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7,
  947. 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6,
  948. 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
  949. 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
  950. 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
  951. 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  952. 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11,
  953. 13,
  954. };
  955. static const uint8_t bitalloc_129_bits_d[129] =
  956. {
  957. 16, 16, 16, 16, 16, 16, 15, 15, 15, 14, 14, 14, 14, 14, 13, 13,
  958. 13, 13, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 10, 10, 10,
  959. 10, 10, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 7, 7,
  960. 7, 7, 7, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 4, 4,
  961. 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7,
  962. 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10,
  963. 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13,
  964. 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 16, 16, 16, 16, 16,
  965. 16,
  966. };
  967. static const uint8_t bitalloc_129_bits_e[129] =
  968. {
  969. 16, 16, 16, 16, 16, 16, 15, 15, 15, 14, 14, 14, 13, 13, 13, 12,
  970. 12, 12, 11, 11, 11, 11, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9,
  971. 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6,
  972. 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5,
  973. 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6,
  974. 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8,
  975. 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12,
  976. 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 16, 16,
  977. 16,
  978. };
  979. static const uint8_t bitalloc_129_bits_f[129] =
  980. {
  981. 15, 14, 13, 12, 12, 12, 11, 11, 11, 10, 10, 10, 10, 10, 10, 9,
  982. 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7,
  983. 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6,
  984. 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
  985. 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
  986. 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7,
  987. 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9,
  988. 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13,
  989. 15,
  990. };
  991. static const uint8_t bitalloc_129_bits_g[129] =
  992. {
  993. 13, 13, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11,
  994. 11, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9,
  995. 9, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7,
  996. 7, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5,
  997. 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6,
  998. 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8,
  999. 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10,
  1000. 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 13,
  1001. 13,
  1002. };
  1003. static const uint8_t bitalloc_sizes[10] = { 3, 5, 7, 9, 13, 17, 25, 33, 65, 129 };
  1004. static const int8_t bitalloc_offsets[10] =
  1005. { -1, -2, -3, -4, -6, -8, -12, -16, -32, -64 };
  1006. static const uint8_t bitalloc_maxbits[10][7] = {
  1007. { 2 },
  1008. { 4, 3, 3 },
  1009. { 5, 5, 4 },
  1010. { 6, 5, 6 },
  1011. { 7, 6, 5 },
  1012. { 9, 8, 7, 9, 8, 8, 8 },
  1013. { 9, 9, 8, 9, 8, 9, 9 },
  1014. { 9, 9, 9, 9, 9, 9, 9 },
  1015. { 9, 9, 9, 9, 9, 9, 9 },
  1016. { 9, 9, 9, 9, 9, 9, 9 }
  1017. };
  1018. static const uint16_t* const bitalloc_codes[10][8] = {
  1019. { bitalloc_3_codes, NULL },
  1020. { bitalloc_5_codes_a, bitalloc_5_codes_b, bitalloc_5_codes_c, NULL },
  1021. { bitalloc_7_codes_a, bitalloc_7_codes_b, bitalloc_7_codes_c, NULL },
  1022. { bitalloc_9_codes_a, bitalloc_9_codes_b, bitalloc_9_codes_c, NULL },
  1023. { bitalloc_13_codes_a, bitalloc_13_codes_b, bitalloc_13_codes_c, NULL },
  1024. { bitalloc_17_codes_a, bitalloc_17_codes_b, bitalloc_17_codes_c, bitalloc_17_codes_d,
  1025. bitalloc_17_codes_e, bitalloc_17_codes_f, bitalloc_17_codes_g, NULL },
  1026. { bitalloc_25_codes_a, bitalloc_25_codes_b, bitalloc_25_codes_c, bitalloc_25_codes_d,
  1027. bitalloc_25_codes_e, bitalloc_25_codes_f, bitalloc_25_codes_g, NULL },
  1028. { bitalloc_33_codes_a, bitalloc_33_codes_b, bitalloc_33_codes_c, bitalloc_33_codes_d,
  1029. bitalloc_33_codes_e, bitalloc_33_codes_f, bitalloc_33_codes_g, NULL },
  1030. { bitalloc_65_codes_a, bitalloc_65_codes_b, bitalloc_65_codes_c, bitalloc_65_codes_d,
  1031. bitalloc_65_codes_e, bitalloc_65_codes_f, bitalloc_65_codes_g, NULL },
  1032. { bitalloc_129_codes_a, bitalloc_129_codes_b, bitalloc_129_codes_c, bitalloc_129_codes_d,
  1033. bitalloc_129_codes_e, bitalloc_129_codes_f, bitalloc_129_codes_g, NULL }
  1034. };
  1035. static const uint8_t* const bitalloc_bits[10][8] = {
  1036. { bitalloc_3_bits, NULL },
  1037. { bitalloc_5_bits_a, bitalloc_5_bits_b, bitalloc_5_bits_c, NULL },
  1038. { bitalloc_7_bits_a, bitalloc_7_bits_b, bitalloc_7_bits_c, NULL },
  1039. { bitalloc_9_bits_a, bitalloc_9_bits_b, bitalloc_9_bits_c, NULL },
  1040. { bitalloc_13_bits_a, bitalloc_13_bits_b, bitalloc_13_bits_c, NULL },
  1041. { bitalloc_17_bits_a, bitalloc_17_bits_b, bitalloc_17_bits_c, bitalloc_17_bits_d,
  1042. bitalloc_17_bits_e, bitalloc_17_bits_f, bitalloc_17_bits_g, NULL },
  1043. { bitalloc_25_bits_a, bitalloc_25_bits_b, bitalloc_25_bits_c, bitalloc_25_bits_d,
  1044. bitalloc_25_bits_e, bitalloc_25_bits_f, bitalloc_25_bits_g, NULL },
  1045. { bitalloc_33_bits_a, bitalloc_33_bits_b, bitalloc_33_bits_c, bitalloc_33_bits_d,
  1046. bitalloc_33_bits_e, bitalloc_33_bits_f, bitalloc_33_bits_g, NULL },
  1047. { bitalloc_65_bits_a, bitalloc_65_bits_b, bitalloc_65_bits_c, bitalloc_65_bits_d,
  1048. bitalloc_65_bits_e, bitalloc_65_bits_f, bitalloc_65_bits_g, NULL },
  1049. { bitalloc_129_bits_a, bitalloc_129_bits_b, bitalloc_129_bits_c, bitalloc_129_bits_d,
  1050. bitalloc_129_bits_e, bitalloc_129_bits_f, bitalloc_129_bits_g, NULL }
  1051. };
  1052. #endif /* AVCODEC_DCAHUFF_H */