rv40vlc2.h 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706
  1. /*
  2. * RealVideo 4 decoder
  3. * copyright (c) 2007 Konstantin Shishkov
  4. *
  5. * This file is part of FFmpeg.
  6. *
  7. * FFmpeg is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * FFmpeg is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with FFmpeg; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. /**
  22. * @file libavcodec/rv40vlc2.h
  23. * RV40 VLC tables used for macroblock information decoding
  24. */
  25. #ifndef AVCODEC_RV40VLC2_H
  26. #define AVCODEC_RV40VLC2_H
  27. #include <stdint.h>
  28. /**
  29. * codes used for the first four block types
  30. */
  31. //@{
  32. #define AIC_TOP_BITS 8
  33. #define AIC_TOP_SIZE 16
  34. static const uint8_t rv40_aic_top_vlc_codes[AIC_TOP_SIZE] = {
  35. 0x01, 0x05, 0x01, 0x00, 0x03, 0x3D, 0x1D, 0x02,
  36. 0x04, 0x3C, 0x3F, 0x1C, 0x0D, 0x3E, 0x0C, 0x01
  37. };
  38. static const uint8_t rv40_aic_top_vlc_bits[AIC_TOP_SIZE] = {
  39. 1, 4, 5, 5, 5, 7, 6, 5, 4, 7, 7, 6, 5, 7, 5, 3
  40. };
  41. //@}
  42. /**
  43. * codes used for determining a pair of block types
  44. */
  45. //@{
  46. #define AIC_MODE2_NUM 20
  47. #define AIC_MODE2_SIZE 81
  48. #define AIC_MODE2_BITS 9
  49. static const uint16_t aic_mode2_vlc_codes[AIC_MODE2_NUM][AIC_MODE2_SIZE] = {
  50. { 0x0001, 0x0001, 0x0005, 0x01F5, 0x0011, 0x0049, 0x0000, 0x0048, 0x004B,
  51. 0x0035, 0x0003, 0x0034, 0x03C9, 0x01F4, 0x00C9, 0x004A, 0x0FD9, 0x03C8,
  52. 0x0010, 0x0037, 0x0001, 0x00C8, 0x0075, 0x01F7, 0x00CB, 0x0074, 0x0002,
  53. 0x01F6, 0x00CA, 0x01F1, 0x01F0, 0x1F81, 0x07F9, 0x1F80, 0x1F83, 0x07F8,
  54. 0x0077, 0x00F5, 0x0036, 0x07FB, 0x0076, 0x1F82, 0x00F4, 0x00F7, 0x07FA,
  55. 0x0071, 0x00F6, 0x03CB, 0x03CA, 0x0FD8, 0x00F1, 0x03F5, 0x1F8D, 0x07E5,
  56. 0x0013, 0x0031, 0x00F0, 0x0FDB, 0x00F3, 0x07E4, 0x0030, 0x01F3, 0x07E7,
  57. 0x03F4, 0x07E6, 0x0070, 0x3F19, 0x01F2, 0x3F18, 0x0FDA, 0x0033, 0x07E1,
  58. 0x01FD, 0x01FC, 0x0073, 0x01FF, 0x0FC5, 0x0FC4, 0x0FC7, 0x03F7, 0x0072, },
  59. { 0x0005, 0x0005, 0x0005, 0x0079, 0x0005, 0x000D, 0x001D, 0x0078, 0x0069,
  60. 0x0004, 0x0001, 0x0007, 0x0068, 0x001C, 0x001F, 0x0004, 0x006B, 0x000C,
  61. 0x0004, 0x001E, 0x0006, 0x006A, 0x0015, 0x000F, 0x0014, 0x0017, 0x0007,
  62. 0x0016, 0x000E, 0x0011, 0x0009, 0x00D1, 0x00D0, 0x0181, 0x00D3, 0x007B,
  63. 0x0010, 0x0013, 0x0004, 0x00D2, 0x0007, 0x0319, 0x0008, 0x007A, 0x00DD,
  64. 0x0019, 0x0006, 0x000B, 0x0065, 0x00DC, 0x0012, 0x0064, 0x0180, 0x00DF,
  65. 0x0006, 0x0018, 0x0001, 0x00DE, 0x001D, 0x00D9, 0x001B, 0x0067, 0x000A,
  66. 0x00D8, 0x00DB, 0x001C, 0x0318, 0x00DA, 0x0635, 0x0183, 0x0000, 0x00C5,
  67. 0x0066, 0x0061, 0x0035, 0x00C4, 0x0182, 0x0634, 0x031B, 0x00C7, 0x001F, },
  68. { 0x0005, 0x0001, 0x001D, 0x01C1, 0x0035, 0x00F1, 0x006D, 0x00F0, 0x0049,
  69. 0x0000, 0x0004, 0x0003, 0x00F3, 0x0048, 0x0034, 0x006C, 0x01C0, 0x01C3,
  70. 0x0007, 0x0006, 0x0001, 0x006F, 0x0002, 0x004B, 0x006E, 0x001C, 0x0005,
  71. 0x0069, 0x0068, 0x006B, 0x0037, 0x01C2, 0x00F2, 0x0395, 0x01CD, 0x00FD,
  72. 0x006A, 0x0036, 0x0015, 0x01CC, 0x0014, 0x0394, 0x004A, 0x00FC, 0x00FF,
  73. 0x0017, 0x0031, 0x00FE, 0x01CF, 0x0397, 0x00F9, 0x01CE, 0x0725, 0x0396,
  74. 0x0016, 0x0030, 0x0075, 0x0724, 0x00F8, 0x0727, 0x0033, 0x0391, 0x0390,
  75. 0x0011, 0x0032, 0x001F, 0x00FB, 0x0074, 0x0726, 0x00FA, 0x001E, 0x0077,
  76. 0x0019, 0x0018, 0x0004, 0x0010, 0x003D, 0x0076, 0x0071, 0x0013, 0x0001, },
  77. { 0x000D, 0x0019, 0x0011, 0x0015, 0x0061, 0x0019, 0x0014, 0x01AD, 0x0060,
  78. 0x0018, 0x0001, 0x0005, 0x001B, 0x0010, 0x0019, 0x0005, 0x0017, 0x0018,
  79. 0x0016, 0x0004, 0x0004, 0x0013, 0x000C, 0x0012, 0x001A, 0x0018, 0x0005,
  80. 0x000F, 0x001B, 0x0004, 0x001D, 0x0011, 0x001C, 0x0010, 0x000E, 0x001B,
  81. 0x0013, 0x001F, 0x001A, 0x0029, 0x0005, 0x0063, 0x001E, 0x0009, 0x0062,
  82. 0x0008, 0x0007, 0x0007, 0x0019, 0x0004, 0x001A, 0x0018, 0x006D, 0x0007,
  83. 0x001B, 0x0007, 0x001A, 0x006C, 0x0006, 0x0012, 0x0005, 0x006F, 0x000B,
  84. 0x006E, 0x0069, 0x001D, 0x0359, 0x0028, 0x002B, 0x002A, 0x001C, 0x00D5,
  85. 0x0358, 0x001F, 0x0001, 0x001E, 0x0068, 0x00D4, 0x00D7, 0x0019, 0x0000, },
  86. { 0x00B9, 0x0061, 0x0060, 0x00B8, 0x02B5, 0x01AD, 0x00BB, 0x0AF5, 0x0151,
  87. 0x0001, 0x0001, 0x0005, 0x0000, 0x0003, 0x0005, 0x0004, 0x0063, 0x0025,
  88. 0x00BA, 0x0004, 0x0007, 0x0062, 0x00A5, 0x0024, 0x006D, 0x0002, 0x006C,
  89. 0x02B4, 0x000D, 0x006F, 0x0027, 0x00A4, 0x0026, 0x01AC, 0x0150, 0x01AF,
  90. 0x01AE, 0x0021, 0x006E, 0x02B7, 0x0020, 0x0153, 0x0023, 0x00A7, 0x0152,
  91. 0x00A6, 0x0006, 0x000C, 0x0022, 0x01A9, 0x0019, 0x002D, 0x02B6, 0x01A8,
  92. 0x000F, 0x0007, 0x000E, 0x00A1, 0x0069, 0x002C, 0x0001, 0x01AB, 0x00A0,
  93. 0x02B1, 0x00A3, 0x002F, 0x0AF4, 0x02B0, 0x0AF7, 0x02B3, 0x0068, 0x015D,
  94. 0x0AF6, 0x01AA, 0x0055, 0x015C, 0x02B2, 0x0579, 0x0578, 0x015F, 0x00A2, },
  95. { 0x0905, 0x013D, 0x013C, 0x0904, 0x121D, 0x049D, 0x049C, 0x243D, 0x0907,
  96. 0x00ED, 0x0001, 0x0015, 0x0041, 0x013F, 0x0031, 0x0014, 0x025D, 0x025C,
  97. 0x013E, 0x000D, 0x0000, 0x0040, 0x0139, 0x0043, 0x0030, 0x0017, 0x0033,
  98. 0x0906, 0x0032, 0x0042, 0x00EC, 0x025F, 0x00EF, 0x025E, 0x049F, 0x0138,
  99. 0x0901, 0x013B, 0x0259, 0x121C, 0x049E, 0x0900, 0x0258, 0x243C, 0x121F,
  100. 0x0903, 0x003D, 0x00EE, 0x025B, 0x025A, 0x004D, 0x013A, 0x0902, 0x0245,
  101. 0x00E9, 0x0016, 0x00E8, 0x0499, 0x0125, 0x0244, 0x004C, 0x0498, 0x090D,
  102. 0x00EB, 0x003C, 0x0011, 0x049B, 0x049A, 0x0485, 0x00EA, 0x003F, 0x0124,
  103. 0x090C, 0x003E, 0x0039, 0x0095, 0x0247, 0x0246, 0x0484, 0x0094, 0x0038, },
  104. { 0x0F09, 0x00CD, 0x01FD, 0x0791, 0x1E6D, 0x0790, 0x03D9, 0x3CD1, 0x3CD0,
  105. 0x0075, 0x0001, 0x0001, 0x0035, 0x00CC, 0x0011, 0x0000, 0x03D8, 0x01FC,
  106. 0x03DB, 0x0010, 0x0003, 0x00CF, 0x03DA, 0x00CE, 0x0074, 0x0034, 0x0077,
  107. 0x0793, 0x0013, 0x0076, 0x0071, 0x03C5, 0x0070, 0x01FF, 0x0792, 0x01FE,
  108. 0x01F9, 0x0037, 0x00C9, 0x0F08, 0x01F8, 0x03C4, 0x00C8, 0x0F0B, 0x079D,
  109. 0x03C7, 0x0001, 0x0012, 0x0073, 0x00CB, 0x0005, 0x0036, 0x03C6, 0x0072,
  110. 0x007D, 0x0002, 0x00CA, 0x079C, 0x01FB, 0x00F5, 0x0031, 0x079F, 0x0F0A,
  111. 0x0F35, 0x079E, 0x01FA, 0x1E6C, 0x1E6F, 0x3CD3, 0x0799, 0x03C1, 0x1E6E,
  112. 0x3CD2, 0x0030, 0x00F4, 0x007C, 0x03C0, 0x03C3, 0x0798, 0x01E5, 0x00F7, },
  113. { 0x01A5, 0x0001, 0x001D, 0x0021, 0x00A1, 0x000D, 0x0061, 0x06B9, 0x00A0,
  114. 0x0060, 0x0001, 0x0005, 0x000C, 0x0020, 0x001C, 0x0004, 0x01A4, 0x01A7,
  115. 0x00A3, 0x001F, 0x001E, 0x0023, 0x0022, 0x002D, 0x002C, 0x0063, 0x0062,
  116. 0x1A81, 0x01A6, 0x01A1, 0x06B8, 0x06BB, 0x00A2, 0x06BA, 0x0D59, 0x06A5,
  117. 0x01A0, 0x000F, 0x006D, 0x06A4, 0x002F, 0x00AD, 0x006C, 0x06A7, 0x00AC,
  118. 0x0D58, 0x000E, 0x01A3, 0x00AF, 0x00AE, 0x006F, 0x01A2, 0x0D5B, 0x00A9,
  119. 0x0019, 0x0001, 0x0009, 0x00A8, 0x006E, 0x002E, 0x0000, 0x01AD, 0x00AB,
  120. 0x00AA, 0x0355, 0x0029, 0x1A80, 0x1A83, 0x1A82, 0x0354, 0x01AC, 0x0D5A,
  121. 0x1A8D, 0x01AF, 0x0357, 0x0D45, 0x0D44, 0x0D47, 0x1A8C, 0x06A6, 0x06A1, },
  122. { 0x0001, 0x0011, 0x0005, 0x0775, 0x00F9, 0x00F8, 0x0031, 0x0030, 0x0049,
  123. 0x00FB, 0x0010, 0x0033, 0x0EC9, 0x038D, 0x038C, 0x00FA, 0x038F, 0x0774,
  124. 0x0048, 0x0032, 0x0000, 0x01D5, 0x00E5, 0x038E, 0x00E4, 0x0013, 0x000D,
  125. 0x0389, 0x0777, 0x0388, 0x038B, 0x1DF9, 0x0EC8, 0x3BC9, 0x1DF8, 0x038A,
  126. 0x03B5, 0x0776, 0x00E7, 0x3BC8, 0x01D4, 0x3BCB, 0x0ECB, 0x0771, 0x0ECA,
  127. 0x01D7, 0x03B4, 0x01D6, 0x1DFB, 0x0EF5, 0x0770, 0x0EF4, 0x3BCA, 0x0773,
  128. 0x00E6, 0x03B7, 0x004B, 0x1DFA, 0x03B6, 0x0EF7, 0x00E1, 0x0EF6, 0x0EF1,
  129. 0x03B1, 0x01D1, 0x003D, 0x0EF0, 0x0772, 0x077D, 0x077C, 0x003C, 0x01D0,
  130. 0x03B0, 0x01D3, 0x003F, 0x03B3, 0x01D2, 0x0EF3, 0x077F, 0x00E0, 0x004A, },
  131. { 0x0015, 0x0049, 0x0014, 0x07D1, 0x03FD, 0x03FC, 0x01C1, 0x01C0, 0x00F1,
  132. 0x0017, 0x0001, 0x0001, 0x01C3, 0x0048, 0x004B, 0x0016, 0x0031, 0x01C2,
  133. 0x004A, 0x0011, 0x0000, 0x01CD, 0x00F0, 0x01CC, 0x0075, 0x0010, 0x000D,
  134. 0x03FF, 0x01CF, 0x01CE, 0x07D0, 0x0F81, 0x07D3, 0x1F1D, 0x0F80, 0x07D2,
  135. 0x01C9, 0x03FE, 0x0074, 0x07DD, 0x00F3, 0x1F1C, 0x07DC, 0x03F9, 0x07DF,
  136. 0x00F2, 0x00FD, 0x0077, 0x07DE, 0x07D9, 0x01C8, 0x07D8, 0x0F83, 0x03F8,
  137. 0x0030, 0x0076, 0x0013, 0x0F82, 0x00FC, 0x03FB, 0x0033, 0x03FA, 0x03E5,
  138. 0x03E4, 0x01CB, 0x0032, 0x1F1F, 0x03E7, 0x07DB, 0x07DA, 0x003D, 0x01CA,
  139. 0x07C5, 0x03E6, 0x0071, 0x0F8D, 0x07C4, 0x1F1E, 0x0F8C, 0x03E1, 0x01F5, },
  140. { 0x0019, 0x0065, 0x0018, 0x0351, 0x0350, 0x0353, 0x0021, 0x0020, 0x0064,
  141. 0x001D, 0x0005, 0x0005, 0x01A5, 0x0023, 0x0067, 0x0005, 0x0066, 0x0022,
  142. 0x001B, 0x0004, 0x0001, 0x0004, 0x001C, 0x0061, 0x001A, 0x0005, 0x0004,
  143. 0x0007, 0x002D, 0x0006, 0x002C, 0x01A4, 0x002F, 0x0352, 0x035D, 0x0060,
  144. 0x0001, 0x002E, 0x001F, 0x035C, 0x0000, 0x06B1, 0x01A7, 0x0029, 0x01A6,
  145. 0x0028, 0x0063, 0x0062, 0x035F, 0x01A1, 0x002B, 0x06B0, 0x06B3, 0x01A0,
  146. 0x0003, 0x006D, 0x001E, 0x035E, 0x006C, 0x06B2, 0x0002, 0x01A3, 0x01A2,
  147. 0x000D, 0x0005, 0x0007, 0x01AD, 0x006F, 0x002A, 0x006E, 0x0004, 0x0004,
  148. 0x000C, 0x0007, 0x0006, 0x000F, 0x000E, 0x00D5, 0x0009, 0x0006, 0x0007, },
  149. { 0x0065, 0x0181, 0x0064, 0x36C9, 0x06D5, 0x0DB5, 0x0379, 0x0180, 0x0183,
  150. 0x00D5, 0x001D, 0x001C, 0x0DB4, 0x0182, 0x0378, 0x00D4, 0x00D7, 0x06D4,
  151. 0x0067, 0x001F, 0x0001, 0x00D6, 0x00D1, 0x018D, 0x0066, 0x0001, 0x0000,
  152. 0x037B, 0x06D7, 0x037A, 0x0DB7, 0x36C8, 0x06D6, 0x0DB6, 0x1B79, 0x0DB1,
  153. 0x018C, 0x0365, 0x00D0, 0x1B78, 0x00D3, 0x1B7B, 0x0364, 0x06D1, 0x06D0,
  154. 0x018F, 0x018E, 0x00D2, 0x36CB, 0x0367, 0x0366, 0x06D3, 0x0DB0, 0x06D2,
  155. 0x0361, 0x06DD, 0x0189, 0x36CA, 0x0360, 0x36F5, 0x0188, 0x0DB3, 0x36F4,
  156. 0x0009, 0x0008, 0x0005, 0x06DC, 0x00DD, 0x018B, 0x00DC, 0x0004, 0x000B,
  157. 0x018A, 0x0061, 0x0003, 0x0363, 0x00DF, 0x06DF, 0x0362, 0x000A, 0x001E, },
  158. { 0x001D, 0x0061, 0x000D, 0x0D55, 0x06B9, 0x06B8, 0x01A5, 0x0021, 0x0020,
  159. 0x0023, 0x000C, 0x0060, 0x0D54, 0x00AD, 0x00AC, 0x0022, 0x00AF, 0x06BB,
  160. 0x000F, 0x001C, 0x0001, 0x002D, 0x0063, 0x01A4, 0x000E, 0x0001, 0x0005,
  161. 0x01A7, 0x06BA, 0x01A6, 0x06A5, 0x0D57, 0x0D56, 0x1ABD, 0x0D51, 0x00AE,
  162. 0x002C, 0x00A9, 0x002F, 0x0D50, 0x01A1, 0x1ABC, 0x06A4, 0x06A7, 0x06A6,
  163. 0x00A8, 0x06A1, 0x01A0, 0x1ABF, 0x0D53, 0x06A0, 0x0D52, 0x1ABE, 0x06A3,
  164. 0x0062, 0x002E, 0x0009, 0x0D5D, 0x01A3, 0x0D5C, 0x006D, 0x00AB, 0x06A2,
  165. 0x006C, 0x001F, 0x0001, 0x06AD, 0x0029, 0x01A2, 0x0028, 0x0004, 0x001E,
  166. 0x01AD, 0x006F, 0x0000, 0x01AC, 0x01AF, 0x06AC, 0x00AA, 0x006E, 0x0019, },
  167. { 0x0019, 0x007D, 0x0018, 0x01B5, 0x000D, 0x01B4, 0x007C, 0x007F, 0x01B7,
  168. 0x000C, 0x001B, 0x001A, 0x01B6, 0x000F, 0x00D5, 0x0019, 0x007E, 0x00D4,
  169. 0x0018, 0x001B, 0x0001, 0x000E, 0x0011, 0x0009, 0x0005, 0x0005, 0x0005,
  170. 0x00D7, 0x01B1, 0x0008, 0x01B0, 0x0079, 0x06FD, 0x0371, 0x0370, 0x00D6,
  171. 0x0078, 0x01B3, 0x0010, 0x0373, 0x0013, 0x06FC, 0x007B, 0x007A, 0x00D1,
  172. 0x00D0, 0x00D3, 0x0065, 0x0372, 0x06FF, 0x0064, 0x06FE, 0x037D, 0x00D2,
  173. 0x00DD, 0x0067, 0x0004, 0x037C, 0x0012, 0x01B2, 0x0007, 0x0066, 0x01BD,
  174. 0x0006, 0x0061, 0x0004, 0x01BC, 0x001A, 0x0060, 0x001D, 0x0004, 0x001C,
  175. 0x0063, 0x0001, 0x0007, 0x000B, 0x0000, 0x0062, 0x000A, 0x0005, 0x0007, },
  176. { 0x0069, 0x0045, 0x0068, 0x04BD, 0x0255, 0x04BC, 0x00E5, 0x00E4, 0x0031,
  177. 0x0030, 0x0019, 0x0001, 0x0121, 0x00E7, 0x00E6, 0x0033, 0x00E1, 0x00E0,
  178. 0x006B, 0x0018, 0x0001, 0x0044, 0x0032, 0x0047, 0x006A, 0x001B, 0x0005,
  179. 0x003D, 0x0046, 0x0015, 0x0041, 0x0120, 0x0123, 0x04BF, 0x0122, 0x0040,
  180. 0x003C, 0x00E3, 0x0014, 0x0254, 0x0043, 0x0975, 0x012D, 0x00E2, 0x00ED,
  181. 0x0042, 0x00EC, 0x004D, 0x0257, 0x0256, 0x0251, 0x04BE, 0x0974, 0x0250,
  182. 0x00EF, 0x00EE, 0x004C, 0x04B9, 0x012C, 0x04B8, 0x004F, 0x04BB, 0x0253,
  183. 0x003F, 0x0017, 0x0001, 0x0252, 0x00E9, 0x00E8, 0x00EB, 0x0000, 0x0003,
  184. 0x0016, 0x0002, 0x0004, 0x004E, 0x003E, 0x00EA, 0x0049, 0x000D, 0x0007, },
  185. { 0x000D, 0x01BD, 0x000C, 0x0D31, 0x0D30, 0x0D33, 0x0359, 0x0358, 0x002D,
  186. 0x0065, 0x001D, 0x001C, 0x0D32, 0x035B, 0x035A, 0x002C, 0x01BC, 0x0345,
  187. 0x000F, 0x001F, 0x0001, 0x002F, 0x0064, 0x01BF, 0x0067, 0x0001, 0x0005,
  188. 0x0066, 0x002E, 0x0061, 0x0029, 0x0695, 0x0694, 0x0697, 0x0696, 0x0060,
  189. 0x01BE, 0x0D3D, 0x0028, 0x1A49, 0x0344, 0x1A48, 0x1A4B, 0x0D3C, 0x0691,
  190. 0x002B, 0x01B9, 0x002A, 0x0D3F, 0x0690, 0x0347, 0x0D3E, 0x1A4A, 0x0346,
  191. 0x00D5, 0x0341, 0x0063, 0x0D39, 0x0340, 0x0D38, 0x01B8, 0x0D3B, 0x0D3A,
  192. 0x00D4, 0x0062, 0x0000, 0x0693, 0x01BB, 0x0343, 0x0342, 0x001E, 0x000E,
  193. 0x006D, 0x0009, 0x0001, 0x006C, 0x00D7, 0x034D, 0x01BA, 0x0008, 0x0004, },
  194. { 0x0075, 0x00CD, 0x0035, 0x03C1, 0x03C0, 0x07F9, 0x03C3, 0x1F8D, 0x00CC,
  195. 0x0074, 0x0011, 0x0010, 0x03C2, 0x0FD9, 0x01F1, 0x00CF, 0x03CD, 0x00CE,
  196. 0x0034, 0x0001, 0x0001, 0x0037, 0x00C9, 0x00C8, 0x0036, 0x0000, 0x0001,
  197. 0x0FD8, 0x03CC, 0x00CB, 0x01F0, 0x07F8, 0x03CF, 0x07FB, 0x07FA, 0x00CA,
  198. 0x01F3, 0x03CE, 0x00F5, 0x0FDB, 0x00F4, 0x07E5, 0x07E4, 0x07E7, 0x01F2,
  199. 0x07E6, 0x03C9, 0x01FD, 0x0FDA, 0x1F8C, 0x07E1, 0x1F8F, 0x1F8E, 0x03C8,
  200. 0x03CB, 0x0077, 0x0076, 0x0FC5, 0x03CA, 0x07E0, 0x00F7, 0x0FC4, 0x03F5,
  201. 0x00F6, 0x01FC, 0x0003, 0x03F4, 0x0071, 0x03F7, 0x00F1, 0x0013, 0x0031,
  202. 0x0030, 0x0070, 0x0005, 0x0012, 0x0073, 0x01FF, 0x0072, 0x007D, 0x0002, },
  203. { 0x0061, 0x0055, 0x0060, 0x02C9, 0x02C8, 0x02CB, 0x0171, 0x00B5, 0x0054,
  204. 0x0001, 0x0001, 0x0001, 0x0057, 0x0001, 0x0063, 0x001D, 0x0062, 0x0039,
  205. 0x006D, 0x0000, 0x0005, 0x0038, 0x0056, 0x00B4, 0x006C, 0x0003, 0x001C,
  206. 0x006F, 0x003B, 0x0002, 0x003A, 0x0170, 0x00B7, 0x0173, 0x0051, 0x006E,
  207. 0x0025, 0x0050, 0x0069, 0x02CA, 0x0024, 0x0027, 0x0172, 0x00B6, 0x00B1,
  208. 0x000D, 0x000C, 0x001F, 0x017D, 0x0026, 0x0068, 0x0053, 0x017C, 0x006B,
  209. 0x001E, 0x000F, 0x0004, 0x017F, 0x006A, 0x02F5, 0x0019, 0x0021, 0x0052,
  210. 0x02F4, 0x02F7, 0x0020, 0x0BCD, 0x05E5, 0x05E4, 0x0BCC, 0x0023, 0x00B0,
  211. 0x02F6, 0x00B3, 0x0022, 0x02F1, 0x02F0, 0x0BCF, 0x0BCE, 0x017E, 0x005D, },
  212. { 0x00BD, 0x0025, 0x01A1, 0x0159, 0x0299, 0x00BC, 0x0024, 0x0505, 0x0504,
  213. 0x01A0, 0x0001, 0x001D, 0x006D, 0x001C, 0x0001, 0x0005, 0x0027, 0x01A3,
  214. 0x0158, 0x001F, 0x001E, 0x01A2, 0x0026, 0x0021, 0x000D, 0x0020, 0x0023,
  215. 0x0298, 0x006C, 0x0022, 0x00BF, 0x00BE, 0x01AD, 0x002D, 0x029B, 0x00B9,
  216. 0x01AC, 0x00B8, 0x01AF, 0x029A, 0x006F, 0x015B, 0x006E, 0x0285, 0x0284,
  217. 0x01AE, 0x0019, 0x002C, 0x01A9, 0x01A8, 0x000C, 0x000F, 0x015A, 0x00BB,
  218. 0x000E, 0x0000, 0x0069, 0x01AB, 0x0018, 0x01AA, 0x0004, 0x0055, 0x00BA,
  219. 0x0507, 0x0145, 0x0054, 0x0506, 0x00A5, 0x0501, 0x00A4, 0x0057, 0x0500,
  220. 0x0A05, 0x0144, 0x00A7, 0x0287, 0x0286, 0x0503, 0x0147, 0x0A04, 0x0146, },
  221. { 0x0759, 0x0041, 0x00E5, 0x03BD, 0x0E9D, 0x012D, 0x012C, 0x3A1D, 0x03BC,
  222. 0x012F, 0x000D, 0x0040, 0x00E4, 0x03BF, 0x0043, 0x0042, 0x0758, 0x03BE,
  223. 0x00E7, 0x0001, 0x0000, 0x003D, 0x00E6, 0x0015, 0x0014, 0x0017, 0x003C,
  224. 0x743D, 0x012E, 0x03B9, 0x03B8, 0x0E9C, 0x03BB, 0x075B, 0x3A1C, 0x0E9F,
  225. 0x0129, 0x00E1, 0x0128, 0x0E9E, 0x012B, 0x075A, 0x00E0, 0x0E99, 0x0745,
  226. 0x3A1F, 0x03BA, 0x0744, 0x0E98, 0x1D0D, 0x03A5, 0x0E9B, 0x743C, 0x0E9A,
  227. 0x012A, 0x004D, 0x00E3, 0x0E85, 0x01D5, 0x0E84, 0x004C, 0x0747, 0x1D0C,
  228. 0x01D4, 0x003F, 0x0016, 0x0746, 0x03A4, 0x0741, 0x004F, 0x003E, 0x01D7,
  229. 0x0740, 0x000C, 0x0011, 0x004E, 0x00E2, 0x00ED, 0x00EC, 0x0049, 0x0048, },
  230. };
  231. static const uint8_t aic_mode2_vlc_bits[AIC_MODE2_NUM][AIC_MODE2_SIZE] = {
  232. { 1, 5, 4, 10, 6, 8, 5, 8, 8,
  233. 7, 5, 7, 11, 10, 9, 8, 13, 11,
  234. 6, 7, 3, 9, 8, 10, 9, 8, 5,
  235. 10, 9, 10, 10, 14, 12, 14, 14, 12,
  236. 8, 9, 7, 12, 8, 14, 9, 9, 12,
  237. 8, 9, 11, 11, 13, 9, 11, 14, 12,
  238. 6, 7, 9, 13, 9, 12, 7, 10, 12,
  239. 11, 12, 8, 15, 10, 15, 13, 7, 12,
  240. 10, 10, 8, 10, 13, 13, 13, 11, 8, },
  241. { 4, 6, 5, 11, 8, 10, 7, 11, 9,
  242. 4, 1, 4, 9, 7, 7, 5, 9, 10,
  243. 6, 7, 4, 9, 9, 10, 9, 9, 6,
  244. 9, 10, 9, 10, 12, 12, 13, 12, 11,
  245. 9, 9, 8, 12, 8, 14, 10, 11, 12,
  246. 7, 8, 10, 11, 12, 9, 11, 13, 12,
  247. 6, 7, 8, 12, 9, 12, 7, 11, 10,
  248. 12, 12, 9, 14, 12, 15, 13, 8, 12,
  249. 11, 11, 10, 12, 13, 15, 14, 12, 9, },
  250. { 5, 7, 6, 12, 9, 11, 8, 11, 10,
  251. 7, 5, 7, 11, 10, 9, 8, 12, 12,
  252. 5, 5, 1, 8, 7, 10, 8, 6, 4,
  253. 8, 8, 8, 9, 12, 11, 13, 12, 11,
  254. 8, 9, 8, 12, 8, 13, 10, 11, 11,
  255. 8, 9, 11, 12, 13, 11, 12, 14, 13,
  256. 8, 9, 10, 14, 11, 14, 9, 13, 13,
  257. 8, 9, 6, 11, 10, 14, 11, 6, 10,
  258. 6, 6, 4, 8, 9, 10, 10, 8, 5, },
  259. { 11, 7, 8, 10, 12, 9, 10, 14, 12,
  260. 7, 1, 5, 7, 8, 6, 4, 10, 9,
  261. 10, 5, 4, 8, 11, 8, 7, 6, 7,
  262. 11, 6, 7, 8, 10, 8, 10, 11, 9,
  263. 10, 8, 9, 13, 9, 12, 8, 11, 12,
  264. 11, 4, 7, 8, 9, 6, 8, 12, 9,
  265. 8, 5, 8, 12, 9, 10, 6, 12, 11,
  266. 12, 12, 10, 15, 13, 13, 13, 10, 13,
  267. 15, 10, 9, 10, 12, 13, 13, 10, 9, },
  268. { 11, 8, 8, 11, 13, 10, 11, 15, 12,
  269. 7, 1, 4, 7, 7, 5, 4, 8, 9,
  270. 11, 5, 5, 8, 11, 9, 8, 7, 8,
  271. 13, 7, 8, 9, 11, 9, 10, 12, 10,
  272. 10, 9, 8, 13, 9, 12, 9, 11, 12,
  273. 11, 5, 7, 9, 10, 6, 9, 13, 10,
  274. 7, 4, 7, 11, 8, 9, 5, 10, 11,
  275. 13, 11, 9, 15, 13, 15, 13, 8, 12,
  276. 15, 10, 10, 12, 13, 14, 14, 12, 11, },
  277. { 12, 9, 9, 12, 13, 11, 11, 14, 12,
  278. 8, 2, 5, 7, 9, 6, 5, 10, 10,
  279. 9, 4, 2, 7, 9, 7, 6, 5, 6,
  280. 12, 6, 7, 8, 10, 8, 10, 11, 9,
  281. 12, 9, 10, 13, 11, 12, 10, 14, 13,
  282. 12, 6, 8, 10, 10, 7, 9, 12, 10,
  283. 8, 5, 8, 11, 9, 10, 7, 11, 12,
  284. 8, 6, 5, 11, 11, 11, 8, 6, 9,
  285. 12, 6, 6, 8, 10, 10, 11, 8, 6, },
  286. { 13, 9, 10, 12, 14, 12, 11, 15, 15,
  287. 8, 1, 5, 7, 9, 6, 5, 11, 10,
  288. 11, 6, 5, 9, 11, 9, 8, 7, 8,
  289. 12, 6, 8, 8, 11, 8, 10, 12, 10,
  290. 10, 7, 9, 13, 10, 11, 9, 13, 12,
  291. 11, 3, 6, 8, 9, 4, 7, 11, 8,
  292. 8, 5, 9, 12, 10, 9, 7, 12, 13,
  293. 13, 12, 10, 14, 14, 15, 12, 11, 14,
  294. 15, 7, 9, 8, 11, 11, 12, 10, 9, },
  295. { 10, 5, 6, 9, 11, 7, 8, 12, 11,
  296. 8, 1, 4, 7, 9, 6, 4, 10, 10,
  297. 11, 6, 6, 9, 9, 9, 9, 8, 8,
  298. 14, 10, 10, 12, 12, 11, 12, 13, 12,
  299. 10, 7, 8, 12, 9, 11, 8, 12, 11,
  300. 13, 7, 10, 11, 11, 8, 10, 13, 11,
  301. 6, 3, 7, 11, 8, 9, 5, 10, 11,
  302. 11, 11, 9, 14, 14, 14, 11, 10, 13,
  303. 14, 10, 11, 13, 13, 13, 14, 12, 12, },
  304. { 2, 5, 3, 11, 8, 8, 6, 6, 7,
  305. 8, 5, 6, 12, 10, 10, 8, 10, 11,
  306. 7, 6, 2, 9, 8, 10, 8, 5, 4,
  307. 10, 11, 10, 10, 13, 12, 14, 13, 10,
  308. 10, 11, 8, 14, 9, 14, 12, 11, 12,
  309. 9, 10, 9, 13, 12, 11, 12, 14, 11,
  310. 8, 10, 7, 13, 10, 12, 8, 12, 12,
  311. 10, 9, 6, 12, 11, 11, 11, 6, 9,
  312. 10, 9, 6, 10, 9, 12, 11, 8, 7, },
  313. { 6, 8, 6, 12, 11, 11, 10, 10, 9,
  314. 6, 1, 3, 10, 8, 8, 6, 7, 10,
  315. 8, 6, 3, 10, 9, 10, 8, 6, 5,
  316. 11, 10, 10, 12, 13, 12, 14, 13, 12,
  317. 10, 11, 8, 12, 9, 14, 12, 11, 12,
  318. 9, 9, 8, 12, 12, 10, 12, 13, 11,
  319. 7, 8, 6, 13, 9, 11, 7, 11, 11,
  320. 11, 10, 7, 14, 11, 12, 12, 7, 10,
  321. 12, 11, 8, 13, 12, 14, 13, 11, 10, },
  322. { 7, 10, 7, 13, 13, 13, 11, 11, 10,
  323. 8, 5, 6, 12, 11, 10, 9, 10, 11,
  324. 7, 5, 1, 9, 8, 10, 7, 4, 4,
  325. 9, 11, 9, 11, 12, 11, 13, 13, 10,
  326. 9, 11, 8, 13, 9, 14, 12, 11, 12,
  327. 11, 10, 10, 13, 12, 11, 14, 14, 12,
  328. 9, 10, 8, 13, 10, 14, 9, 12, 12,
  329. 9, 7, 4, 12, 10, 11, 10, 6, 7,
  330. 9, 7, 4, 9, 9, 11, 9, 7, 5, },
  331. { 7, 9, 7, 14, 11, 12, 10, 9, 9,
  332. 8, 5, 5, 12, 9, 10, 8, 8, 11,
  333. 7, 5, 2, 8, 8, 9, 7, 4, 4,
  334. 10, 11, 10, 12, 14, 11, 12, 13, 12,
  335. 9, 10, 8, 13, 8, 13, 10, 11, 11,
  336. 9, 9, 8, 14, 10, 10, 11, 12, 11,
  337. 10, 11, 9, 14, 10, 14, 9, 12, 14,
  338. 6, 6, 3, 11, 8, 9, 8, 3, 6,
  339. 9, 7, 4, 10, 8, 11, 10, 6, 5, },
  340. { 6, 8, 7, 13, 12, 12, 10, 9, 9,
  341. 9, 7, 8, 13, 11, 11, 9, 11, 12,
  342. 7, 6, 1, 9, 8, 10, 7, 5, 4,
  343. 10, 12, 10, 12, 13, 13, 14, 13, 11,
  344. 9, 11, 9, 13, 10, 14, 12, 12, 12,
  345. 11, 12, 10, 14, 13, 12, 13, 14, 12,
  346. 8, 9, 7, 13, 10, 13, 8, 11, 12,
  347. 8, 6, 3, 12, 9, 10, 9, 4, 6,
  348. 10, 8, 5, 10, 10, 12, 11, 8, 6, },
  349. { 7, 10, 7, 12, 9, 12, 10, 10, 12,
  350. 9, 7, 7, 12, 9, 11, 6, 10, 11,
  351. 6, 6, 1, 9, 8, 9, 7, 4, 5,
  352. 11, 12, 9, 12, 10, 14, 13, 13, 11,
  353. 10, 12, 8, 13, 8, 14, 10, 10, 11,
  354. 11, 11, 10, 13, 14, 10, 14, 13, 11,
  355. 11, 10, 7, 13, 8, 12, 7, 10, 12,
  356. 7, 10, 4, 12, 6, 10, 8, 5, 8,
  357. 10, 7, 4, 9, 7, 10, 9, 6, 5, },
  358. { 7, 9, 7, 13, 12, 13, 10, 10, 8,
  359. 8, 5, 6, 11, 10, 10, 8, 10, 10,
  360. 7, 5, 2, 9, 8, 9, 7, 5, 3,
  361. 8, 9, 7, 9, 11, 11, 13, 11, 9,
  362. 8, 10, 7, 12, 9, 14, 11, 10, 10,
  363. 9, 10, 9, 12, 12, 12, 13, 14, 12,
  364. 10, 10, 9, 13, 11, 13, 9, 13, 12,
  365. 8, 7, 4, 12, 10, 10, 10, 6, 6,
  366. 7, 6, 3, 9, 8, 10, 9, 6, 3, },
  367. { 7, 10, 7, 13, 13, 13, 11, 11, 9,
  368. 8, 6, 6, 13, 11, 11, 9, 10, 11,
  369. 7, 6, 1, 9, 8, 10, 8, 5, 4,
  370. 8, 9, 8, 9, 12, 12, 12, 12, 8,
  371. 10, 13, 9, 14, 11, 14, 14, 13, 12,
  372. 9, 10, 9, 13, 12, 11, 13, 14, 11,
  373. 9, 11, 8, 13, 11, 13, 10, 13, 13,
  374. 9, 8, 5, 12, 10, 11, 11, 6, 7,
  375. 8, 7, 3, 8, 9, 11, 10, 7, 4, },
  376. { 8, 9, 7, 11, 11, 12, 11, 14, 9,
  377. 8, 6, 6, 11, 13, 10, 9, 11, 9,
  378. 7, 5, 1, 7, 9, 9, 7, 5, 3,
  379. 13, 11, 9, 10, 12, 11, 12, 12, 9,
  380. 10, 11, 9, 13, 9, 12, 12, 12, 10,
  381. 12, 11, 10, 13, 14, 12, 14, 14, 11,
  382. 11, 8, 8, 13, 11, 12, 9, 13, 11,
  383. 9, 10, 5, 11, 8, 11, 9, 6, 7,
  384. 7, 8, 4, 6, 8, 10, 8, 8, 5, },
  385. { 8, 10, 8, 13, 13, 13, 12, 11, 10,
  386. 5, 1, 3, 10, 7, 8, 6, 8, 9,
  387. 8, 7, 4, 9, 10, 11, 8, 7, 6,
  388. 8, 9, 7, 9, 12, 11, 12, 10, 8,
  389. 9, 10, 8, 13, 9, 9, 12, 11, 11,
  390. 7, 7, 6, 12, 9, 8, 10, 12, 8,
  391. 6, 7, 4, 12, 8, 13, 6, 9, 10,
  392. 13, 13, 9, 15, 14, 14, 15, 9, 11,
  393. 13, 11, 9, 13, 13, 15, 15, 12, 10, },
  394. { 10, 8, 9, 11, 12, 10, 8, 13, 13,
  395. 9, 2, 5, 7, 5, 4, 3, 8, 9,
  396. 11, 5, 5, 9, 8, 8, 6, 8, 8,
  397. 12, 7, 8, 10, 10, 9, 8, 12, 10,
  398. 9, 10, 9, 12, 7, 11, 7, 12, 12,
  399. 9, 5, 8, 9, 9, 6, 6, 11, 10,
  400. 6, 4, 7, 9, 5, 9, 3, 9, 10,
  401. 13, 11, 9, 13, 10, 13, 10, 9, 13,
  402. 14, 11, 10, 12, 12, 13, 11, 14, 11, },
  403. { 11, 7, 8, 10, 12, 9, 9, 14, 10,
  404. 9, 4, 7, 8, 10, 7, 7, 11, 10,
  405. 8, 2, 2, 6, 8, 5, 5, 5, 6,
  406. 15, 9, 10, 10, 12, 10, 11, 14, 12,
  407. 9, 8, 9, 12, 9, 11, 8, 12, 11,
  408. 14, 10, 11, 12, 13, 10, 12, 15, 12,
  409. 9, 7, 8, 12, 9, 12, 7, 11, 13,
  410. 9, 6, 5, 11, 10, 11, 7, 6, 9,
  411. 11, 4, 5, 7, 8, 8, 8, 7, 7, },
  412. };
  413. //@}
  414. /**
  415. * Codes used for determining block type
  416. */
  417. //@{
  418. #define AIC_MODE1_NUM 90
  419. #define AIC_MODE1_SIZE 9
  420. #define AIC_MODE1_BITS 7
  421. static const uint8_t aic_mode1_vlc_codes[AIC_MODE1_NUM][AIC_MODE1_SIZE] = {
  422. { 0x01, 0x01, 0x01, 0x11, 0x00, 0x09, 0x03, 0x10, 0x05,},
  423. { 0x09, 0x01, 0x01, 0x05, 0x11, 0x00, 0x03, 0x21, 0x20,},
  424. { 0x01, 0x01, 0x01, 0x11, 0x09, 0x10, 0x05, 0x00, 0x03,},
  425. { 0x01, 0x01, 0x00, 0x03, 0x21, 0x05, 0x09, 0x20, 0x11,},
  426. { 0x01, 0x09, 0x00, 0x29, 0x08, 0x15, 0x03, 0x0B, 0x28,},
  427. { 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x03, 0x02,},
  428. { 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x01, 0x09, 0x08,},
  429. { 0x01, 0x01, 0x01, 0x09, 0x01, 0x08, 0x00, 0x03, 0x05,},
  430. { 0x01, 0x01, 0x01, 0x00, 0x05, 0x11, 0x09, 0x10, 0x03,},
  431. { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,},
  432. { 0x01, 0x01, 0x01, 0x05, 0x01, 0x00, 0x03, 0x09, 0x08,},
  433. { 0x09, 0x01, 0x01, 0x05, 0x11, 0x00, 0x03, 0x21, 0x20,},
  434. { 0x01, 0x01, 0x01, 0x0D, 0x05, 0x04, 0x00, 0x07, 0x0C,},
  435. { 0x01, 0x01, 0x00, 0x05, 0x11, 0x03, 0x09, 0x21, 0x20,},
  436. { 0x05, 0x01, 0x01, 0x11, 0x00, 0x09, 0x03, 0x21, 0x20,},
  437. { 0x09, 0x01, 0x01, 0x00, 0x05, 0x01, 0x03, 0x11, 0x10,},
  438. { 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x03, 0x02,},
  439. { 0x01, 0x01, 0x01, 0x09, 0x00, 0x05, 0x01, 0x03, 0x08,},
  440. { 0x01, 0x01, 0x01, 0x09, 0x11, 0x05, 0x00, 0x10, 0x03,},
  441. { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,},
  442. { 0x01, 0x00, 0x01, 0x09, 0x08, 0x15, 0x14, 0x0B, 0x03,},
  443. { 0x0D, 0x01, 0x01, 0x05, 0x0C, 0x04, 0x01, 0x00, 0x07,},
  444. { 0x01, 0x01, 0x01, 0x05, 0x00, 0x04, 0x03, 0x01, 0x01,},
  445. { 0x05, 0x01, 0x01, 0x04, 0x19, 0x07, 0x18, 0x0D, 0x00,},
  446. { 0x11, 0x09, 0x01, 0x21, 0x05, 0x20, 0x01, 0x00, 0x03,},
  447. { 0x41, 0x01, 0x00, 0x05, 0x40, 0x03, 0x09, 0x21, 0x11,},
  448. { 0x29, 0x01, 0x00, 0x28, 0x09, 0x15, 0x03, 0x08, 0x0B,},
  449. { 0x01, 0x00, 0x01, 0x11, 0x09, 0x10, 0x05, 0x01, 0x03,},
  450. { 0x05, 0x01, 0x01, 0x04, 0x0D, 0x0C, 0x07, 0x00, 0x01,},
  451. { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,},
  452. { 0x01, 0x00, 0x03, 0x05, 0x11, 0x10, 0x25, 0x24, 0x13,},
  453. { 0x21, 0x01, 0x01, 0x00, 0x11, 0x03, 0x05, 0x20, 0x09,},
  454. { 0x01, 0x01, 0x01, 0x00, 0x09, 0x11, 0x10, 0x05, 0x03,},
  455. { 0x21, 0x05, 0x01, 0x01, 0x09, 0x00, 0x11, 0x20, 0x03,},
  456. { 0x05, 0x01, 0x00, 0x04, 0x01, 0x19, 0x07, 0x18, 0x0D,},
  457. { 0x11, 0x01, 0x00, 0x01, 0x09, 0x01, 0x03, 0x10, 0x05,},
  458. { 0x1D, 0x01, 0x05, 0x0D, 0x0C, 0x04, 0x00, 0x1C, 0x0F,},
  459. { 0x05, 0x19, 0x01, 0x04, 0x00, 0x18, 0x1B, 0x1A, 0x07,},
  460. { 0x09, 0x01, 0x00, 0x01, 0x05, 0x03, 0x11, 0x10, 0x01,},
  461. { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,},
  462. { 0x01, 0x00, 0x03, 0x41, 0x05, 0x40, 0x09, 0x11, 0x21,},
  463. { 0x05, 0x01, 0x01, 0x19, 0x04, 0x07, 0x00, 0x18, 0x0D,},
  464. { 0x01, 0x01, 0x01, 0x05, 0x01, 0x04, 0x01, 0x00, 0x03,},
  465. { 0x01, 0x05, 0x00, 0x0D, 0x01, 0x04, 0x07, 0x19, 0x18,},
  466. { 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x02,},
  467. { 0x31, 0x01, 0x05, 0x19, 0x04, 0x07, 0x00, 0x30, 0x0D,},
  468. { 0x01, 0x00, 0x03, 0x11, 0x01, 0x05, 0x01, 0x09, 0x10,},
  469. { 0x01, 0x05, 0x01, 0x11, 0x01, 0x10, 0x00, 0x03, 0x09,},
  470. { 0x01, 0x09, 0x00, 0x29, 0x03, 0x08, 0x28, 0x15, 0x0B,},
  471. { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,},
  472. { 0x01, 0x01, 0x00, 0x09, 0x15, 0x03, 0x08, 0x14, 0x0B,},
  473. { 0x11, 0x01, 0x01, 0x00, 0x09, 0x01, 0x03, 0x10, 0x05,},
  474. { 0x01, 0x00, 0x03, 0x25, 0x11, 0x05, 0x10, 0x24, 0x13,},
  475. { 0x11, 0x01, 0x00, 0x01, 0x09, 0x01, 0x05, 0x10, 0x03,},
  476. { 0x05, 0x01, 0x00, 0x0D, 0x0C, 0x04, 0x0F, 0x1D, 0x1C,},
  477. { 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x03, 0x02,},
  478. { 0x21, 0x01, 0x05, 0x09, 0x11, 0x00, 0x03, 0x41, 0x40,},
  479. { 0x05, 0x01, 0x00, 0x1D, 0x1C, 0x0D, 0x0C, 0x0F, 0x04,},
  480. { 0x05, 0x01, 0x00, 0x0D, 0x31, 0x04, 0x19, 0x30, 0x07,},
  481. { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,},
  482. { 0x01, 0x01, 0x00, 0x21, 0x05, 0x11, 0x03, 0x09, 0x20,},
  483. { 0x01, 0x01, 0x00, 0x11, 0x03, 0x05, 0x01, 0x09, 0x10,},
  484. { 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x02,},
  485. { 0x05, 0x01, 0x04, 0x19, 0x07, 0x0D, 0x00, 0x31, 0x30,},
  486. { 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x02,},
  487. { 0x05, 0x01, 0x01, 0x11, 0x09, 0x00, 0x03, 0x21, 0x20,},
  488. { 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x02,},
  489. { 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x01, 0x01, 0x02,},
  490. { 0x09, 0x01, 0x00, 0x29, 0x08, 0x15, 0x03, 0x28, 0x0B,},
  491. { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,},
  492. { 0x01, 0x01, 0x01, 0x05, 0x01, 0x04, 0x00, 0x01, 0x03,},
  493. { 0x09, 0x01, 0x00, 0x29, 0x28, 0x15, 0x08, 0x03, 0x0B,},
  494. { 0x01, 0x00, 0x01, 0x11, 0x05, 0x10, 0x09, 0x01, 0x03,},
  495. { 0x05, 0x04, 0x01, 0x1D, 0x0D, 0x0C, 0x1C, 0x00, 0x0F,},
  496. { 0x09, 0x11, 0x01, 0x41, 0x00, 0x40, 0x05, 0x03, 0x21,},
  497. { 0x0D, 0x05, 0x01, 0x1D, 0x1C, 0x0C, 0x04, 0x00, 0x0F,},
  498. { 0x41, 0x09, 0x01, 0x40, 0x00, 0x11, 0x05, 0x03, 0x21,},
  499. { 0x01, 0x01, 0x01, 0x05, 0x01, 0x04, 0x00, 0x01, 0x03,},
  500. { 0x05, 0x04, 0x01, 0x0D, 0x01, 0x0C, 0x07, 0x01, 0x00,},
  501. { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,},
  502. { 0x05, 0x04, 0x01, 0x07, 0x19, 0x31, 0x30, 0x0D, 0x00,},
  503. { 0x21, 0x01, 0x01, 0x00, 0x11, 0x09, 0x20, 0x05, 0x03,},
  504. { 0x05, 0x01, 0x01, 0x04, 0x07, 0x0D, 0x0C, 0x00, 0x01,},
  505. { 0x21, 0x09, 0x01, 0x00, 0x20, 0x05, 0x23, 0x22, 0x03,},
  506. { 0x31, 0x0D, 0x01, 0x19, 0x05, 0x30, 0x04, 0x07, 0x00,},
  507. { 0x31, 0x05, 0x01, 0x04, 0x19, 0x00, 0x0D, 0x30, 0x07,},
  508. { 0x31, 0x01, 0x00, 0x0D, 0x05, 0x19, 0x04, 0x30, 0x07,},
  509. { 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x02, 0x01, 0x01,},
  510. { 0x01, 0x00, 0x01, 0x01, 0x05, 0x09, 0x08, 0x03, 0x01,},
  511. { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,},
  512. };
  513. static const uint8_t aic_mode1_vlc_bits[AIC_MODE1_NUM][AIC_MODE1_SIZE] = {
  514. { 1, 4, 2, 7, 4, 6, 4, 7, 5,},
  515. { 5, 1, 3, 4, 6, 3, 3, 7, 7,},
  516. { 1, 4, 2, 7, 6, 7, 5, 4, 4,},
  517. { 1, 3, 3, 3, 7, 4, 5, 7, 6,},
  518. { 2, 4, 2, 6, 4, 5, 2, 4, 6,},
  519. { 7, 2, 3, 4, 7, 1, 5, 7, 7,},
  520. { 5, 1, 3, 6, 5, 5, 2, 7, 7,},
  521. { 2, 5, 1, 7, 3, 7, 5, 5, 6,},
  522. { 2, 4, 1, 4, 5, 7, 6, 7, 4,},
  523. { 0, 0, 0, 0, 0, 0, 0, 0, 0,},
  524. { 2, 1, 3, 6, 5, 5, 5, 7, 7,},
  525. { 5, 1, 3, 4, 6, 3, 3, 7, 7,},
  526. { 4, 1, 2, 6, 5, 5, 4, 5, 6,},
  527. { 3, 1, 3, 4, 6, 3, 5, 7, 7,},
  528. { 4, 1, 3, 6, 3, 5, 3, 7, 7,},
  529. { 6, 1, 4, 4, 5, 2, 4, 7, 7,},
  530. { 7, 1, 5, 7, 4, 3, 2, 7, 7,},
  531. { 5, 3, 2, 7, 5, 6, 1, 5, 7,},
  532. { 4, 1, 2, 6, 7, 5, 4, 7, 4,},
  533. { 1, 0, 1, 0, 0, 0, 0, 0, 0,},
  534. { 3, 3, 1, 5, 5, 6, 6, 5, 3,},
  535. { 6, 2, 1, 5, 6, 5, 4, 4, 5,},
  536. { 6, 4, 1, 7, 6, 7, 6, 3, 2,},
  537. { 4, 3, 1, 4, 6, 4, 6, 5, 3,},
  538. { 6, 5, 1, 7, 4, 7, 3, 3, 3,},
  539. { 7, 2, 2, 3, 7, 2, 4, 6, 5,},
  540. { 6, 2, 2, 6, 4, 5, 2, 4, 4,},
  541. { 4, 4, 1, 7, 6, 7, 5, 2, 4,},
  542. { 5, 4, 1, 5, 6, 6, 5, 4, 2,},
  543. { 0, 0, 0, 0, 0, 0, 0, 0, 0,},
  544. { 2, 2, 2, 3, 5, 5, 6, 6, 5,},
  545. { 7, 1, 3, 3, 6, 3, 4, 7, 5,},
  546. { 2, 4, 1, 4, 6, 7, 7, 5, 4,},
  547. { 7, 4, 3, 1, 5, 3, 6, 7, 3,},
  548. { 4, 3, 3, 4, 1, 6, 4, 6, 5,},
  549. { 7, 4, 4, 2, 6, 1, 4, 7, 5,},
  550. { 5, 2, 3, 4, 4, 3, 2, 5, 4,},
  551. { 3, 5, 2, 3, 2, 5, 5, 5, 3,},
  552. { 6, 4, 4, 2, 5, 4, 7, 7, 1,},
  553. { 0, 0, 0, 0, 0, 0, 0, 0, 0,},
  554. { 2, 2, 2, 7, 3, 7, 4, 5, 6,},
  555. { 4, 1, 3, 6, 4, 4, 3, 6, 5,},
  556. { 2, 4, 1, 7, 3, 7, 6, 6, 6,},
  557. { 3, 4, 3, 5, 1, 4, 4, 6, 6,},
  558. { 4, 5, 2, 7, 1, 7, 3, 7, 7,},
  559. { 6, 2, 3, 5, 3, 3, 2, 6, 4,},
  560. { 4, 4, 4, 7, 2, 5, 1, 6, 7,},
  561. { 4, 5, 2, 7, 1, 7, 4, 4, 6,},
  562. { 2, 4, 2, 6, 2, 4, 6, 5, 4,},
  563. { 0, 0, 0, 0, 0, 0, 0, 0, 0,},
  564. { 1, 3, 3, 5, 6, 3, 5, 6, 5,},
  565. { 7, 1, 4, 4, 6, 2, 4, 7, 5,},
  566. { 2, 2, 2, 6, 5, 3, 5, 6, 5,},
  567. { 7, 4, 4, 2, 6, 1, 5, 7, 4,},
  568. { 3, 2, 2, 4, 4, 3, 4, 5, 5,},
  569. { 7, 2, 5, 3, 7, 1, 4, 7, 7,},
  570. { 6, 2, 3, 4, 5, 2, 2, 7, 7,},
  571. { 3, 2, 2, 5, 5, 4, 4, 4, 3,},
  572. { 3, 2, 2, 4, 6, 3, 5, 6, 3,},
  573. { 0, 0, 0, 0, 0, 0, 0, 0, 0,},
  574. { 1, 3, 3, 7, 4, 6, 3, 5, 7,},
  575. { 4, 1, 4, 7, 4, 5, 2, 6, 7,},
  576. { 2, 4, 1, 7, 5, 7, 3, 7, 7,},
  577. { 3, 2, 3, 5, 3, 4, 2, 6, 6,},
  578. { 3, 5, 4, 7, 2, 7, 1, 7, 7,},
  579. { 4, 1, 3, 6, 5, 3, 3, 7, 7,},
  580. { 4, 2, 5, 7, 3, 7, 1, 7, 7,},
  581. { 7, 4, 1, 7, 3, 7, 2, 5, 7,},
  582. { 4, 2, 2, 6, 4, 5, 2, 6, 4,},
  583. { 0, 0, 0, 0, 0, 0, 0, 0, 0,},
  584. { 3, 4, 1, 7, 6, 7, 6, 2, 6,},
  585. { 4, 2, 2, 6, 6, 5, 4, 2, 4,},
  586. { 4, 4, 1, 7, 5, 7, 6, 2, 4,},
  587. { 3, 3, 2, 5, 4, 4, 5, 2, 4,},
  588. { 4, 5, 2, 7, 2, 7, 3, 2, 6,},
  589. { 4, 3, 2, 5, 5, 4, 3, 2, 4,},
  590. { 7, 4, 2, 7, 2, 5, 3, 2, 6,},
  591. { 4, 6, 2, 7, 3, 7, 6, 1, 6,},
  592. { 5, 5, 1, 6, 4, 6, 5, 2, 4,},
  593. { 0, 0, 0, 0, 0, 0, 0, 0, 0,},
  594. { 3, 3, 2, 3, 5, 6, 6, 4, 2,},
  595. { 7, 1, 3, 3, 6, 5, 7, 4, 3,},
  596. { 5, 4, 1, 5, 5, 6, 6, 4, 2,},
  597. { 6, 4, 2, 2, 6, 3, 6, 6, 2,},
  598. { 6, 4, 2, 5, 3, 6, 3, 3, 2,},
  599. { 6, 3, 2, 3, 5, 2, 4, 6, 3,},
  600. { 6, 2, 2, 4, 3, 5, 3, 6, 3,},
  601. { 7, 5, 1, 7, 4, 7, 7, 3, 2,},
  602. { 5, 5, 2, 3, 6, 7, 7, 5, 1,},
  603. { 0, 0, 0, 0, 0, 0, 0, 0, 0,},
  604. };
  605. //@}
  606. #define PBTYPE_ESCAPE 0xFF
  607. /** tables used for P-frame macroblock type decoding */
  608. //@{
  609. #define NUM_PTYPE_VLCS 7
  610. #define PTYPE_VLC_SIZE 8
  611. #define PTYPE_VLC_BITS 7
  612. static const uint8_t ptype_vlc_codes[NUM_PTYPE_VLCS][PTYPE_VLC_SIZE] = {
  613. { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 },
  614. { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 },
  615. { 0x0D, 0x05, 0x01, 0x04, 0x01, 0x00, 0x07, 0x0C },
  616. { 0x09, 0x11, 0x01, 0x00, 0x05, 0x03, 0x21, 0x20 },
  617. { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 },
  618. { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 },
  619. { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 }
  620. };
  621. static const uint8_t ptype_vlc_bits[NUM_PTYPE_VLCS][PTYPE_VLC_SIZE] = {
  622. { 1, 2, 3, 6, 5, 4, 7, 7 },
  623. { 3, 1, 2, 7, 6, 5, 4, 7 },
  624. { 5, 4, 1, 4, 3, 3, 4, 5 },
  625. { 4, 5, 2, 2, 3, 2, 6, 6 },
  626. { 5, 6, 1, 4, 2, 3, 7, 7 },
  627. { 5, 6, 1, 4, 3, 2, 7, 7 },
  628. { 6, 3, 2, 7, 5, 4, 1, 7 }
  629. };
  630. static const uint8_t ptype_vlc_syms[PTYPE_VLC_SIZE] = {
  631. 0, 1, 2, 3, 8, 9, 11, PBTYPE_ESCAPE
  632. };
  633. /** reverse of ptype_vlc_syms */
  634. static const uint8_t block_num_to_ptype_vlc_num[12] = {
  635. 0, 1, 2, 3, 0, 0, 2, 0, 4, 5, 0, 6
  636. };
  637. //@}
  638. /** tables used for P-frame macroblock type decoding */
  639. //@{
  640. #define NUM_BTYPE_VLCS 6
  641. #define BTYPE_VLC_SIZE 7
  642. #define BTYPE_VLC_BITS 6
  643. static const uint8_t btype_vlc_codes[NUM_BTYPE_VLCS][BTYPE_VLC_SIZE] = {
  644. { 0x01, 0x05, 0x00, 0x03, 0x11, 0x09, 0x10 },
  645. { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 },
  646. { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 },
  647. { 0x09, 0x01, 0x00, 0x01, 0x05, 0x03, 0x08 },
  648. { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 },
  649. { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 }
  650. };
  651. static const uint8_t btype_vlc_bits[NUM_BTYPE_VLCS][PTYPE_VLC_SIZE] = {
  652. { 2, 3, 2, 2, 5, 4, 5 },
  653. { 4, 1, 3, 2, 6, 5, 6 },
  654. { 6, 4, 1, 2, 5, 3, 6 },
  655. { 5, 3, 3, 1, 4, 3, 5 },
  656. { 6, 5, 3, 2, 4, 1, 6 },
  657. { 6, 5, 3, 1, 4, 2, 6 }
  658. };
  659. static const uint8_t btype_vlc_syms[BTYPE_VLC_SIZE] = {
  660. 0, 1, 4, 5, 10, 7, PBTYPE_ESCAPE
  661. };
  662. /** reverse of btype_vlc_syms */
  663. static const uint8_t block_num_to_btype_vlc_num[12] = {
  664. 0, 1, 0, 0, 2, 3, 0, 5, 0, 0, 4, 0
  665. };
  666. //@}
  667. #endif /* AVCODEC_RV40VLC2_H */