diff mbox series

[FFmpeg-devel,7/9] avcodec/wmaprodec: Use ff_init_vlc_from_lengths() instead of init_vlc

Message ID AS8P250MB07445A8EC93621506838BB498F7C9@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit f050bc0506643cf2a7211634b4ba3310fa290190
Headers show
Series [FFmpeg-devel,1/9] avcodec/dvdata: Order code table by codes | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 4, 2022, 9:58 p.m. UTC
It allows to replace tables of big codes (uint16_t and uint32_t)
by tables of smaller symbols (mostly uint8_t).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/wmaprodata.h | 551 ++++++++++++++++------------------------
 libavcodec/wmaprodec.c  |  42 +--
 2 files changed, 236 insertions(+), 357 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/wmaprodata.h b/libavcodec/wmaprodata.h
index 53824799d5..3a30be40b5 100644
--- a/libavcodec/wmaprodata.h
+++ b/libavcodec/wmaprodata.h
@@ -48,42 +48,32 @@  static const uint16_t critical_freq[] = {
  */
 #define HUFF_SCALE_SIZE    121
 #define HUFF_SCALE_MAXBITS  19
-static const uint16_t scale_huffcodes[HUFF_SCALE_SIZE] = {
-    0xE639, 0xE6C2, 0xE6C1, 0xE6C0, 0xE63F, 0xE63E, 0xE63D, 0xE63C,
-    0xE63B, 0xE63A, 0xE638, 0xE637, 0xE636, 0xE635, 0xE634, 0xE632,
-    0xE633, 0xE620, 0x737B, 0xE610, 0xE611, 0xE612, 0xE613, 0xE614,
-    0xE615, 0xE616, 0xE617, 0xE618, 0xE619, 0xE61A, 0xE61B, 0xE61C,
-    0xE61D, 0xE61E, 0xE61F, 0xE6C3, 0xE621, 0xE622, 0xE623, 0xE624,
-    0xE625, 0xE626, 0xE627, 0xE628, 0xE629, 0xE62A, 0xE62B, 0xE62C,
-    0xE62D, 0xE62E, 0xE62F, 0xE630, 0xE631, 0x1CDF, 0x0E60, 0x0399,
-    0x00E7, 0x001D, 0x0000, 0x0001, 0x0001, 0x0001, 0x0002, 0x0006,
-    0x0002, 0x0007, 0x0006, 0x000F, 0x0038, 0x0072, 0x039A, 0xE6C4,
-    0xE6C5, 0xE6C6, 0xE6C7, 0xE6C8, 0xE6C9, 0xE6CA, 0xE6CB, 0xE6CC,
-    0xE6CD, 0xE6CE, 0xE6CF, 0xE6D0, 0xE6D1, 0xE6D2, 0xE6D3, 0xE6D4,
-    0xE6D5, 0xE6D6, 0xE6D7, 0xE6D8, 0xE6D9, 0xE6DA, 0xE6DB, 0xE6DC,
-    0xE6DD, 0xE6DE, 0xE6DF, 0xE6E0, 0xE6E1, 0xE6E2, 0xE6E3, 0xE6E4,
-    0xE6E5, 0xE6E6, 0xE6E7, 0xE6E8, 0xE6E9, 0xE6EA, 0xE6EB, 0xE6EC,
-    0xE6ED, 0xE6EE, 0xE6EF, 0xE6F0, 0xE6F1, 0xE6F2, 0xE6F3, 0xE6F4,
-    0xE6F5,
-};
-
-static const uint8_t scale_huffbits[HUFF_SCALE_SIZE] = {
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 18, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 16, 15, 13,
-    11,  8,  5,  2,  1,  3,  5,  6,
-     6,  7,  7,  7,  9, 10, 13, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19,
+static const uint8_t scale_table[HUFF_SCALE_SIZE][2] = {
+    {  58,  5 }, {  64,  6 }, {  66,  7 }, {  65,  7 }, {  62,  5 },
+    {  63,  6 }, {  68,  9 }, {  69, 10 }, {  54, 15 }, {  19, 19 },
+    {  20, 19 }, {  21, 19 }, {  22, 19 }, {  23, 19 }, {  24, 19 },
+    {  25, 19 }, {  26, 19 }, {  27, 19 }, {  28, 19 }, {  29, 19 },
+    {  30, 19 }, {  31, 19 }, {  32, 19 }, {  33, 19 }, {  34, 19 },
+    {  17, 19 }, {  36, 19 }, {  37, 19 }, {  38, 19 }, {  39, 19 },
+    {  40, 19 }, {  41, 19 }, {  42, 19 }, {  43, 19 }, {  44, 19 },
+    {  45, 19 }, {  46, 19 }, {  47, 19 }, {  48, 19 }, {  49, 19 },
+    {  50, 19 }, {  51, 19 }, {  52, 19 }, {  15, 19 }, {  16, 19 },
+    {  14, 19 }, {  13, 19 }, {  12, 19 }, {  11, 19 }, {  10, 19 },
+    {   0, 19 }, {   9, 19 }, {   8, 19 }, {   7, 19 }, {   6, 19 },
+    {   5, 19 }, {   4, 19 }, {  55, 13 }, {  70, 13 }, {   3, 19 },
+    {   2, 19 }, {   1, 19 }, {  35, 19 }, {  71, 19 }, {  72, 19 },
+    {  73, 19 }, {  74, 19 }, {  75, 19 }, {  76, 19 }, {  77, 19 },
+    {  78, 19 }, {  79, 19 }, {  80, 19 }, {  81, 19 }, {  82, 19 },
+    {  83, 19 }, {  84, 19 }, {  85, 19 }, {  86, 19 }, {  87, 19 },
+    {  88, 19 }, {  89, 19 }, {  90, 19 }, {  91, 19 }, {  92, 19 },
+    {  93, 19 }, {  94, 19 }, {  95, 19 }, {  96, 19 }, {  97, 19 },
+    {  98, 19 }, {  99, 19 }, { 100, 19 }, { 101, 19 }, { 102, 19 },
+    { 103, 19 }, { 104, 19 }, { 105, 19 }, { 106, 19 }, { 107, 19 },
+    { 108, 19 }, { 109, 19 }, { 110, 19 }, { 111, 19 }, { 112, 19 },
+    { 113, 19 }, { 114, 19 }, { 115, 19 }, { 116, 19 }, { 117, 19 },
+    { 118, 19 }, { 119, 19 }, { 120, 19 }, {  18, 18 }, {  53, 16 },
+    {  56, 11 }, {  57,  8 }, {  67,  7 }, {  61,  3 }, {  59,  2 },
+    {  60,  1 },
 };
 /** @} */
 
@@ -94,46 +84,31 @@  static const uint8_t scale_huffbits[HUFF_SCALE_SIZE] = {
  */
 #define HUFF_SCALE_RL_SIZE    120
 #define HUFF_SCALE_RL_MAXBITS  21
-static const uint32_t scale_rl_huffcodes[HUFF_SCALE_RL_SIZE] = {
-    0x00010C, 0x000001, 0x10FE2A, 0x000003, 0x000003, 0x000001, 0x000013,
-    0x000020, 0x000029, 0x000014, 0x000016, 0x000045, 0x000049, 0x00002F,
-    0x000042, 0x00008E, 0x00008F, 0x000129, 0x000009, 0x00000D, 0x0004AC,
-    0x00002C, 0x000561, 0x0002E6, 0x00087C, 0x0002E2, 0x00095C, 0x000018,
-    0x000001, 0x000016, 0x000044, 0x00002A, 0x000007, 0x000159, 0x000143,
-    0x000128, 0x00015A, 0x00012D, 0x00002B, 0x0000A0, 0x000142, 0x00012A,
-    0x0002EF, 0x0004AF, 0x00087D, 0x004AE9, 0x0043F9, 0x000067, 0x000199,
-    0x002B05, 0x001583, 0x0021FE, 0x10FE2C, 0x000004, 0x00002E, 0x00010D,
-    0x00000A, 0x000244, 0x000017, 0x000245, 0x000011, 0x00010E, 0x00012C,
-    0x00002A, 0x00002F, 0x000121, 0x000046, 0x00087E, 0x0000BA, 0x000032,
-    0x0087F0, 0x0056DC, 0x0002EC, 0x0043FA, 0x002B6F, 0x004AE8, 0x0002B7,
-    0x10FE2B, 0x000001, 0x000051, 0x000010, 0x0002EE, 0x000B9C, 0x002576,
-    0x000198, 0x0056DD, 0x0000CD, 0x000AC0, 0x000170, 0x004AEF, 0x00002D,
-    0x0004AD, 0x0021FF, 0x0005CF, 0x002B04, 0x10FE29, 0x10FE28, 0x0002ED,
-    0x002E74, 0x021FC4, 0x004AEE, 0x010FE3, 0x087F17, 0x000000, 0x000097,
-    0x0002E3, 0x000ADA, 0x002575, 0x00173B, 0x0043FB, 0x002E75, 0x10FE2D,
-    0x0015B6, 0x00056C, 0x000057, 0x000123, 0x000120, 0x00021E, 0x000172,
-    0x0002B1,
-};
-
-static const uint8_t scale_rl_huffbits[HUFF_SCALE_RL_SIZE] = {
-     9,  2, 21,  2,  4,  5,  5,
-     6,  6,  7,  7,  7,  7,  6,
-     7,  8,  8,  9, 10, 10, 11,
-    12, 11, 12, 12, 12, 12, 11,
-     4,  5,  7,  8,  9,  9,  9,
-     9,  9,  9,  8,  8,  9,  9,
-    12, 11, 12, 15, 15, 13, 15,
-    14, 13, 14, 21,  5,  6,  9,
-    10, 10, 11, 10, 11,  9,  9,
-     6,  8,  9,  7, 12, 10, 12,
-    16, 15, 12, 15, 14, 15, 10,
-    21,  6,  7, 11, 12, 14, 14,
-    15, 15, 14, 12, 11, 15, 12,
-    11, 14, 13, 14, 21, 21, 12,
-    16, 18, 15, 17, 20,  7,  8,
-    12, 12, 14, 15, 15, 16, 21,
-    13, 11,  7,  9,  9, 10, 11,
-    10,
+static const uint8_t scale_rl_table[HUFF_SCALE_RL_SIZE][2] = {
+    { 103,  7 }, {  80, 11 }, {  60, 11 }, {  18, 10 }, {  56, 10 },
+    {  21, 12 }, {  90, 12 }, {  58, 11 }, {  27, 11 }, {  69, 12 },
+    {  84, 15 }, {  48, 15 }, {  86, 14 }, {  47, 13 }, {  19, 10 },
+    {  32,  9 }, {  78,  6 }, {   5,  5 }, {  28,  4 }, {  53,  5 },
+    {   9,  7 }, {  31,  8 }, {  38,  8 }, {  10,  7 }, {  88, 11 },
+    {  25, 12 }, { 105, 12 }, { 118, 11 }, {  23, 12 }, {  82, 14 },
+    {  98, 16 }, { 110, 16 }, { 108, 15 }, {  93, 13 }, {  68, 10 },
+    {  72, 12 }, {  97, 12 }, {  81, 12 }, {  42, 12 }, {  64,  8 },
+    {   4,  4 }, {   1,  2 }, {   7,  6 }, {  14,  7 }, {   0,  9 },
+    {  55,  9 }, {  61,  9 }, { 117, 10 }, {  24, 12 }, {  44, 12 },
+    {  67, 12 }, {  70, 16 }, {  99, 18 }, {  96, 21 }, {  95, 21 },
+    {   2, 21 }, {  77, 21 }, {  52, 21 }, { 111, 21 }, { 102, 20 },
+    { 101, 17 }, {  46, 15 }, {  73, 15 }, { 109, 15 }, {  51, 14 },
+    {  92, 14 }, {  30,  7 }, {  11,  7 }, {  66,  7 }, {  15,  8 },
+    {  16,  8 }, { 116,  9 }, {  65,  9 }, {  57, 10 }, {  59, 10 },
+    { 115,  9 }, {  12,  7 }, {  35,  9 }, {  17,  9 }, {  41,  9 },
+    {  20, 11 }, {  91, 11 }, {  26, 12 }, {  75, 15 }, {  45, 15 },
+    { 107, 14 }, {  83, 14 }, { 100, 15 }, {  89, 15 }, {  43, 11 },
+    {  62,  9 }, {  37,  9 }, { 104,  8 }, {   6,  5 }, {  39,  8 },
+    {  40,  9 }, {  34,  9 }, {  79,  7 }, {   8,  6 }, {  63,  6 },
+    {  87, 12 }, {  94, 14 }, {  49, 14 }, {  50, 13 }, {  22, 11 },
+    { 119, 10 }, {  33,  9 }, {  36,  9 }, { 113, 11 }, { 106, 12 },
+    { 112, 13 }, {  71, 15 }, {  85, 15 }, {  74, 14 }, {  76, 10 },
+    { 114,  7 }, {  29,  5 }, {  54,  6 }, {  13,  6 }, {   3,  2 },
 };
 
 
@@ -165,167 +140,99 @@  static const uint8_t scale_rl_level[HUFF_SCALE_RL_SIZE] = {
  */
 #define HUFF_COEF0_SIZE    272
 #define HUFF_COEF0_MAXBITS  21
-static const uint32_t coef0_huffcodes[HUFF_COEF0_SIZE] = {
-    0x00004A, 0x00002B, 0x000000, 0x000003, 0x000006, 0x000009, 0x00000F,
-    0x000010, 0x000016, 0x000011, 0x000016, 0x000028, 0x00002F, 0x000026,
-    0x000029, 0x000045, 0x000055, 0x00005D, 0x000042, 0x00004E, 0x000051,
-    0x00005E, 0x00008D, 0x0000A8, 0x0000AD, 0x000080, 0x000096, 0x00009F,
-    0x0000AA, 0x0000BE, 0x00011C, 0x000153, 0x000158, 0x000170, 0x000104,
-    0x00010D, 0x000105, 0x000103, 0x00012F, 0x000177, 0x000175, 0x000157,
-    0x000174, 0x000225, 0x00023B, 0x00020D, 0x00021F, 0x000281, 0x00027B,
-    0x000282, 0x0002AC, 0x0002FD, 0x00044F, 0x000478, 0x00044D, 0x0002EC,
-    0x00044E, 0x000564, 0x000409, 0x00040B, 0x000501, 0x000545, 0x0004F3,
-    0x000541, 0x00043B, 0x0004F1, 0x0004F4, 0x0008FD, 0x000A94, 0x000811,
-    0x000B88, 0x000B91, 0x000B93, 0x0008EA, 0x000899, 0x000B8A, 0x000972,
-    0x0009E5, 0x000A8F, 0x000A84, 0x000A8E, 0x000A00, 0x000830, 0x0008E8,
-    0x000B95, 0x000871, 0x00083A, 0x000814, 0x000873, 0x000BFE, 0x001728,
-    0x001595, 0x001712, 0x00102A, 0x001021, 0x001729, 0x00152E, 0x0013C3,
-    0x001721, 0x001597, 0x00151B, 0x0010F2, 0x001403, 0x001703, 0x001503,
-    0x001708, 0x0013C1, 0x00170E, 0x00170C, 0x0010E1, 0x0011EA, 0x001020,
-    0x001500, 0x0017FA, 0x001704, 0x001705, 0x0017F0, 0x0017FB, 0x0021E6,
-    0x002B2D, 0x0020C6, 0x002B29, 0x002E4A, 0x0023AC, 0x001519, 0x0023F3,
-    0x002B2C, 0x0021C0, 0x0017FE, 0x0023D7, 0x0017F9, 0x0012E7, 0x0013C0,
-    0x002261, 0x0023D3, 0x002057, 0x002056, 0x0021D2, 0x0020C7, 0x0023D2,
-    0x0020EC, 0x0044C0, 0x002FE2, 0x00475B, 0x002A03, 0x002FE3, 0x0021E2,
-    0x0021D0, 0x002A31, 0x002E13, 0x002E05, 0x0047E5, 0x00000E, 0x000024,
-    0x000088, 0x0000B9, 0x00010C, 0x000224, 0x0002B3, 0x000283, 0x0002ED,
-    0x00047B, 0x00041E, 0x00043D, 0x0004F5, 0x0005FD, 0x000A92, 0x000B96,
-    0x000838, 0x000971, 0x000B83, 0x000B80, 0x000BF9, 0x0011D3, 0x0011E8,
-    0x0011D7, 0x001527, 0x0011F8, 0x001073, 0x0010F0, 0x0010E4, 0x0017F8,
-    0x001062, 0x001402, 0x0017E3, 0x00151A, 0x001077, 0x00152B, 0x00170D,
-    0x0021D3, 0x002E41, 0x0013C2, 0x000029, 0x0000A9, 0x00025D, 0x000419,
-    0x000544, 0x000B8B, 0x0009E4, 0x0011D2, 0x001526, 0x001724, 0x0012E6,
-    0x00150B, 0x0017FF, 0x002E26, 0x002E4B, 0x002B28, 0x0021E3, 0x002A14,
-    0x00475A, 0x002E12, 0x000057, 0x00023E, 0x000A90, 0x000BF0, 0x001072,
-    0x001502, 0x0023D6, 0x0020ED, 0x002A30, 0x0044C7, 0x00008C, 0x00047F,
-    0x00152A, 0x002262, 0x002E04, 0x0000A1, 0x0005F9, 0x000173, 0x000875,
-    0x000171, 0x00152D, 0x0002E3, 0x0017E2, 0x0002AD, 0x0021C1, 0x000479,
-    0x0021E7, 0x00041F, 0x005C4E, 0x000543, 0x005C4F, 0x000A91, 0x00898D,
-    0x000B97, 0x008746, 0x000970, 0x008745, 0x000B85, 0x00A856, 0x00152F,
-    0x010E8E, 0x0010E5, 0x00A857, 0x00170F, 0x021D11, 0x002A58, 0x010E8F,
-    0x002E40, 0x021D13, 0x002A59, 0x043A25, 0x002A02, 0x043A21, 0x0044C1,
-    0x087448, 0x0047E4, 0x043A20, 0x00542A, 0x087449, 0x00898C,
+static const uint8_t coef0_lens[HUFF_COEF0_SIZE] = {
+     2,  9, 14, 14, 13, 12, 13, 14, 15, 15, 12, 10, 10, 10, 13, 14, 15, 15, 12,
+    11, 13, 14, 14, 13, 15, 15, 14, 12, 12,  8, 10, 10, 15, 15, 14, 13, 14, 14,
+    13, 15, 20, 20, 19, 21, 21, 20, 19, 17, 17, 18, 18, 15, 15, 13, 12, 14, 15,
+    15, 14, 15, 15, 12, 11,  6,  7,  8,  9, 13, 13, 13, 14, 14, 11, 10,  7,  8,
+    14, 14, 14, 14, 12, 13, 13, 12, 12, 12, 11,  9, 13, 14, 14, 12, 11, 11, 11,
+     9,  8,  7, 14, 15, 15, 14, 14, 12, 13, 15, 16, 17, 17, 14, 12, 12, 12, 15,
+    15, 14, 14, 14, 13, 13,  9,  9, 11, 11, 10,  7,  6, 13, 15, 15, 14, 14, 14,
+    13, 14, 15, 15, 13, 14, 14, 14, 14, 10,  9, 10, 10, 11, 11, 10,  8,  9, 13,
+    14, 14, 12, 11, 14, 15, 15, 13, 12, 14, 14, 14, 14, 13, 14, 14,  3,  5,  8,
+    10, 10, 15, 15, 14, 14, 16, 16, 15, 12, 11, 11, 11,  7,  8,  8,  9, 12, 13,
+    13, 12, 14, 15, 15, 13, 10, 11, 11, 13, 14, 14, 13, 14, 14, 11, 10, 13, 15,
+    15, 14, 12, 11,  4,  6,  6,  8, 12, 12, 12, 13, 13, 12, 13, 13, 14, 14, 13,
+    13, 13,  9,  7,  9, 11, 14, 14, 13, 14, 14, 13, 10,  8,  7,  5,  9, 12, 13,
+    14, 15, 15, 12, 12, 10, 14, 14, 13, 12, 13, 14, 14, 12, 13, 13, 12, 12, 12,
+     9,  7,  6,  3,  4,  4,
 };
 
-static const uint8_t coef0_huffbits[HUFF_COEF0_SIZE] = {
-     8,  7,  2,  3,  3,  4,  4,
-     5,  5,  6,  6,  6,  6,  7,
-     7,  7,  7,  7,  8,  8,  8,
-     8,  8,  8,  8,  9,  9,  9,
-     9,  9,  9,  9,  9,  9, 10,
-    10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 11, 11, 11, 11,
-    11, 11, 11, 11, 11, 11, 11,
-    11, 11, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 13,
-    12, 12, 12, 12, 12, 12, 13,
-    13, 13, 13, 13, 13, 13, 12,
-    12, 13, 13, 13, 13, 13, 13,
-    13, 13, 14, 14, 13, 13, 14,
-    13, 13, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 13, 14,
-    14, 14, 14, 14, 14, 14, 15,
-    14, 15, 14, 14, 14, 14, 14,
-    14, 15, 14, 14, 14, 14, 14,
-    14, 14, 15, 15, 15, 15, 14,
-    15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15,  4,  7,
-     8,  9, 10, 10, 10, 11, 11,
-    11, 12, 12, 12, 12, 12, 12,
-    13, 13, 13, 13, 13, 13, 13,
-    13, 13, 13, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 13, 14,
-    15, 14, 14,  6,  9, 11, 12,
-    12, 12, 13, 13, 13, 13, 14,
-    14, 14, 14, 14, 14, 15, 15,
-    15, 15,  7, 10, 12, 13, 14,
-    14, 14, 15, 15, 15,  8, 11,
-    13, 14, 15,  9, 12,  9, 13,
-    10, 13, 10, 14, 11, 15, 11,
-    15, 12, 15, 12, 15, 12, 16,
-    12, 17, 13, 17, 13, 17, 13,
-    18, 14, 17, 14, 19, 14, 18,
-    14, 19, 14, 20, 15, 20, 15,
-    21, 15, 20, 16, 21, 16,
+static const uint16_t coef0_syms[HUFF_COEF0_SIZE] = {
+      2,  25, 111,  94,  69,  58,  87,  93, 136, 135,  59,  37,  34,  36,  82,
+    182, 120, 138, 195,  45, 168, 216, 178,  86, 140, 219, 186, 162, 239,  18,
+    156,  35, 127, 236, 109,  85, 180, 253,  88, 147, 268, 264, 256, 266, 270,
+    262, 260, 248, 246, 252, 258, 137, 189, 230,  64, 179, 146, 208, 101, 118,
+    238, 163,  46,   9, 153,   0,  26, 247, 169,  76, 202, 131, 194,  38,  13,
+     19, 132, 106, 191,  97,  65, 198,  77,  62,  66, 164,  48,  27,  81, 183,
+    102,  60,  47,  49, 159, 227,  20,  14, 112, 263, 144, 217, 104,  63,  79,
+    209, 269, 250, 254, 203, 241, 196,  61, 220, 148, 124, 185, 100,  80,  78,
+    193,  28,  50, 235,  41,   1,  10, 171, 226, 150, 103, 114, 115, 170, 105,
+    211, 149, 249, 108, 188, 107, 255, 231, 155,  42,  40,  55, 160,  39,  21,
+     29, 215, 234, 184, 228,  51, 116, 142, 145, 172, 165, 181, 130, 113, 117,
+     89, 128, 204,   3,   7, 154, 157,  43, 141, 265, 133, 225, 271, 244, 221,
+     74,  54,  56,  52,  15, 222,  22,  30,  83, 199, 173,  73, 123, 210, 143,
+    175,  44,  53, 237, 174, 139, 134, 110, 218, 129, 161, 213, 177, 267, 151,
+    125,  67, 223,   5,  11, 192,  23, 214, 243, 166, 200, 176,  68, 224, 187,
+    257, 261, 232,  96, 251,  31,  16,  32,  57, 207, 121,  91, 126, 119,  99,
+    158,  24, 212,   8,  33,  70,  92, 205, 240, 242,  75, 197, 233, 259, 190,
+     98,  71, 201, 122, 206,  72,  90,  95,  84, 167, 245, 229,  17,  12,   4,
+    152,   6,
 };
 
 
 #define HUFF_COEF1_SIZE    244
 #define HUFF_COEF1_MAXBITS  22
-static const uint32_t coef1_huffcodes[HUFF_COEF1_SIZE] = {
-    0x0001E2, 0x00007F, 0x000000, 0x000002, 0x000008, 0x00000E, 0x000019,
-    0x00002F, 0x000037, 0x000060, 0x00006C, 0x000095, 0x0000C6, 0x0000F0,
-    0x00012E, 0x000189, 0x0001A5, 0x0001F8, 0x000253, 0x00030A, 0x000344,
-    0x00034D, 0x0003F2, 0x0004BD, 0x0005D7, 0x00062A, 0x00068B, 0x000693,
-    0x000797, 0x00097D, 0x000BAB, 0x000C52, 0x000C5E, 0x000D21, 0x000D20,
-    0x000F1A, 0x000FCE, 0x000FD1, 0x0012F1, 0x001759, 0x0018AC, 0x0018A7,
-    0x0018BF, 0x001A2B, 0x001E52, 0x001E50, 0x001E31, 0x001FB8, 0x0025E6,
-    0x0025E7, 0x002EB4, 0x002EB7, 0x003169, 0x00315B, 0x00317C, 0x00316C,
-    0x0034CA, 0x00348D, 0x003F40, 0x003CA2, 0x003F76, 0x004BC3, 0x004BE5,
-    0x003F73, 0x004BF8, 0x004BF9, 0x006131, 0x00628B, 0x006289, 0x0062DA,
-    0x00628A, 0x0062D4, 0x006997, 0x0062B4, 0x006918, 0x00794D, 0x007E7B,
-    0x007E87, 0x007EEA, 0x00794E, 0x00699D, 0x007967, 0x00699F, 0x0062DB,
-    0x007E7A, 0x007EEB, 0x00BAC0, 0x0097C9, 0x00C537, 0x00C5AB, 0x00D233,
-    0x00D338, 0x00BAC1, 0x00D23D, 0x012F91, 0x00D339, 0x00FDC8, 0x00D23C,
-    0x00FDDC, 0x00FDC9, 0x00FDDD, 0x00D33C, 0x000003, 0x000016, 0x00003E,
-    0x0000C3, 0x0001A1, 0x000347, 0x00062E, 0x000BAA, 0x000F2D, 0x001A2A,
-    0x001E58, 0x00309B, 0x003CA3, 0x005D6A, 0x00629A, 0x006996, 0x00794F,
-    0x007EE5, 0x00BAD7, 0x00C5AA, 0x00C5F4, 0x00FDDF, 0x00FDDE, 0x018A20,
-    0x018A6D, 0x01A67B, 0x01A464, 0x025F21, 0x01F9E2, 0x01F9E3, 0x00000A,
-    0x00003D, 0x000128, 0x0003C7, 0x000C24, 0x0018A3, 0x002EB1, 0x003CB2,
-    0x00691F, 0x007E79, 0x000013, 0x0000BB, 0x00034E, 0x000D14, 0x0025FD,
-    0x004BE7, 0x000024, 0x000188, 0x0007EF, 0x000035, 0x000308, 0x0012F2,
-    0x00005C, 0x0003F6, 0x0025E0, 0x00006D, 0x000698, 0x000096, 0x000C25,
-    0x0000C7, 0x000F1B, 0x0000F3, 0x0012FF, 0x000174, 0x001A66, 0x0001A0,
-    0x003099, 0x0001E4, 0x00316B, 0x000252, 0x003F31, 0x00030B, 0x004BE6,
-    0x000346, 0x0062FB, 0x00034F, 0x007966, 0x0003F5, 0x007E86, 0x0005D4,
-    0x00C511, 0x00062C, 0x00C5F5, 0x000692, 0x00F299, 0x000795, 0x00F298,
-    0x0007E9, 0x018A21, 0x00097E, 0x0175AD, 0x000C27, 0x01A67A, 0x000C57,
-    0x02EB59, 0x000D22, 0x0314D9, 0x000F19, 0x03F3C2, 0x000FCD, 0x0348CB,
-    0x0012F8, 0x04BE41, 0x0018A0, 0x03F3C1, 0x0018A1, 0x04BE40, 0x0018B7,
-    0x0629B0, 0x001A64, 0x0D2329, 0x001E30, 0x03F3C3, 0x001F9F, 0x0BAD62,
-    0x001F99, 0x0FCF00, 0x00309A, 0x0629B1, 0x002EB6, 0x175AC3, 0x00314C,
-    0x069195, 0x003168, 0x0BAD63, 0x00348E, 0x175AC1, 0x003F30, 0x07E781,
-    0x003F41, 0x0D2328, 0x003F42, 0x1F9E03, 0x004BC2, 0x175AC2, 0x003F74,
-    0x175AC0, 0x005D61, 0x3F3C05, 0x006130, 0x3F3C04, 0x0062B5,
-};
-
-static const uint8_t coef1_huffbits[HUFF_COEF1_SIZE] = {
-     9,  7,  2,  3,  4,  4,  5,
-     6,  6,  7,  7,  8,  8,  8,
-     9,  9,  9,  9, 10, 10, 10,
-    10, 10, 11, 11, 11, 11, 11,
-    11, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 13, 13, 13, 13,
-    13, 13, 13, 13, 13, 13, 14,
-    14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 15, 15,
-    14, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15,
-    15, 15, 16, 16, 16, 16, 16,
-    16, 16, 16, 17, 16, 16, 16,
-    16, 16, 16, 16,  3,  5,  6,
-     8,  9, 10, 11, 12, 12, 13,
-    13, 14, 14, 15, 15, 15, 15,
-    15, 16, 16, 16, 16, 16, 17,
-    17, 17, 17, 18, 17, 17,  4,
-     6,  9, 10, 12, 13, 14, 14,
-    15, 15,  5,  8, 10, 12, 14,
-    15,  6,  9, 11,  6, 10, 13,
-     7, 10, 14,  7, 11,  8, 12,
-     8, 12,  8, 13,  9, 13,  9,
-    14,  9, 14, 10, 14, 10, 15,
-    10, 15, 10, 15, 10, 15, 11,
-    16, 11, 16, 11, 16, 11, 16,
-    11, 17, 12, 17, 12, 17, 12,
-    18, 12, 18, 12, 18, 12, 18,
-    13, 19, 13, 18, 13, 19, 13,
-    19, 13, 20, 13, 18, 13, 20,
-    13, 20, 14, 19, 14, 21, 14,
-    19, 14, 20, 14, 21, 14, 19,
-    14, 20, 14, 21, 15, 21, 14,
-    21, 15, 22, 15, 22, 15,
+static const uint8_t coef1_table[HUFF_COEF1_SIZE][2] = {
+    {   2,  2 }, {   3,  3 }, { 102,  3 }, {   4,  4 }, { 148,  6 },
+    { 134,  9 }, { 171, 10 }, {  18, 10 }, {  11,  8 }, { 159,  8 },
+    {  14,  9 }, { 156, 14 }, { 235, 15 }, {  61, 15 }, {  38, 13 },
+    { 153, 13 }, {  48, 14 }, {  49, 14 }, {  23, 11 }, { 203, 13 },
+    { 208, 19 }, { 204, 19 }, { 129, 18 }, {  94, 17 }, {  87, 16 },
+    {  62, 15 }, { 174, 15 }, { 147, 15 }, {  29, 12 }, { 191, 12 },
+    {  64, 15 }, {  65, 15 }, { 146, 14 }, { 164, 13 }, { 142,  5 },
+    { 132,  4 }, { 103,  5 }, { 154,  7 }, { 165,  9 }, { 181, 11 },
+    { 109, 12 }, {  30, 12 }, {  86, 16 }, {  92, 16 }, { 239, 15 },
+    { 138, 14 }, {  39, 13 }, {  50, 14 }, { 115, 15 }, { 238, 21 },
+    { 228, 21 }, { 236, 21 }, { 222, 21 }, { 216, 20 }, { 226, 20 },
+    { 196, 18 }, { 192, 17 }, { 120, 16 }, { 221, 14 }, {  51, 14 },
+    {  24, 11 }, { 143,  8 }, {   7,  6 }, {   9,  7 }, { 152, 10 },
+    { 136, 12 }, { 160, 12 }, { 241, 15 }, {  66, 15 }, { 168, 14 },
+    { 219, 14 }, { 113, 14 }, { 193, 12 }, {  19, 10 }, { 173, 10 },
+    { 105,  8 }, { 149,  9 }, {  15,  9 }, { 205, 13 }, { 207, 13 },
+    { 125, 17 }, { 190, 17 }, { 182, 16 }, {  68, 15 }, {  70, 15 },
+    {  67, 15 }, { 137, 13 }, {  31, 12 }, { 223, 14 }, { 116, 15 },
+    { 210, 19 }, { 220, 19 }, { 198, 18 }, { 126, 17 }, {  88, 16 },
+    {  41, 13 }, {  25, 11 }, {  40, 13 }, {  73, 15 }, { 243, 15 },
+    {  53, 14 }, { 195, 12 }, { 183, 11 }, { 225, 14 }, {  52, 14 },
+    {  71, 15 }, { 121, 16 }, {  89, 16 }, { 170, 14 }, {  55, 14 },
+    {  69, 15 }, {  83, 15 }, { 209, 13 }, { 108, 11 }, {  32, 12 },
+    {  54, 14 }, { 122, 16 }, { 184, 16 }, { 176, 15 }, {  42, 13 },
+    {  12,  8 }, { 161,  8 }, {   6,  5 }, { 167,  9 }, { 106,  9 },
+    {  20, 10 }, { 145, 12 }, { 111, 13 }, {  43, 13 }, {  26, 11 },
+    { 175, 10 }, { 107, 10 }, {  34, 12 }, {  33, 12 }, { 197, 12 },
+    {  74, 15 }, { 128, 17 }, { 232, 20 }, { 212, 20 }, { 224, 19 },
+    { 202, 18 }, {  90, 16 }, {  57, 14 }, { 227, 14 }, {  97, 16 },
+    {  93, 16 }, { 140, 15 }, { 185, 11 }, {  27, 11 }, {  16,  9 },
+    { 158, 11 }, { 211, 13 }, {  56, 14 }, { 117, 15 }, {  72, 15 },
+    { 166, 13 }, {  91, 16 }, {  95, 16 }, {  80, 15 }, { 101, 16 },
+    { 194, 17 }, { 127, 17 }, {  82, 15 }, {  21, 10 }, { 144, 10 },
+    { 177, 10 }, { 151,  6 }, {  10,  7 }, { 157,  7 }, {   8,  6 },
+    {   5,  4 }, {  13,  8 }, {   0,  9 }, { 213, 13 }, {  46, 13 },
+    { 199, 12 }, {  35, 12 }, { 162, 12 }, { 135, 10 }, { 169,  9 },
+    {  45, 13 }, {  59, 14 }, { 114, 14 }, {  44, 13 }, { 188, 16 },
+    { 186, 16 }, {  75, 15 }, {  79, 15 }, { 118, 15 }, { 187, 11 },
+    { 112, 13 }, { 139, 14 }, { 178, 15 }, {  81, 15 }, { 110, 12 },
+    {  28, 11 }, { 163,  8 }, { 133,  6 }, { 104,  6 }, {  17,  9 },
+    {  22, 10 }, { 229, 14 }, { 172, 14 }, { 217, 13 }, { 201, 12 },
+    {  36, 12 }, { 218, 20 }, { 242, 22 }, { 240, 22 }, { 234, 21 },
+    { 230, 19 }, { 206, 18 }, { 200, 18 }, { 214, 18 }, { 130, 17 },
+    { 131, 17 }, { 141, 15 }, {  84, 15 }, {  76, 15 }, { 215, 13 },
+    {  58, 14 }, { 231, 14 }, { 233, 14 }, { 180, 15 }, {  77, 15 },
+    {  37, 12 }, { 189, 11 }, { 179, 10 }, { 155, 10 }, {  47, 13 },
+    {  96, 16 }, {  99, 16 }, { 119, 15 }, {  63, 14 }, { 237, 14 },
+    {  78, 15 }, {  85, 15 }, {  60, 14 }, {  98, 16 }, { 100, 16 },
+    { 124, 16 }, { 123, 16 }, { 150, 11 }, {   1,  7 },
 };
 
 
@@ -418,122 +325,94 @@  static const float coef1_level[HUFF_COEF1_SIZE] = {
  */
 #define HUFF_VEC4_SIZE    127
 #define HUFF_VEC4_MAXBITS  14
-static const uint16_t vec4_huffcodes[HUFF_VEC4_SIZE] = {
-    0x0019, 0x0027, 0x00F2, 0x03BA, 0x0930, 0x1267, 0x0031, 0x0030,
-    0x0097, 0x0221, 0x058B, 0x0124, 0x00EB, 0x01D4, 0x03D8, 0x0584,
-    0x0364, 0x045F, 0x0F66, 0x0931, 0x24CD, 0x002F, 0x0039, 0x00E8,
-    0x02C3, 0x078A, 0x0037, 0x0029, 0x0084, 0x01B1, 0x00ED, 0x0086,
-    0x00F9, 0x03AB, 0x01EB, 0x08BC, 0x011E, 0x00F3, 0x0220, 0x058A,
-    0x00EC, 0x008E, 0x012B, 0x01EA, 0x0119, 0x04B0, 0x04B1, 0x03B8,
-    0x0691, 0x0365, 0x01ED, 0x049A, 0x0EA9, 0x0EA8, 0x08BD, 0x24CC,
-    0x0026, 0x0035, 0x00DB, 0x02C4, 0x07B2, 0x0038, 0x002B, 0x007F,
-    0x01B3, 0x00F4, 0x0091, 0x0116, 0x03BB, 0x0215, 0x0932, 0x002D,
-    0x002A, 0x008A, 0x01DE, 0x0028, 0x0020, 0x005C, 0x0090, 0x0068,
-    0x01EE, 0x00E9, 0x008D, 0x012A, 0x0087, 0x005D, 0x0118, 0x0349,
-    0x01EF, 0x01E3, 0x08B9, 0x00F0, 0x00D3, 0x0214, 0x049B, 0x00DA,
-    0x0089, 0x0125, 0x0217, 0x012D, 0x0690, 0x0094, 0x007D, 0x011F,
-    0x007E, 0x0059, 0x0127, 0x01A5, 0x0111, 0x00F8, 0x045D, 0x03B9,
-    0x0259, 0x0580, 0x02C1, 0x01DF, 0x0585, 0x0216, 0x0163, 0x01B0,
-    0x03C4, 0x08B8, 0x078B, 0x0755, 0x0581, 0x0F67, 0x0000,
-};
-
-static const uint8_t vec4_huffbits[HUFF_VEC4_SIZE] = {
-     5,  6,  8, 10, 12, 13,  6,  6,
-     8, 10, 11,  9,  8,  9, 10, 11,
-    10, 11, 12, 12, 14,  6,  6,  8,
-    10, 11,  6,  6,  8,  9,  8,  8,
-     8, 10,  9, 12,  9,  8, 10, 11,
-     8,  8,  9,  9,  9, 11, 11, 10,
-    11, 10,  9, 11, 12, 12, 12, 14,
-     6,  6,  8, 10, 11,  6,  6,  7,
-     9,  8,  8,  9, 10, 10, 12,  6,
-     6,  8,  9,  6,  6,  7,  8,  7,
-     9,  8,  8,  9,  8,  7,  9, 10,
-     9,  9, 12,  8,  8, 10, 11,  8,
-     8,  9, 10,  9, 11,  8,  7,  9,
-     7,  7,  9,  9,  9,  8, 11, 10,
-    10, 11, 10,  9, 11, 10,  9,  9,
-    10, 12, 11, 11, 11, 12,  1,
+static const uint8_t vec4_table[HUFF_VEC4_SIZE][2] = {
+    { 126,  1 }, {  76,  6 }, {  28,  8 }, {  93, 10 }, {  69, 10 },
+    { 117, 10 }, {  98, 10 }, {  31,  8 }, {  84,  8 }, {  38, 10 },
+    {   9, 10 }, { 108,  9 }, {  96,  8 }, {  73,  8 }, {  67,  9 },
+    { 121, 12 }, {  90, 12 }, { 110, 11 }, {  35, 12 }, {  54, 12 },
+    {  17, 11 }, {  86,  9 }, {  44,  9 }, {  82,  8 }, {  41,  8 },
+    {  36,  9 }, { 103,  9 }, {  78,  8 }, {  66,  8 }, {  11,  9 },
+    {  97,  9 }, {   4, 12 }, {  19, 12 }, {  70, 12 }, {  55, 14 },
+    {  20, 14 }, {   5, 13 }, {  51, 11 }, {  94, 11 }, { 106,  9 },
+    { 101,  8 }, {  83,  9 }, {  42,  9 }, {  45, 11 }, {  46, 11 },
+    { 112, 10 }, {  99,  9 }, {   8,  8 }, {  56,  6 }, {   1,  6 },
+    {  75,  6 }, {  27,  6 }, {  72,  6 }, {  62,  6 }, { 113, 11 },
+    { 124, 11 }, { 114, 10 }, {  15, 11 }, { 116, 11 }, {  24, 10 },
+    {  59, 10 }, {  39, 11 }, {  10, 11 }, { 118,  9 }, { 105,  7 },
+    {  71,  6 }, {  77,  7 }, {  85,  7 }, {  21,  6 }, {   7,  6 },
+    {   6,  6 }, {   0,  5 }, {  79,  7 }, { 100, 11 }, {  48, 11 },
+    {  87, 10 }, { 107,  9 }, {  92,  8 }, {  57,  6 }, { 119,  9 },
+    {  29,  9 }, {  16, 10 }, {  49, 10 }, {  64,  9 }, {  95,  8 },
+    {  58,  8 }, {  26,  6 }, {  61,  6 }, {  22,  6 }, {  23,  8 },
+    {  81,  8 }, {  13,  9 }, {  53, 12 }, {  52, 12 }, { 123, 11 },
+    {  33, 10 }, {  12,  8 }, {  40,  8 }, {  30,  8 }, {  47, 10 },
+    { 111, 10 }, {   3, 10 }, {  68, 10 }, {  74,  9 }, { 115,  9 },
+    {  91,  8 }, { 120, 10 }, {  25, 11 }, { 122, 11 }, {  89,  9 },
+    {   2,  8 }, {  37,  8 }, {  65,  8 }, {  43,  9 }, {  34,  9 },
+    {  14, 10 }, {  60, 11 }, {  18, 12 }, { 125, 12 }, {  50,  9 },
+    {  80,  9 }, {  88,  9 }, { 109,  8 }, {  32,  8 }, { 102,  7 },
+    { 104,  7 }, {  63,  7 },
 };
 
 
 #define HUFF_VEC2_SIZE    137
 #define HUFF_VEC2_MAXBITS  12
-static const uint16_t vec2_huffcodes[HUFF_VEC2_SIZE] = {
-    0x055, 0x01C, 0x01A, 0x02B, 0x028, 0x067, 0x08B, 0x039,
-    0x170, 0x10D, 0x2A5, 0x047, 0x464, 0x697, 0x523, 0x8CB,
-    0x01B, 0x00E, 0x000, 0x010, 0x012, 0x036, 0x048, 0x04C,
-    0x0C2, 0x09B, 0x171, 0x03B, 0x224, 0x34A, 0x2D6, 0x019,
-    0x00F, 0x002, 0x014, 0x017, 0x006, 0x05D, 0x054, 0x0C7,
-    0x0B4, 0x192, 0x10E, 0x233, 0x043, 0x02C, 0x00F, 0x013,
-    0x006, 0x02F, 0x02C, 0x068, 0x077, 0x0DF, 0x111, 0x1A4,
-    0x16A, 0x2A4, 0x027, 0x011, 0x018, 0x02D, 0x00F, 0x04A,
-    0x040, 0x097, 0x01F, 0x11B, 0x022, 0x16D, 0x066, 0x035,
-    0x005, 0x02B, 0x049, 0x009, 0x075, 0x0CB, 0x0AA, 0x187,
-    0x106, 0x08A, 0x047, 0x060, 0x06E, 0x01D, 0x074, 0x0C4,
-    0x01E, 0x118, 0x1A7, 0x038, 0x042, 0x053, 0x076, 0x0A8,
-    0x0CA, 0x082, 0x110, 0x18D, 0x12D, 0x0B9, 0x0C8, 0x0DE,
-    0x01C, 0x0AB, 0x113, 0x18C, 0x10F, 0x09A, 0x0A5, 0x0B7,
-    0x11A, 0x186, 0x1A6, 0x259, 0x153, 0x18A, 0x193, 0x020,
-    0x10C, 0x046, 0x03A, 0x107, 0x149, 0x16C, 0x2D7, 0x225,
-    0x258, 0x316, 0x696, 0x317, 0x042, 0x522, 0x290, 0x8CA,
-    0x001,
-};
-
-static const uint8_t vec2_huffbits[HUFF_VEC2_SIZE] = {
-     7,  6,  6,  6,  7,  7,  8,  9,
-     9, 10, 10, 11, 11, 11, 12, 12,
-     6,  4,  5,  5,  6,  6,  7,  8,
-     8,  9,  9, 10, 10, 10, 11,  6,
-     4,  5,  5,  6,  7,  7,  8,  8,
-     9,  9, 10, 10, 11,  6,  5,  5,
-     6,  6,  7,  7,  8,  8,  9,  9,
-    10, 10,  7,  6,  6,  6,  7,  7,
-     8,  8,  9,  9, 10, 10,  7,  6,
-     7,  7,  7,  8,  8,  8,  9,  9,
-    10,  8,  7,  7,  7,  8,  8,  8,
-     9,  9,  9,  9,  8,  8,  8,  8,
-     8,  9,  9,  9,  9,  8,  8,  8,
-     9,  9,  9,  9, 10,  9,  9,  9,
-     9,  9,  9, 10,  9,  9,  9, 10,
-    10, 11, 10, 10, 10, 10, 11, 10,
-    10, 10, 11, 10, 11, 12, 11, 12,
-     3,
+static const uint8_t vec2_table[HUFF_VEC2_SIZE][2] = {
+    {  18,  5 }, { 119, 10 }, { 132, 11 }, {  44, 11 }, {  68, 10 },
+    { 121, 11 }, {  11, 11 }, {  75,  8 }, {  72,  7 }, {  36,  7 },
+    { 104,  9 }, { 122, 10 }, {  27, 10 }, {  88,  9 }, {  66,  9 },
+    {  33,  5 }, {  48,  6 }, {  91,  9 }, {   7,  9 }, {  85,  8 },
+    {  62,  7 }, { 136,  3 }, {  64,  8 }, {  97,  9 }, {  80, 10 },
+    { 123, 10 }, {  92,  8 }, { 120, 10 }, {   9, 10 }, {  42, 10 },
+    { 108, 10 }, {  59,  6 }, {  20,  6 }, {  23,  8 }, { 109,  9 },
+    {  25,  9 }, {  58,  7 }, {   4,  7 }, { 134, 11 }, { 133, 12 },
+    {  14, 12 }, { 124, 10 }, { 110,  9 }, {  93,  8 }, {  38,  8 },
+    {  78,  9 }, { 105,  9 }, {  73,  7 }, {  50,  7 }, {  40,  9 },
+    {  56, 10 }, {  30, 11 }, { 126, 11 }, { 125, 10 }, {  69, 10 },
+    { 111,  9 }, {  35,  6 }, {  60,  6 }, {  31,  6 }, {   2,  6 },
+    {  16,  6 }, {   1,  6 }, {  86,  8 }, {  76,  8 }, {  94,  8 },
+    {  52,  8 }, {  46,  5 }, {  19,  5 }, {  98,  9 }, {  54,  9 },
+    {  28, 10 }, { 127, 10 }, { 106,  9 }, {  81,  8 }, {   6,  8 },
+    {  89,  9 }, {  12, 11 }, { 135, 12 }, {  15, 12 }, {  43, 10 },
+    { 112,  9 }, {  67,  9 }, {  82,  7 }, {  22,  7 }, {  74,  7 },
+    {  63,  7 }, { 128, 10 }, { 115, 10 }, { 100,  9 }, {  65,  8 },
+    {  47,  5 }, {  34,  5 }, {  95,  8 }, {  57, 10 }, {  10, 10 },
+    { 116,  9 }, {   0,  7 }, {   3,  6 }, {  45,  6 }, {  61,  6 },
+    {   8,  9 }, {  26,  9 }, { 101,  8 }, {  37,  7 }, {  49,  6 },
+    {  83,  7 }, {  24,  8 }, { 113,  9 }, {  79,  9 }, {  87,  8 },
+    { 117,  9 }, { 129, 10 }, { 131, 10 }, { 107,  9 }, {  99,  9 },
+    {  39,  8 }, { 102,  8 }, {  41,  9 }, { 118,  9 }, {  96,  8 },
+    {  77,  8 }, {  70,  7 }, {   5,  7 }, {  51,  7 }, {  55,  9 },
+    {  29, 10 }, { 130, 11 }, {  13, 11 }, { 114,  9 }, {  90,  9 },
+    {  71,  6 }, {  21,  6 }, {  84,  7 }, { 103,  8 }, {  53,  8 },
+    {  17,  4 }, {  32,  4 },
 };
 
 
 #define HUFF_VEC1_SIZE    101
 #define HUFF_VEC1_MAXBITS  11
-static const uint16_t vec1_huffcodes[HUFF_VEC1_SIZE] = {
-    0x01A, 0x003, 0x017, 0x010, 0x00C, 0x009, 0x005, 0x000,
-    0x00D, 0x00A, 0x009, 0x00C, 0x00F, 0x002, 0x004, 0x007,
-    0x00B, 0x00F, 0x01C, 0x006, 0x010, 0x015, 0x01C, 0x022,
-    0x03B, 0x00E, 0x019, 0x023, 0x034, 0x036, 0x03A, 0x047,
-    0x008, 0x00A, 0x01E, 0x031, 0x037, 0x050, 0x053, 0x06B,
-    0x06F, 0x08C, 0x0E8, 0x0EA, 0x0EB, 0x016, 0x03E, 0x03F,
-    0x06C, 0x089, 0x08A, 0x0A3, 0x0A4, 0x0D4, 0x0DD, 0x0EC,
-    0x0EE, 0x11A, 0x1D2, 0x024, 0x025, 0x02E, 0x027, 0x0C2,
-    0x0C0, 0x0DA, 0x0DB, 0x111, 0x144, 0x116, 0x14A, 0x145,
-    0x1B8, 0x1AB, 0x1DA, 0x1DE, 0x1DB, 0x1DF, 0x236, 0x237,
-    0x3A6, 0x3A7, 0x04D, 0x04C, 0x05E, 0x05F, 0x183, 0x182,
-    0x186, 0x221, 0x187, 0x220, 0x22E, 0x22F, 0x296, 0x354,
-    0x297, 0x355, 0x372, 0x373, 0x016,
-};
-
-static const uint8_t vec1_huffbits[HUFF_VEC1_SIZE] = {
-     7,  6,  5,  5,  5,  5,  5,  5,
-     4,  4,  4,  4,  4,  5,  5,  5,
-     5,  5,  5,  6,  6,  6,  6,  6,
-     6,  7,  7,  7,  7,  7,  7,  7,
-     8,  8,  8,  8,  8,  8,  8,  8,
-     8,  8,  8,  8,  8,  9,  9,  9,
-     9,  9,  9,  9,  9,  9,  9,  9,
-     9,  9,  9, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 11,  5,
+static const uint8_t vec1_table[HUFF_VEC1_SIZE][2] = {
+    {   7,  5 }, {  32,  8 }, {  59, 10 }, {  60, 10 }, {  83, 11 },
+    {  82, 11 }, {  62, 10 }, {  33,  8 }, {  45,  9 }, {  61, 10 },
+    {  84, 11 }, {  85, 11 }, {   1,  6 }, {  13,  5 }, {  19,  6 },
+    {  25,  7 }, {  34,  8 }, {  46,  9 }, {  47,  9 }, {  14,  5 },
+    {   6,  5 }, {  64, 10 }, {  87, 11 }, {  86, 11 }, {  63, 10 },
+    {  88, 11 }, {  90, 11 }, {  35,  8 }, {  26,  7 }, {   0,  7 },
+    {  48,  9 }, {  65, 10 }, {  66, 10 }, {  36,  8 }, {  15,  5 },
+    {  20,  6 }, {  91, 11 }, {  89, 11 }, {  67, 10 }, {  49,  9 },
+    {  50,  9 }, {  69, 10 }, {  92, 11 }, {  93, 11 }, {  27,  7 },
+    {   5,  5 }, {  37,  8 }, {  68, 10 }, {  71, 10 }, {  51,  9 },
+    {  52,  9 }, {  70, 10 }, {  94, 11 }, {  96, 11 }, {  38,  8 },
+    {  21,  6 }, {  16,  5 }, {   4,  5 }, {  28,  7 }, {  53,  9 },
+    {  95, 11 }, {  97, 11 }, {  73, 10 }, {  39,  8 }, {  29,  7 },
+    {  72, 10 }, {  98, 11 }, {  99, 11 }, {  54,  9 }, {  40,  8 },
+    {  22,  6 }, {  30,  7 }, {  55,  9 }, {  74, 10 }, {  76, 10 },
+    {  56,  9 }, {  75, 10 }, {  77, 10 }, {  17,  5 }, {   3,  5 },
+    {  23,  6 }, {  41,  8 }, {  57,  9 }, {  78, 10 }, {  79, 10 },
+    {  31,  7 }, {  10,  4 }, {   9,  4 }, { 100,  5 }, {   2,  5 },
+    {  11,  4 }, {   8,  4 }, {  18,  5 }, {  42,  8 }, {  58,  9 },
+    {  80, 10 }, {  81, 10 }, {  43,  8 }, {  44,  8 }, {  24,  6 },
+    {  12,  4 },
 };
 
 
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 7cfd0c04be..1909ce2dad 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -318,27 +318,27 @@  static av_cold int get_rate(AVCodecContext *avctx)
 
 static av_cold void decode_init_static(void)
 {
-    INIT_VLC_STATIC(&sf_vlc, SCALEVLCBITS, HUFF_SCALE_SIZE,
-                    scale_huffbits, 1, 1,
-                    scale_huffcodes, 2, 2, 616);
-    INIT_VLC_STATIC(&sf_rl_vlc, VLCBITS, HUFF_SCALE_RL_SIZE,
-                    scale_rl_huffbits, 1, 1,
-                    scale_rl_huffcodes, 4, 4, 1406);
-    INIT_VLC_STATIC(&coef_vlc[0], VLCBITS, HUFF_COEF0_SIZE,
-                    coef0_huffbits, 1, 1,
-                    coef0_huffcodes, 4, 4, 2108);
-    INIT_VLC_STATIC(&coef_vlc[1], VLCBITS, HUFF_COEF1_SIZE,
-                    coef1_huffbits, 1, 1,
-                    coef1_huffcodes, 4, 4, 3912);
-    INIT_VLC_STATIC(&vec4_vlc, VLCBITS, HUFF_VEC4_SIZE,
-                    vec4_huffbits, 1, 1,
-                    vec4_huffcodes, 2, 2, 604);
-    INIT_VLC_STATIC(&vec2_vlc, VLCBITS, HUFF_VEC2_SIZE,
-                    vec2_huffbits, 1, 1,
-                    vec2_huffcodes, 2, 2, 562);
-    INIT_VLC_STATIC(&vec1_vlc, VLCBITS, HUFF_VEC1_SIZE,
-                    vec1_huffbits, 1, 1,
-                    vec1_huffcodes, 2, 2, 562);
+    INIT_VLC_STATIC_FROM_LENGTHS(&sf_vlc, SCALEVLCBITS, HUFF_SCALE_SIZE,
+                                 &scale_table[0][1], 2,
+                                 &scale_table[0][0], 2, 1, 0, 0, 616);
+    INIT_VLC_STATIC_FROM_LENGTHS(&sf_rl_vlc, VLCBITS, HUFF_SCALE_RL_SIZE,
+                                 &scale_rl_table[0][1], 2,
+                                 &scale_rl_table[0][0], 2, 1, 0, 0, 1406);
+    INIT_VLC_STATIC_FROM_LENGTHS(&coef_vlc[0], VLCBITS, HUFF_COEF0_SIZE,
+                                 coef0_lens, 1,
+                                 coef0_syms, 2, 2, 0, 0, 2108);
+    INIT_VLC_STATIC_FROM_LENGTHS(&coef_vlc[1], VLCBITS, HUFF_COEF1_SIZE,
+                                 &coef1_table[0][1], 2,
+                                 &coef1_table[0][0], 2, 1, 0, 0, 3912);
+    INIT_VLC_STATIC_FROM_LENGTHS(&vec4_vlc, VLCBITS, HUFF_VEC4_SIZE,
+                                 &vec4_table[0][1], 2,
+                                 &vec4_table[0][0], 2, 1, 0, 0, 604);
+    INIT_VLC_STATIC_FROM_LENGTHS(&vec2_vlc, VLCBITS, HUFF_VEC2_SIZE,
+                                 &vec2_table[0][1], 2,
+                                 &vec2_table[0][0], 2, 1, 0, 0, 562);
+    INIT_VLC_STATIC_FROM_LENGTHS(&vec1_vlc, VLCBITS, HUFF_VEC1_SIZE,
+                                 &vec1_table[0][1], 2,
+                                 &vec1_table[0][0], 2, 1, 0, 0, 562);
 
     /** calculate sine values for the decorrelation matrix */
     for (int i = 0; i < 33; i++)