Changeset 296 for libmpc/trunk/libmpcdec/huffman.c
- Timestamp:
- 04/24/07 15:07:19 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libmpc/trunk/libmpcdec/huffman.c
r290 r296 120 120 121 121 // sv8 huffman tables 122 static const mpc_huffman mpc_table_HuffSCFI_1 [4] = { 123 {0x8000, 1, 2}, {0x4000, 2, 3}, {0x2000, 3, 1}, {0x0000, 3, 0} 124 }; 125 mpc_lut_data mpc_HuffSCFI_1 = {mpc_table_HuffSCFI_1}; 126 127 static const mpc_huffman mpc_table_HuffSCFI_2 [16] = { 128 {0xc000, 2, 15}, {0x8000, 2, 10}, {0x6000, 3, 14}, {0x4000, 3, 11}, {0x3800, 5, 13}, {0x3000, 5, 9}, {0x2800, 5, 7}, {0x2000, 5, 6}, {0x1800, 5, 5}, {0x1400, 6, 12}, {0x1000, 6, 8}, {0x0c00, 6, 3}, {0x0800, 6, 2}, {0x0400, 6, 0}, {0x0200, 7, 4}, {0x0000, 7, 1} 129 }; 130 mpc_lut_data mpc_HuffSCFI_2 = {mpc_table_HuffSCFI_2}; 131 132 static const mpc_huffman mpc_table_HuffDSCF_1 [64] = { 133 {0xe000, 3, 35}, {0xc000, 3, 34}, {0xa000, 3, 33}, {0x9000, 4, 36}, {0x8000, 4, 32}, {0x7000, 4, 30}, {0x6000, 4, 29}, {0x5000, 4, 27}, {0x4000, 4, 26}, {0x3800, 5, 37}, {0x3000, 5, 28}, {0x2800, 5, 25}, {0x2400, 6, 39}, {0x2000, 6, 38}, {0x1c00, 6, 24}, {0x1800, 6, 23}, {0x1600, 7, 40}, {0x1400, 7, 22}, {0x1200, 7, 21}, {0x1000, 7, 20}, {0x0e00, 7, 19}, {0x0d00, 8, 43}, {0x0c00, 8, 42}, {0x0b00, 8, 41}, {0x0a00, 8, 18}, {0x0900, 8, 17}, {0x0800, 8, 16}, {0x0700, 8, 15}, {0x0680, 9, 46}, {0x0600, 9, 45}, {0x0580, 9, 44}, {0x0500, 9, 14}, {0x0480, 9, 13}, {0x0400, 9, 12}, {0x0380, 9, 11}, {0x0340, 10, 49}, {0x0300, 10, 48}, {0x02c0, 10, 47}, {0x0280, 10, 31}, {0x0240, 10, 10}, {0x0200, 10, 9}, {0x01c0, 10, 8}, {0x0180, 10, 7}, {0x0140, 10, 6}, {0x0120, 11, 52}, {0x0100, 11, 51}, {0x00e0, 11, 50}, {0x00c0, 11, 5}, {0x00a0, 11, 4}, {0x0080, 11, 3}, {0x0070, 12, 54}, {0x0060, 12, 53}, {0x0050, 12, 2}, {0x0040, 12, 1}, {0x0030, 12, 0}, {0x0028, 13, 57}, {0x0020, 13, 56}, {0x0018, 13, 55}, {0x0014, 14, 63}, {0x0010, 14, 62}, {0x000c, 14, 61}, {0x0008, 14, 60}, {0x0004, 14, 59}, {0x0000, 14, 58} 134 }; 135 mpc_lut_data mpc_HuffDSCF_1 = {mpc_table_HuffDSCF_1}; 136 137 static const mpc_huffman mpc_table_HuffDSCF_2 [65] = { 138 {0xe000, 3, 33}, {0xc000, 3, 32}, {0xa000, 3, 31}, {0x8000, 3, 30}, {0x6000, 3, 29}, {0x5000, 4, 34}, {0x4000, 4, 28}, {0x3000, 4, 27}, {0x2800, 5, 36}, {0x2000, 5, 35}, {0x1800, 5, 26}, {0x1400, 6, 37}, {0x1000, 6, 25}, {0x0e00, 7, 38}, {0x0c00, 7, 24}, {0x0a00, 7, 23}, {0x0900, 8, 40}, {0x0800, 8, 39}, {0x0700, 8, 22}, {0x0600, 8, 21}, {0x0580, 9, 42}, {0x0500, 9, 41}, {0x0480, 9, 20}, {0x0400, 9, 19}, {0x0380, 9, 18}, {0x0340, 10, 45}, {0x0300, 10, 44}, {0x02c0, 10, 43}, {0x0280, 10, 17}, {0x0240, 10, 16}, {0x0200, 10, 15}, {0x01c0, 10, 14}, {0x01a0, 11, 48}, {0x0180, 11, 47}, {0x0160, 11, 46}, {0x0140, 11, 13}, {0x0120, 11, 12}, {0x0100, 11, 11}, {0x00e0, 11, 10}, {0x00d0, 12, 64}, {0x00c0, 12, 52}, {0x00b0, 12, 51}, {0x00a0, 12, 50}, {0x0090, 12, 49}, {0x0080, 12, 9}, {0x0070, 12, 8}, {0x0060, 12, 7}, {0x0050, 12, 6}, {0x0048, 13, 55}, {0x0040, 13, 54}, {0x0038, 13, 53}, {0x0030, 13, 5}, {0x0028, 13, 4}, {0x0020, 13, 3}, {0x001c, 14, 58}, {0x0018, 14, 57}, {0x0014, 14, 56}, {0x0010, 14, 2}, {0x000c, 14, 1}, {0x000a, 15, 63}, {0x0008, 15, 62}, {0x0006, 15, 61}, {0x0004, 15, 60}, {0x0002, 15, 59}, {0x0000, 15, 0} 139 }; 140 mpc_lut_data mpc_HuffDSCF_2 = {mpc_table_HuffDSCF_2}; 141 142 const mpc_huffman mpc_table_HuffBands [33] = { 143 {0x8000, 1, 0}, {0x4000, 2, 32}, {0x2000, 3, 1}, {0x1800, 5, 31}, {0x1000, 5, 2}, {0x0c00, 6, 30}, {0x0800, 6, 3}, {0x0600, 7, 4}, {0x0500, 8, 29}, {0x0400, 8, 6}, {0x0300, 8, 5}, {0x0280, 9, 28}, {0x0200, 9, 7}, {0x01c0, 10, 27}, {0x0180, 10, 26}, {0x0140, 10, 8}, {0x0120, 11, 25}, {0x0100, 11, 24}, {0x00e0, 11, 23}, {0x00c0, 11, 9}, {0x00b0, 12, 22}, {0x00a0, 12, 21}, {0x0090, 12, 20}, {0x0080, 12, 18}, {0x0070, 12, 17}, {0x0060, 12, 16}, {0x0050, 12, 15}, {0x0040, 12, 14}, {0x0030, 12, 12}, {0x0020, 12, 11}, {0x0010, 12, 10}, {0x0008, 13, 19}, {0x0000, 13, 13} 144 }; 145 146 static const mpc_huffman mpc_table_HuffRes [2] [17] = { 147 { 148 {0x8000, 1, 0}, {0x4000, 2, 1}, {0x2000, 3, 16}, {0x1000, 4, 2}, {0x0800, 5, 3}, {0x0400, 6, 4}, {0x0200, 7, 5}, {0x0100, 8, 15}, {0x0080, 9, 6}, {0x0040, 10, 7}, {0x0020, 11, 8}, {0x0010, 12, 9}, {0x0008, 13, 10}, {0x0004, 14, 11}, {0x0002, 15, 12}, {0x0001, 16, 14}, {0x0000, 16, 13} 149 }, { 150 {0xc000, 2, 16}, {0x8000, 2, 1}, {0x4000, 2, 0}, {0x2000, 3, 2}, {0x1000, 4, 15}, {0x0800, 5, 3}, {0x0400, 6, 14}, {0x0200, 7, 4}, {0x0100, 8, 5}, {0x0080, 9, 13}, {0x0040, 10, 6}, {0x0020, 11, 12}, {0x0010, 12, 7}, {0x000c, 14, 11}, {0x0008, 14, 10}, {0x0004, 14, 9}, {0x0000, 14, 8} 151 } 152 }; 153 mpc_lut_data mpc_HuffRes[2] = {{mpc_table_HuffRes[0]}, {mpc_table_HuffRes[1]}}; 154 155 static const mpc_huffman mpc_table_HuffQ1_8 [19] = { 156 {0xe000, 3, 7}, {0xc000, 3, 6}, {0xa000, 3, 5}, {0x8000, 3, 4}, {0x6000, 3, 3}, {0x5000, 4, 10}, {0x4000, 4, 9}, {0x3000, 4, 8}, {0x2000, 4, 2}, {0x1000, 4, 1}, {0x0800, 5, 11}, {0x0400, 6, 0}, {0x0200, 7, 12}, {0x0100, 8, 13}, {0x0080, 9, 14}, {0x0040, 10, 15}, {0x0020, 11, 16}, {0x0010, 12, 18}, {0x0000, 12, 17} 157 }; 158 159 static const mpc_huffman mpc_table_HuffQ2_8 [2] [5*5*5] = { 160 { 161 {0xe000, 3, 62}, {0xd000, 4, 87}, {0xc000, 4, 67}, {0xb000, 4, 63}, {0xa000, 4, 61}, {0x9000, 4, 57}, {0x8000, 4, 37}, {0x7c00, 6, 93}, {0x7800, 6, 92}, {0x7400, 6, 88}, {0x7000, 6, 86}, {0x6c00, 6, 83}, {0x6800, 6, 82}, {0x6400, 6, 81}, {0x6000, 6, 68}, {0x5c00, 6, 66}, {0x5800, 6, 58}, {0x5400, 6, 56}, {0x5000, 6, 42}, {0x4c00, 6, 41}, {0x4800, 6, 38}, {0x4400, 6, 36}, {0x4000, 6, 32}, {0x3c00, 6, 31}, {0x3a00, 7, 112}, {0x3800, 7, 91}, {0x3600, 7, 72}, {0x3400, 7, 64}, {0x3200, 7, 60}, {0x3000, 7, 52}, {0x2e00, 7, 43}, {0x2c00, 7, 33}, {0x2a00, 7, 12}, {0x2900, 8, 117}, {0x2800, 8, 113}, {0x2700, 8, 111}, {0x2600, 8, 107}, {0x2500, 8, 97}, {0x2400, 8, 89}, {0x2300, 8, 85}, {0x2200, 8, 77}, {0x2100, 8, 73}, {0x2000, 8, 71}, {0x1f00, 8, 69}, {0x1e00, 8, 65}, {0x1d00, 8, 59}, {0x1c00, 8, 55}, {0x1b00, 8, 53}, {0x1a00, 8, 51}, {0x1900, 8, 47}, {0x1800, 8, 39}, {0x1700, 8, 35}, {0x1600, 8, 27}, {0x1500, 8, 17}, {0x1400, 8, 13}, {0x1300, 8, 11}, {0x1200, 8, 7}, {0x1180, 9, 118}, {0x1100, 9, 116}, {0x1080, 9, 108}, {0x1000, 9, 106}, {0x0f80, 9, 98}, {0x0f00, 9, 96}, {0x0e80, 9, 94}, {0x0e00, 9, 90}, {0x0d80, 9, 84}, {0x0d00, 9, 80}, {0x0c80, 9, 78}, {0x0c00, 9, 76}, {0x0b80, 9, 48}, {0x0b00, 9, 46}, {0x0a80, 9, 44}, {0x0a00, 9, 40}, {0x0980, 9, 34}, {0x0900, 9, 30}, {0x0880, 9, 28}, {0x0800, 9, 26}, {0x0780, 9, 18}, {0x0700, 9, 16}, {0x0680, 9, 8}, {0x0600, 9, 6}, {0x05c0, 10, 122}, {0x0580, 10, 110}, {0x0540, 10, 102}, {0x0500, 10, 74}, {0x04c0, 10, 70}, {0x0480, 10, 54}, {0x0440, 10, 50}, {0x0400, 10, 22}, {0x03c0, 10, 2}, {0x03a0, 11, 123}, {0x0380, 11, 121}, {0x0360, 11, 119}, {0x0340, 11, 115}, {0x0320, 11, 114}, {0x0300, 11, 109}, {0x02e0, 11, 105}, {0x02c0, 11, 103}, {0x02a0, 11, 101}, {0x0280, 11, 99}, {0x0260, 11, 95}, {0x0240, 11, 79}, {0x0220, 11, 75}, {0x0200, 11, 49}, {0x01e0, 11, 45}, {0x01c0, 11, 29}, {0x01a0, 11, 25}, {0x0180, 11, 23}, {0x0160, 11, 21}, {0x0140, 11, 19}, {0x0120, 11, 15}, {0x0100, 11, 14}, {0x00e0, 11, 10}, {0x00c0, 11, 9}, {0x00a0, 11, 5}, {0x0080, 11, 3}, {0x0060, 11, 1}, {0x0050, 12, 124}, {0x0040, 12, 104}, {0x0030, 12, 20}, {0x0020, 12, 0}, {0x0018, 13, 120}, {0x0010, 13, 100}, {0x0008, 13, 24}, {0x0000, 13, 4} 162 }, { 163 {0xf000, 4, 62}, {0xe800, 5, 92}, {0xe000, 5, 87}, {0xd800, 5, 86}, {0xd000, 5, 82}, {0xc800, 5, 68}, {0xc000, 5, 67}, {0xb800, 5, 66}, {0xb000, 5, 63}, {0xa800, 5, 61}, {0xa000, 5, 58}, {0x9800, 5, 57}, {0x9000, 5, 56}, {0x8800, 5, 42}, {0x8000, 5, 38}, {0x7800, 5, 37}, {0x7000, 5, 32}, {0x6c00, 6, 93}, {0x6800, 6, 91}, {0x6400, 6, 88}, {0x6000, 6, 83}, {0x5c00, 6, 81}, {0x5800, 6, 43}, {0x5400, 6, 41}, {0x5000, 6, 36}, {0x4c00, 6, 33}, {0x4800, 6, 31}, {0x4600, 7, 112}, {0x4400, 7, 72}, {0x4200, 7, 64}, {0x4000, 7, 60}, {0x3e00, 7, 52}, {0x3c00, 7, 12}, {0x3b00, 8, 118}, {0x3a00, 8, 117}, {0x3900, 8, 116}, {0x3800, 8, 113}, {0x3700, 8, 111}, {0x3600, 8, 108}, {0x3500, 8, 107}, {0x3400, 8, 106}, {0x3300, 8, 98}, {0x3200, 8, 97}, {0x3100, 8, 96}, {0x3000, 8, 94}, {0x2f00, 8, 90}, {0x2e00, 8, 89}, {0x2d00, 8, 85}, {0x2c00, 8, 84}, {0x2b00, 8, 80}, {0x2a00, 8, 78}, {0x2900, 8, 77}, {0x2800, 8, 76}, {0x2700, 8, 73}, {0x2600, 8, 71}, {0x2500, 8, 69}, {0x2400, 8, 65}, {0x2300, 8, 59}, {0x2200, 8, 55}, {0x2100, 8, 53}, {0x2000, 8, 51}, {0x1f00, 8, 48}, {0x1e00, 8, 47}, {0x1d00, 8, 46}, {0x1c00, 8, 44}, {0x1b00, 8, 40}, {0x1a00, 8, 39}, {0x1900, 8, 35}, {0x1800, 8, 34}, {0x1700, 8, 30}, {0x1600, 8, 28}, {0x1500, 8, 27}, {0x1400, 8, 26}, {0x1300, 8, 18}, {0x1200, 8, 17}, {0x1100, 8, 16}, {0x1000, 8, 13}, {0x0f00, 8, 11}, {0x0e00, 8, 8}, {0x0d00, 8, 7}, {0x0c00, 8, 6}, {0x0b80, 9, 122}, {0x0b00, 9, 110}, {0x0a80, 9, 74}, {0x0a00, 9, 70}, {0x0980, 9, 54}, {0x0900, 9, 50}, {0x0880, 9, 22}, {0x0800, 9, 14}, {0x0780, 9, 2}, {0x0740, 10, 123}, {0x0700, 10, 121}, {0x06c0, 10, 119}, {0x0680, 10, 115}, {0x0640, 10, 114}, {0x0600, 10, 109}, {0x05c0, 10, 105}, {0x0580, 10, 103}, {0x0540, 10, 102}, {0x0500, 10, 101}, {0x04c0, 10, 99}, {0x0480, 10, 95}, {0x0440, 10, 79}, {0x0400, 10, 75}, {0x03c0, 10, 49}, {0x0380, 10, 45}, {0x0340, 10, 29}, {0x0300, 10, 25}, {0x02c0, 10, 23}, {0x0280, 10, 21}, {0x0240, 10, 19}, {0x0200, 10, 15}, {0x01c0, 10, 10}, {0x0180, 10, 9}, {0x0140, 10, 5}, {0x0100, 10, 3}, {0x00c0, 10, 1}, {0x00a0, 11, 124}, {0x0080, 11, 104}, {0x0060, 11, 20}, {0x0040, 11, 0}, {0x0030, 12, 120}, {0x0020, 12, 100}, {0x0010, 12, 24}, {0x0000, 12, 4} 164 } 165 }; 166 167 static const mpc_huffman mpc_table_HuffQ3_8 [49] = { 168 {0xe000, 3, 0}, {0xd000, 4, 17}, {0xc000, 4, 16}, {0xb000, 4, 1}, {0xa000, 4, 15}, {0x9000, 4, -16}, {0x8000, 4, -1}, {0x7800, 5, 32}, {0x7000, 5, 31}, {0x6800, 5, 2}, {0x6000, 5, 14}, {0x5800, 5, -15}, {0x5000, 5, -32}, {0x4c00, 6, 34}, {0x4800, 6, 33}, {0x4400, 6, 47}, {0x4000, 6, 46}, {0x3c00, 6, 18}, {0x3800, 6, 30}, {0x3400, 6, -14}, {0x3000, 6, -2}, {0x2c00, 6, -31}, {0x2800, 6, -17}, {0x2400, 6, -18}, {0x2200, 7, 49}, {0x2000, 7, 48}, {0x1e00, 7, 63}, {0x1c00, 7, 19}, {0x1a00, 7, 29}, {0x1800, 7, 3}, {0x1600, 7, 13}, {0x1400, 7, -13}, {0x1200, 7, -3}, {0x1000, 7, -30}, {0xe00, 7, -47}, {0xc00, 7, -48}, {0xa00, 7, -33}, {0x900, 8, 50}, {0x800, 8, 62}, {0x700, 8, 35}, {0x600, 8, 45}, {0x500, 8, -29}, {0x400, 8, -19}, {0x300, 8, -46}, {0x200, 8, -34}, {0x180, 9, 51}, {0x100, 9, 61}, {0x80, 9, -45}, {0x0, 9, -35} 169 }; 170 171 static const mpc_huffman mpc_table_HuffQ4_8 [91] = { 172 {0xf000, 4, 0}, {0xe800, 5, 32}, {0xe000, 5, 17}, {0xd800, 5, 16}, {0xd000, 5, 31}, {0xc800, 5, 2}, {0xc000, 5, 1}, {0xb800, 5, 15}, {0xb000, 5, 14}, {0xa800, 5, -15}, {0xa000, 5, -16}, {0x9800, 5, -1}, {0x9000, 5, -32}, {0x8c00, 6, 49}, {0x8800, 6, 48}, {0x8400, 6, 34}, {0x8000, 6, 33}, {0x7c00, 6, 47}, {0x7800, 6, 46}, {0x7400, 6, 19}, {0x7000, 6, 18}, {0x6c00, 6, 30}, {0x6800, 6, 29}, {0x6400, 6, 3}, {0x6000, 6, 13}, {0x5c00, 6, -13}, {0x5800, 6, -14}, {0x5400, 6, -2}, {0x5000, 6, -3}, {0x4c00, 6, -30}, {0x4800, 6, -31}, {0x4400, 6, -17}, {0x4000, 6, -18}, {0x3c00, 6, -47}, {0x3800, 6, -48}, {0x3400, 6, -33}, {0x3200, 7, 64}, {0x3000, 7, 50}, {0x2e00, 7, 63}, {0x2c00, 7, 62}, {0x2a00, 7, 35}, {0x2800, 7, 45}, {0x2600, 7, 4}, {0x2400, 7, 12}, {0x2200, 7, -29}, {0x2000, 7, -19}, {0x1e00, 7, -46}, {0x1c00, 7, -34}, {0x1a00, 7, -64}, {0x1800, 7, -49}, {0x1700, 8, 66}, {0x1600, 8, 65}, {0x1500, 8, 79}, {0x1400, 8, 78}, {0x1300, 8, 51}, {0x1200, 8, 61}, {0x1100, 8, 36}, {0x1000, 8, 44}, {0xf00, 8, 20}, {0xe00, 8, 28}, {0xd00, 8, -12}, {0xc00, 8, -4}, {0xb00, 8, -28}, {0xa00, 8, -20}, {0x900, 8, -45}, {0x800, 8, -35}, {0x700, 8, -62}, {0x600, 8, -63}, {0x500, 8, -50}, {0x480, 9, 67}, {0x400, 9, 77}, {0x380, 9, 52}, {0x300, 9, 60}, {0x280, 9, -44}, {0x200, 9, -36}, {0x180, 9, -61}, {0x100, 9, -51}, {0xc0, 10, 68}, {0x80, 10, 76}, {0x40, 10, -60}, {0x0, 10, -52}, {0x0, 0, 0}, {0x0, 0, 0}, {0x0, 0, 0}, {0x0, 0, 0}, {0x0, 0, 0}, {0x0, 0, 0}, {0x0, 0, 0}, {0x0, 0, 0}, {0x0, 0, 0}, {0x0, 0, 0} 173 }; 174 175 static const mpc_huffman mpc_table_HuffQ5_8 [2] [15] = { 176 { 177 {0xc000, 2, 0}, {0xa000, 3, 2}, {0x8000, 3, 1}, {0x6000, 3, -1}, {0x4000, 3, -2}, {0x3000, 4, 3}, {0x2000, 4, -3}, {0x1800, 5, 4}, {0x1000, 5, -4}, {0x0c00, 6, 5}, {0x0800, 6, -5}, {0x0600, 7, 7}, {0x0400, 7, 6}, {0x0200, 7, -6}, {0x0000, 7, -7} 178 }, { 179 {0xe000, 3, 2}, {0xc000, 3, 1}, {0xa000, 3, 0}, {0x8000, 3, -1}, {0x6000, 3, -2}, {0x5000, 4, 4}, {0x4000, 4, 3}, {0x3000, 4, -3}, {0x2000, 4, -4}, {0x1800, 5, 5}, {0x1000, 5, -5}, {0x0c00, 6, 7}, {0x0800, 6, 6}, {0x0400, 6, -6}, {0x0000, 6, -7} 180 } 181 }; 182 183 static const mpc_huffman mpc_table_HuffQ6_8 [2] [31] = { 184 { 185 {0xc000, 2, 0}, {0xa000, 3, 1}, {0x8000, 3, -1}, {0x7000, 4, 3}, {0x6000, 4, 2}, {0x5000, 4, -2}, {0x4000, 4, -3}, {0x3800, 5, 4}, {0x3000, 5, -4}, {0x2800, 5, -5}, {0x2400, 6, 8}, {0x2000, 6, 7}, {0x1c00, 6, 6}, {0x1800, 6, 5}, {0x1400, 6, -6}, {0x1000, 6, -7}, {0x0c00, 6, -8}, {0x0a00, 7, 9}, {0x0800, 7, -9}, {0x0700, 8, 11}, {0x0600, 8, 10}, {0x0500, 8, -10}, {0x0400, 8, -11}, {0x0380, 9, 15}, {0x0300, 9, 14}, {0x0280, 9, 13}, {0x0200, 9, 12}, {0x0180, 9, -12}, {0x0100, 9, -13}, {0x0080, 9, -14}, {0x0000, 9, -15} 186 }, { 187 {0xf000, 4, 5}, {0xe000, 4, 4}, {0xd000, 4, 3}, {0xc000, 4, 2}, {0xb000, 4, 1}, {0xa000, 4, 0}, {0x9000, 4, -1}, {0x8000, 4, -2}, {0x7000, 4, -3}, {0x6000, 4, -4}, {0x5000, 4, -5}, {0x4800, 5, 8}, {0x4000, 5, 7}, {0x3800, 5, 6}, {0x3000, 5, -6}, {0x2800, 5, -7}, {0x2000, 5, -8}, {0x1c00, 6, 10}, {0x1800, 6, 9}, {0x1400, 6, -9}, {0x1000, 6, -10}, {0x0e00, 7, 13}, {0x0c00, 7, 12}, {0x0a00, 7, 11}, {0x0800, 7, -11}, {0x0600, 7, -12}, {0x0400, 7, -13}, {0x0300, 8, 15}, {0x0200, 8, 14}, {0x0100, 8, -14}, {0x0000, 8, -15} 188 } 189 }; 190 191 static const mpc_huffman mpc_table_HuffQ7_8 [2] [63] = { 192 { 193 {0xc000, 2, 0}, {0xa000, 3, 1}, {0x8000, 3, -1}, {0x7000, 4, 2}, {0x6000, 4, -2}, {0x5800, 5, 4}, {0x5000, 5, 3}, {0x4800, 5, -3}, {0x4000, 5, -4}, {0x3c00, 6, 7}, {0x3800, 6, 6}, {0x3400, 6, 5}, {0x3000, 6, -5}, {0x2c00, 6, -6}, {0x2800, 6, -7}, {0x2600, 7, 13}, {0x2400, 7, 11}, {0x2200, 7, 10}, {0x2000, 7, 9}, {0x1e00, 7, 8}, {0x1c00, 7, -8}, {0x1a00, 7, -9}, {0x1800, 7, -10}, {0x1600, 7, -11}, {0x1400, 7, -12}, {0x1300, 8, 17}, {0x1200, 8, 16}, {0x1100, 8, 15}, {0x1000, 8, 14}, {0x0f00, 8, 12}, {0x0e00, 8, -13}, {0x0d00, 8, -14}, {0x0c00, 8, -15}, {0x0b00, 8, -16}, {0x0a00, 8, -17}, {0x0980, 9, 28}, {0x0900, 9, 27}, {0x0880, 9, 21}, {0x0800, 9, 20}, {0x0780, 9, 19}, {0x0700, 9, 18}, {0x0680, 9, -18}, {0x0600, 9, -19}, {0x0580, 9, -20}, {0x0500, 9, -21}, {0x0480, 9, -27}, {0x0400, 9, -28}, {0x03c0, 10, 31}, {0x0380, 10, 30}, {0x0340, 10, 29}, {0x0300, 10, 26}, {0x02c0, 10, 25}, {0x0280, 10, 24}, {0x0240, 10, 23}, {0x0200, 10, 22}, {0x01c0, 10, -22}, {0x0180, 10, -23}, {0x0140, 10, -24}, {0x0100, 10, -25}, {0x00c0, 10, -26}, {0x0080, 10, -29}, {0x0040, 10, -30}, {0x0000, 10, -31} 194 }, { 195 {0xf800, 5, 10}, {0xf000, 5, 9}, {0xe800, 5, 8}, {0xe000, 5, 7}, {0xd800, 5, 6}, {0xd000, 5, 5}, {0xc800, 5, 4}, {0xc000, 5, 3}, {0xb800, 5, 2}, {0xb000, 5, 1}, {0xa800, 5, 0}, {0xa000, 5, -1}, {0x9800, 5, -2}, {0x9000, 5, -3}, {0x8800, 5, -4}, {0x8000, 5, -5}, {0x7800, 5, -6}, {0x7000, 5, -7}, {0x6800, 5, -8}, {0x6000, 5, -9}, {0x5c00, 6, 17}, {0x5800, 6, 16}, {0x5400, 6, 15}, {0x5000, 6, 14}, {0x4c00, 6, 13}, {0x4800, 6, 12}, {0x4400, 6, 11}, {0x4000, 6, -10}, {0x3c00, 6, -11}, {0x3800, 6, -12}, {0x3400, 6, -13}, {0x3000, 6, -14}, {0x2c00, 6, -15}, {0x2800, 6, -16}, {0x2400, 6, -17}, {0x2200, 7, 22}, {0x2000, 7, 21}, {0x1e00, 7, 20}, {0x1c00, 7, 19}, {0x1a00, 7, 18}, {0x1800, 7, -18}, {0x1600, 7, -19}, {0x1400, 7, -20}, {0x1200, 7, -21}, {0x1000, 7, -22}, {0x0f00, 8, 29}, {0x0e00, 8, 28}, {0x0d00, 8, 27}, {0x0c00, 8, 26}, {0x0b00, 8, 25}, {0x0a00, 8, 24}, {0x0900, 8, 23}, {0x0800, 8, -23}, {0x0700, 8, -24}, {0x0600, 8, -25}, {0x0500, 8, -26}, {0x0400, 8, -27}, {0x0300, 8, -28}, {0x0200, 8, -29}, {0x0180, 9, 31}, {0x0100, 9, 30}, {0x0080, 9, -30}, {0x0000, 9, -31} 196 } 197 }; 198 199 static const mpc_huffman mpc_table_HuffQ8_8 [2] [127] = { 200 { 201 {0xc000, 2, 0}, {0xa000, 3, 1}, {0x8000, 3, -1}, {0x7000, 4, -2}, {0x6800, 5, 3}, {0x6000, 5, 2}, {0x5800, 5, -3}, {0x5400, 6, 7}, {0x5000, 6, 6}, {0x4c00, 6, 5}, {0x4800, 6, 4}, {0x4400, 6, -4}, {0x4000, 6, -5}, {0x3c00, 6, -6}, {0x3800, 6, -7}, {0x3600, 7, 11}, {0x3400, 7, 10}, {0x3200, 7, 9}, {0x3000, 7, 8}, {0x2e00, 7, -8}, {0x2c00, 7, -9}, {0x2a00, 7, -10}, {0x2800, 7, -11}, {0x2700, 8, 19}, {0x2600, 8, 18}, {0x2500, 8, 17}, {0x2400, 8, 16}, {0x2300, 8, 15}, {0x2200, 8, 14}, {0x2100, 8, 13}, {0x2000, 8, 12}, {0x1f00, 8, -12}, {0x1e00, 8, -13}, {0x1d00, 8, -14}, {0x1c00, 8, -15}, {0x1b00, 8, -16}, {0x1a00, 8, -17}, {0x1900, 8, -19}, {0x1880, 9, 56}, {0x1800, 9, 55}, {0x1780, 9, 31}, {0x1700, 9, 28}, {0x1680, 9, 27}, {0x1600, 9, 26}, {0x1580, 9, 25}, {0x1500, 9, 24}, {0x1480, 9, 23}, {0x1400, 9, 22}, {0x1380, 9, 21}, {0x1300, 9, 20}, {0x1280, 9, -18}, {0x1200, 9, -20}, {0x1180, 9, -21}, {0x1100, 9, -22}, {0x1080, 9, -23}, {0x1000, 9, -24}, {0x0f80, 9, -25}, {0x0f00, 9, -26}, {0x0e80, 9, -27}, {0x0e00, 9, -33}, {0x0d80, 9, -54}, {0x0d00, 9, -56}, {0x0cc0, 10, 63}, {0x0c80, 10, 62}, {0x0c40, 10, 61}, {0x0c00, 10, 60}, {0x0bc0, 10, 59}, {0x0b80, 10, 58}, {0x0b40, 10, 57}, {0x0b00, 10, 54}, {0x0ac0, 10, 53}, {0x0a80, 10, 43}, {0x0a40, 10, 40}, {0x0a00, 10, 39}, {0x09c0, 10, 38}, {0x0980, 10, 37}, {0x0940, 10, 36}, {0x0900, 10, 35}, {0x08c0, 10, 34}, {0x0880, 10, 33}, {0x0840, 10, 32}, {0x0800, 10, 30}, {0x07c0, 10, 29}, {0x0780, 10, -28}, {0x0740, 10, -29}, {0x0700, 10, -30}, {0x06c0, 10, -31}, {0x0680, 10, -32}, {0x0640, 10, -34}, {0x0600, 10, -35}, {0x05c0, 10, -36}, {0x0580, 10, -37}, {0x0540, 10, -38}, {0x0500, 10, -39}, {0x04c0, 10, -40}, {0x0480, 10, -41}, {0x0440, 10, -43}, {0x0400, 10, -53}, {0x03c0, 10, -55}, {0x0380, 10, -57}, {0x0340, 10, -58}, {0x0300, 10, -59}, {0x02c0, 10, -60}, {0x0280, 10, -61}, {0x0260, 11, 49}, {0x0240, 11, 47}, {0x0220, 11, 46}, {0x0200, 11, 45}, {0x01e0, 11, 44}, {0x01c0, 11, 42}, {0x01a0, 11, 41}, {0x0180, 11, -42}, {0x0160, 11, -44}, {0x0140, 11, -45}, {0x0120, 11, -46}, {0x0100, 11, -47}, {0x00e0, 11, -48}, {0x00c0, 11, -49}, {0x00a0, 11, -50}, {0x0080, 11, -62}, {0x0060, 11, -63}, {0x0050, 12, 52}, {0x0040, 12, 51}, {0x0030, 12, 50}, {0x0020, 12, 48}, {0x0010, 12, -51}, {0x0000, 12, -52} 202 }, { 203 {0xfc00, 6, 13}, {0xf800, 6, 11}, {0xf400, 6, 10}, {0xf000, 6, 9}, {0xec00, 6, 8}, {0xe800, 6, 7}, {0xe400, 6, 6}, {0xe000, 6, 5}, {0xdc00, 6, 4}, {0xd800, 6, 3}, {0xd400, 6, 2}, {0xd000, 6, 1}, {0xcc00, 6, 0}, {0xc800, 6, -1}, {0xc400, 6, -2}, {0xc000, 6, -3}, {0xbc00, 6, -4}, {0xb800, 6, -5}, {0xb400, 6, -6}, {0xb000, 6, -7}, {0xac00, 6, -8}, {0xa800, 6, -9}, {0xa400, 6, -10}, {0xa000, 6, -11}, {0x9c00, 6, -12}, {0x9800, 6, -13}, {0x9600, 7, 39}, {0x9400, 7, 38}, {0x9200, 7, 37}, {0x9000, 7, 36}, {0x8e00, 7, 35}, {0x8c00, 7, 34}, {0x8a00, 7, 33}, {0x8800, 7, 32}, {0x8600, 7, 31}, {0x8400, 7, 30}, {0x8200, 7, 29}, {0x8000, 7, 28}, {0x7e00, 7, 27}, {0x7c00, 7, 26}, {0x7a00, 7, 25}, {0x7800, 7, 24}, {0x7600, 7, 23}, {0x7400, 7, 22}, {0x7200, 7, 21}, {0x7000, 7, 20}, {0x6e00, 7, 19}, {0x6c00, 7, 18}, {0x6a00, 7, 17}, {0x6800, 7, 16}, {0x6600, 7, 15}, {0x6400, 7, 14}, {0x6200, 7, 12}, {0x6000, 7, -14}, {0x5e00, 7, -15}, {0x5c00, 7, -16}, {0x5a00, 7, -17}, {0x5800, 7, -18}, {0x5600, 7, -19}, {0x5400, 7, -20}, {0x5200, 7, -21}, {0x5000, 7, -22}, {0x4e00, 7, -23}, {0x4c00, 7, -24}, {0x4a00, 7, -25}, {0x4800, 7, -26}, {0x4600, 7, -27}, {0x4400, 7, -28}, {0x4200, 7, -29}, {0x4000, 7, -30}, {0x3e00, 7, -31}, {0x3c00, 7, -32}, {0x3a00, 7, -33}, {0x3800, 7, -34}, {0x3600, 7, -35}, {0x3400, 7, -36}, {0x3200, 7, -37}, {0x3000, 7, -38}, {0x2e00, 7, -39}, {0x2c00, 7, -40}, {0x2a00, 7, -41}, {0x2900, 8, 59}, {0x2800, 8, 58}, {0x2700, 8, 57}, {0x2600, 8, 56}, {0x2500, 8, 55}, {0x2400, 8, 54}, {0x2300, 8, 53}, {0x2200, 8, 52}, {0x2100, 8, 51}, {0x2000, 8, 50}, {0x1f00, 8, 49}, {0x1e00, 8, 48}, {0x1d00, 8, 47}, {0x1c00, 8, 46}, {0x1b00, 8, 45}, {0x1a00, 8, 44}, {0x1900, 8, 43}, {0x1800, 8, 42}, {0x1700, 8, 41}, {0x1600, 8, 40}, {0x1500, 8, -42}, {0x1400, 8, -43}, {0x1300, 8, -44}, {0x1200, 8, -45}, {0x1100, 8, -46}, {0x1000, 8, -47}, {0x0f00, 8, -48}, {0x0e00, 8, -49}, {0x0d00, 8, -50}, {0x0c00, 8, -51}, {0x0b00, 8, -52}, {0x0a00, 8, -53}, {0x0900, 8, -54}, {0x0800, 8, -55}, {0x0700, 8, -56}, {0x0600, 8, -57}, {0x0500, 8, -58}, {0x0400, 8, -59}, {0x0380, 9, 63}, {0x0300, 9, 62}, {0x0280, 9, 61}, {0x0200, 9, 60}, {0x0180, 9, -60}, {0x0100, 9, -61}, {0x0080, 9, -62}, {0x0000, 9, -63} 204 } 205 }; 206 207 static const mpc_huffman mpc_table_HuffQ9up_8 [256] = { 208 {0xfc00, 6, -128}, {0xf800, 6, 127}, {0xf600, 7, -108}, {0xf400, 7, -110}, {0xf200, 7, -111}, {0xf000, 7, -112}, {0xee00, 7, -113}, {0xec00, 7, -114}, {0xea00, 7, -115}, {0xe800, 7, -116}, {0xe600, 7, -117}, {0xe400, 7, -118}, {0xe200, 7, -119}, {0xe000, 7, -120}, {0xde00, 7, -121}, {0xdc00, 7, -122}, {0xda00, 7, -123}, {0xd800, 7, -124}, {0xd600, 7, -125}, {0xd400, 7, -126}, {0xd200, 7, -127}, {0xd000, 7, 126}, {0xce00, 7, 125}, {0xcc00, 7, 124}, {0xca00, 7, 123}, {0xc800, 7, 122}, {0xc600, 7, 121}, {0xc400, 7, 120}, {0xc200, 7, 119}, {0xc000, 7, 118}, {0xbe00, 7, 117}, {0xbc00, 7, 116}, {0xba00, 7, 115}, {0xb800, 7, 114}, {0xb600, 7, 113}, {0xb400, 7, 112}, {0xb200, 7, 111}, {0xb000, 7, 110}, {0xae00, 7, 109}, {0xac00, 7, 108}, {0xab00, 8, -44}, {0xaa00, 8, -45}, {0xa900, 8, -46}, {0xa800, 8, -47}, {0xa700, 8, -48}, {0xa600, 8, -49}, {0xa500, 8, -50}, {0xa400, 8, -51}, {0xa300, 8, -52}, {0xa200, 8, -53}, {0xa100, 8, -54}, {0xa000, 8, -55}, {0x9f00, 8, -56}, {0x9e00, 8, -57}, {0x9d00, 8, -58}, {0x9c00, 8, -59}, {0x9b00, 8, -60}, {0x9a00, 8, -61}, {0x9900, 8, -62}, {0x9800, 8, -63}, {0x9700, 8, -64}, {0x9600, 8, -65}, {0x9500, 8, -66}, {0x9400, 8, -67}, {0x9300, 8, -68}, {0x9200, 8, -69}, {0x9100, 8, -70}, {0x9000, 8, -71}, {0x8f00, 8, -72}, {0x8e00, 8, -73}, {0x8d00, 8, -74}, {0x8c00, 8, -75}, {0x8b00, 8, -76}, {0x8a00, 8, -77}, {0x8900, 8, -78}, {0x8800, 8, -79}, {0x8700, 8, -80}, {0x8600, 8, -81}, {0x8500, 8, -82}, {0x8400, 8, -83}, {0x8300, 8, -84}, {0x8200, 8, -85}, {0x8100, 8, -86}, {0x8000, 8, -87}, {0x7f00, 8, -88}, {0x7e00, 8, -89}, {0x7d00, 8, -90}, {0x7c00, 8, -91}, {0x7b00, 8, -92}, {0x7a00, 8, -93}, {0x7900, 8, -94}, {0x7800, 8, -95}, {0x7700, 8, -96}, {0x7600, 8, -97}, {0x7500, 8, -98}, {0x7400, 8, -99}, {0x7300, 8, -100}, {0x7200, 8, -101}, {0x7100, 8, -102}, {0x7000, 8, -103}, {0x6f00, 8, -104}, {0x6e00, 8, -105}, {0x6d00, 8, -106}, {0x6c00, 8, -107}, {0x6b00, 8, -109}, {0x6a00, 8, 107}, {0x6900, 8, 106}, {0x6800, 8, 105}, {0x6700, 8, 104}, {0x6600, 8, 103}, {0x6500, 8, 102}, {0x6400, 8, 101}, {0x6300, 8, 100}, {0x6200, 8, 99}, {0x6100, 8, 98}, {0x6000, 8, 97}, {0x5f00, 8, 96}, {0x5e00, 8, 95}, {0x5d00, 8, 94}, {0x5c00, 8, 93}, {0x5b00, 8, 92}, {0x5a00, 8, 91}, {0x5900, 8, 90}, {0x5800, 8, 89}, {0x5700, 8, 88}, {0x5600, 8, 87}, {0x5500, 8, 86}, {0x5400, 8, 85}, {0x5300, 8, 84}, {0x5200, 8, 83}, {0x5100, 8, 82}, {0x5000, 8, 81}, {0x4f00, 8, 80}, {0x4e00, 8, 79}, {0x4d00, 8, 78}, {0x4c00, 8, 77}, {0x4b00, 8, 76}, {0x4a00, 8, 75}, {0x4900, 8, 74}, {0x4800, 8, 73}, {0x4700, 8, 72}, {0x4600, 8, 71}, {0x4500, 8, 70}, {0x4400, 8, 69}, {0x4300, 8, 68}, {0x4200, 8, 67}, {0x4100, 8, 66}, {0x4000, 8, 65}, {0x3f00, 8, 64}, {0x3e00, 8, 63}, {0x3d00, 8, 62}, {0x3c00, 8, 61}, {0x3b00, 8, 60}, {0x3a00, 8, 59}, {0x3900, 8, 58}, {0x3800, 8, 57}, {0x3700, 8, 56}, {0x3600, 8, 55}, {0x3500, 8, 54}, {0x3400, 8, 53}, {0x3300, 8, 52}, {0x3200, 8, 51}, {0x3100, 8, 50}, {0x3000, 8, 49}, {0x2f00, 8, 48}, {0x2e00, 8, 47}, {0x2d00, 8, 46}, {0x2c00, 8, 45}, {0x2b00, 8, 44}, {0x2a00, 8, 43}, {0x2900, 8, 42}, {0x2800, 8, 40}, {0x2700, 8, 20}, {0x2600, 8, 19}, {0x2580, 9, -7}, {0x2500, 9, -8}, {0x2480, 9, -9}, {0x2400, 9, -10}, {0x2380, 9, -11}, {0x2300, 9, -12}, {0x2280, 9, -13}, {0x2200, 9, -14}, {0x2180, 9, -15}, {0x2100, 9, -16}, {0x2080, 9, -17}, {0x2000, 9, -18}, {0x1f80, 9, -19}, {0x1f00, 9, -20}, {0x1e80, 9, -21}, {0x1e00, 9, -22}, {0x1d80, 9, -23}, {0x1d00, 9, -24}, {0x1c80, 9, -25}, {0x1c00, 9, -26}, {0x1b80, 9, -27}, {0x1b00, 9, -28}, {0x1a80, 9, -29}, {0x1a00, 9, -30}, {0x1980, 9, -31}, {0x1900, 9, -32}, {0x1880, 9, -33}, {0x1800, 9, -34}, {0x1780, 9, -35}, {0x1700, 9, -36}, {0x1680, 9, -37}, {0x1600, 9, -38}, {0x1580, 9, -39}, {0x1500, 9, -40}, {0x1480, 9, -41}, {0x1400, 9, -42}, {0x1380, 9, -43}, {0x1300, 9, 41}, {0x1280, 9, 39}, {0x1200, 9, 38}, {0x1180, 9, 37}, {0x1100, 9, 36}, {0x1080, 9, 35}, {0x1000, 9, 34}, {0xf80, 9, 33}, {0xf00, 9, 32}, {0xe80, 9, 31}, {0xe00, 9, 30}, {0xd80, 9, 29}, {0xd00, 9, 28}, {0xc80, 9, 27}, {0xc00, 9, 26}, {0xb80, 9, 25}, {0xb00, 9, 24}, {0xa80, 9, 23}, {0xa00, 9, 22}, {0x980, 9, 21}, {0x900, 9, 18}, {0x880, 9, 17}, {0x800, 9, 16}, {0x780, 9, 15}, {0x700, 9, 14}, {0x680, 9, 13}, {0x600, 9, 12}, {0x580, 9, 11}, {0x500, 9, 10}, {0x480, 9, 9}, {0x400, 9, 8}, {0x380, 9, 7}, {0x300, 9, 6}, {0x280, 9, 5}, {0x240, 10, -3}, {0x200, 10, -4}, {0x1c0, 10, -5}, {0x180, 10, -6}, {0x140, 10, 4}, {0x100, 10, 3}, {0xc0, 10, 2}, {0x80, 10, 1}, {0x40, 10, 0}, {0x20, 11, -1}, {0x0, 11, -2} 209 }; 210 mpc_lut_data mpc_HuffQ9up_8 = {mpc_table_HuffQ9up_8}; 211 212 213 // FIXME : some memory is vasted here 214 mpc_lut_data mpc_HuffQ_8 [8] [2] = { 215 {{mpc_table_HuffQ1_8}, {mpc_table_HuffQ1_8}}, 216 {{mpc_table_HuffQ2_8[0]}, {mpc_table_HuffQ2_8[1]}}, 217 {{mpc_table_HuffQ3_8}, {mpc_table_HuffQ3_8}}, 218 {{mpc_table_HuffQ4_8}, {mpc_table_HuffQ4_8}}, 219 {{mpc_table_HuffQ5_8[0]}, {mpc_table_HuffQ5_8[1]}}, 220 {{mpc_table_HuffQ6_8[0]}, {mpc_table_HuffQ6_8[1]}}, 221 {{mpc_table_HuffQ7_8[0]}, {mpc_table_HuffQ7_8[1]}}, 222 {{mpc_table_HuffQ8_8[0]}, {mpc_table_HuffQ8_8[1]}} 122 static const mpc_huffman mpc_huff_SCFI_1 [3] = { 123 {0x8000, 1, 1}, {0x4000, 2, 2}, {0x0, 3, 3} 124 }; // 3 125 static const mpc_int8_t mpc_sym_SCFI_1 [4] = { 126 2, 3, 1, 0 127 }; 128 static const mpc_huffman mpc_huff_SCFI_2 [5] = { 129 {0x8000, 2, 3}, {0x4000, 3, 5}, {0x1800, 5, 11}, {0x400, 6, 14}, {0x0, 7, 15} 130 }; // 5 131 static const mpc_int8_t mpc_sym_SCFI_2 [16] = { 132 15, 10, 14, 11, 13, 9, 7, 6, 5, 12, 8, 3, 2, 0, 4, 1 133 }; 134 mpc_can_data mpc_can_SCFI[2] = {{mpc_huff_SCFI_1, mpc_sym_SCFI_1}, {mpc_huff_SCFI_2, mpc_sym_SCFI_2}}; 135 136 static const mpc_huffman mpc_huff_DSCF_1 [12] = { 137 {0xa000, 3, 7}, {0x4000, 4, 12}, {0x2800, 5, 16}, {0x1800, 6, 21}, {0xe00, 7, 27}, {0x700, 8, 34}, {0x380, 9, 41}, {0x140, 10, 48}, {0x80, 11, 53}, {0x30, 12, 57}, {0x18, 13, 60}, {0x0, 14, 63} 138 }; // 12 139 static const mpc_int8_t mpc_sym_DSCF_1 [64] = { 140 35, 34, 33, 36, 32, 30, 29, 27, 26, 37, 28, 25, 39, 38, 24, 23, 40, 22, 21, 20, 19, 43, 42, 41, 18, 17, 16, 15, 46, 45, 44, 14, 13, 12, 11, 49, 48, 47, 31, 10, 9, 8, 7, 6, 52, 51, 50, 5, 4, 3, 54, 53, 2, 1, 0, 57, 56, 55, 63, 62, 61, 60, 59, 58 141 }; 142 static const mpc_huffman mpc_huff_DSCF_2 [13] = { 143 {0x6000, 3, 7}, {0x3000, 4, 10}, {0x1800, 5, 13}, {0x1000, 6, 16}, {0xa00, 7, 20}, {0x600, 8, 25}, {0x380, 9, 31}, {0x1c0, 10, 38}, {0xe0, 11, 45}, {0x50, 12, 52}, {0x20, 13, 57}, {0xc, 14, 61}, {0x0, 15, 64} 144 }; // 13 145 static const mpc_int8_t mpc_sym_DSCF_2 [65] = { 146 33, 32, 31, 30, 29, 34, 28, 27, 36, 35, 26, 37, 25, 38, 24, 23, 40, 39, 22, 21, 42, 41, 20, 19, 18, 45, 44, 43, 17, 16, 15, 14, 48, 47, 46, 13, 12, 11, 10, 64, 52, 51, 50, 49, 9, 8, 7, 6, 55, 54, 53, 5, 4, 3, 58, 57, 56, 2, 1, 63, 62, 61, 60, 59, 0 147 }; 148 mpc_can_data mpc_can_DSCF[2] = {{mpc_huff_DSCF_1, mpc_sym_DSCF_1}, {mpc_huff_DSCF_2, mpc_sym_DSCF_2}}; 149 150 static const mpc_huffman mpc_huff_Bands [12] = { 151 {0x8000, 1, 1}, {0x4000, 2, 2}, {0x2000, 3, 3}, {0x1000, 5, 6}, {0x800, 6, 8}, {0x600, 7, 10}, {0x300, 8, 13}, {0x200, 9, 16}, {0x140, 10, 20}, {0xc0, 11, 25}, {0x10, 12, 31}, {0x0, 13, 32} 152 }; // 12 153 static const mpc_int8_t mpc_sym_Bands [33] = { 154 0, 32, 1, 31, 2, 30, 3, 4, 29, 6, 5, 28, 7, 27, 26, 8, 25, 24, 23, 9, 22, 21, 20, 18, 17, 16, 15, 14, 12, 11, 10, 19, 13 155 }; 156 mpc_can_data mpc_can_Bands = {mpc_huff_Bands, mpc_sym_Bands}; 157 158 static const mpc_huffman mpc_huff_Res_1 [16] = { 159 {0x8000, 1, 1}, {0x4000, 2, 2}, {0x2000, 3, 3}, {0x1000, 4, 4}, {0x800, 5, 5}, {0x400, 6, 6}, {0x200, 7, 7}, {0x100, 8, 8}, {0x80, 9, 9}, {0x40, 10, 10}, {0x20, 11, 11}, {0x10, 12, 12}, {0x8, 13, 13}, {0x4, 14, 14}, {0x2, 15, 15}, {0x0, 16, 16} 160 }; // 16 161 static const mpc_int8_t mpc_sym_Res_1 [17] = { 162 0, 1, 16, 2, 3, 4, 5, 15, 6, 7, 8, 9, 10, 11, 12, 14, 13 163 }; 164 static const mpc_huffman mpc_huff_Res_2 [12] = { 165 {0x4000, 2, 3}, {0x2000, 3, 4}, {0x1000, 4, 5}, {0x800, 5, 6}, {0x400, 6, 7}, {0x200, 7, 8}, {0x100, 8, 9}, {0x80, 9, 10}, {0x40, 10, 11}, {0x20, 11, 12}, {0x10, 12, 13}, {0x0, 14, 16} 166 }; // 12 167 static const mpc_int8_t mpc_sym_Res_2 [17] = { 168 16, 1, 0, 2, 15, 3, 14, 4, 5, 13, 6, 12, 7, 11, 10, 9, 8 169 }; 170 mpc_can_data mpc_can_Res[2] = {{mpc_huff_Res_1, mpc_sym_Res_1}, {mpc_huff_Res_2, mpc_sym_Res_2}}; 171 172 static const mpc_huffman mpc_huff_Q1 [10] = { 173 {0x6000, 3, 7}, {0x1000, 4, 10}, {0x800, 5, 11}, {0x400, 6, 12}, {0x200, 7, 13}, {0x100, 8, 14}, {0x80, 9, 15}, {0x40, 10, 16}, {0x20, 11, 17}, {0x0, 12, 18} 174 }; // 10 175 static const mpc_int8_t mpc_sym_Q1 [19] = { 176 7, 6, 5, 4, 3, 10, 9, 8, 2, 1, 11, 0, 12, 13, 14, 15, 16, 18, 17 177 }; 178 mpc_can_data mpc_can_Q1 = {mpc_huff_Q1, mpc_sym_Q1}; 179 180 static const mpc_huffman mpc_huff_Q2_1 [10] = { 181 {0xe000, 3, 7}, {0x8000, 4, 14}, {0x3c00, 6, 38}, {0x2a00, 7, 53}, {0x1200, 8, 74}, {0x600, 9, 92}, {0x3c0, 10, 104}, {0x60, 11, 119}, {0x20, 12, 122}, {0x0, 13, 124} 182 }; // 10 183 static const mpc_int8_t mpc_sym_Q2_1 [125] = { 184 62, 87, 67, 63, 61, 57, 37, 93, 92, 88, 86, 83, 82, 81, 68, 66, 58, 56, 42, 41, 38, 36, 32, 31, 112, 91, 72, 64, 60, 52, 43, 33, 12, 117, 113, 111, 107, 97, 89, 85, 77, 73, 71, 69, 65, 59, 55, 53, 51, 47, 39, 35, 27, 17, 13, 11, 7, 118, 116, 108, 106, 98, 96, 94, 90, 84, 80, 78, 76, 48, 46, 44, 40, 34, 30, 28, 26, 18, 16, 8, 6, 122, 110, 102, 74, 70, 54, 50, 22, 2, 123, 121, 119, 115, 114, 109, 105, 103, 101, 99, 95, 79, 75, 49, 45, 29, 25, 23, 21, 19, 15, 14, 10, 9, 5, 3, 1, 124, 104, 20, 0, 120, 100, 24, 4 185 }; 186 static const mpc_huffman mpc_huff_Q2_2 [9] = { 187 {0xf000, 4, 15}, {0x7000, 5, 30}, {0x4800, 6, 44}, {0x3c00, 7, 62}, {0xc00, 8, 92}, {0x780, 9, 104}, {0xc0, 10, 119}, {0x40, 11, 122}, {0x0, 12, 124} 188 }; // 9 189 static const mpc_int8_t mpc_sym_Q2_2 [125] = { 190 62, 92, 87, 86, 82, 68, 67, 66, 63, 61, 58, 57, 56, 42, 38, 37, 32, 93, 91, 88, 83, 81, 43, 41, 36, 33, 31, 112, 72, 64, 60, 52, 12, 118, 117, 116, 113, 111, 108, 107, 106, 98, 97, 96, 94, 90, 89, 85, 84, 80, 78, 77, 76, 73, 71, 69, 65, 59, 55, 53, 51, 48, 47, 46, 44, 40, 39, 35, 34, 30, 28, 27, 26, 18, 17, 16, 13, 11, 8, 7, 6, 122, 110, 74, 70, 54, 50, 22, 14, 2, 123, 121, 119, 115, 114, 109, 105, 103, 102, 101, 99, 95, 79, 75, 49, 45, 29, 25, 23, 21, 19, 15, 10, 9, 5, 3, 1, 124, 104, 20, 0, 120, 100, 24, 4 191 }; 192 193 static const mpc_huffman mpc_huff_Q3 [7] = { 194 {0xe000, 3, 7}, {0x8000, 4, 14}, {0x5000, 5, 22}, {0x2400, 6, 32}, {0xa00, 7, 41}, {0x200, 8, 46}, {0x0, 9, 48} 195 }; // 7 196 static const mpc_int8_t mpc_sym_Q3 [49] = { 197 0, 17, 16, 1, 15, -16, -1, 32, 31, 2, 14, -15, -32, 34, 33, 47, 46, 18, 30, -14, -2, -31, -17, -18, 49, 48, 63, 19, 29, 3, 13, -13, -3, -30, -47, -48, -33, 50, 62, 35, 45, -29, -19, -46, -34, 51, 61, -45, -35 198 }; 199 200 static const mpc_huffman mpc_huff_Q4 [8] = { 201 {0xf000, 4, 15}, {0x9000, 5, 30}, {0x3400, 6, 48}, {0x1800, 7, 61}, {0x500, 8, 73}, {0x100, 9, 78}, {0x0, 10, 80}, {0x0, 0, 90} 202 }; // 8 203 static const mpc_int8_t mpc_sym_Q4 [91] = { 204 0, 32, 17, 16, 31, 2, 1, 15, 14, -15, -16, -1, -32, 49, 48, 34, 33, 47, 46, 19, 18, 30, 29, 3, 13, -13, -14, -2, -3, -30, -31, -17, -18, -47, -48, -33, 64, 50, 63, 62, 35, 45, 4, 12, -29, -19, -46, -34, -64, -49, 66, 65, 79, 78, 51, 61, 36, 44, 20, 28, -12, -4, -28, -20, -45, -35, -62, -63, -50, 67, 77, 52, 60, -44, -36, -61, -51, 68, 76, -60, -52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 205 }; 206 207 static const mpc_huffman mpc_huff_Q5_1 [6] = { 208 {0xc000, 2, 3}, {0x4000, 3, 6}, {0x2000, 4, 8}, {0x1000, 5, 10}, {0x800, 6, 12}, {0x0, 7, 14} 209 }; // 6 210 static const mpc_int8_t mpc_sym_Q5_1 [15] = { 211 0, 2, 1, -1, -2, 3, -3, 4, -4, 5, -5, 7, 6, -6, -7 212 }; 213 static const mpc_huffman mpc_huff_Q5_2 [4] = { 214 {0x6000, 3, 7}, {0x2000, 4, 10}, {0x1000, 5, 12}, {0x0, 6, 14} 215 }; // 4 216 static const mpc_int8_t mpc_sym_Q5_2 [15] = { 217 2, 1, 0, -1, -2, 4, 3, -3, -4, 5, -5, 7, 6, -6, -7 218 }; 219 220 static const mpc_huffman mpc_huff_Q6_1 [8] = { 221 {0xc000, 2, 3}, {0x8000, 3, 6}, {0x4000, 4, 10}, {0x2800, 5, 14}, {0xc00, 6, 19}, {0x800, 7, 22}, {0x400, 8, 26}, {0x0, 9, 30} 222 }; // 8 223 static const mpc_int8_t mpc_sym_Q6_1 [31] = { 224 0, 1, -1, 3, 2, -2, -3, 4, -4, -5, 8, 7, 6, 5, -6, -7, -8, 9, -9, 11, 10, -10, -11, 15, 14, 13, 12, -12, -13, -14, -15 225 }; 226 static const mpc_huffman mpc_huff_Q6_2 [5] = { 227 {0x5000, 4, 15}, {0x2000, 5, 20}, {0x1000, 6, 24}, {0x400, 7, 28}, {0x0, 8, 30} 228 }; // 5 229 static const mpc_int8_t mpc_sym_Q6_2 [31] = { 230 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, 8, 7, 6, -6, -7, -8, 10, 9, -9, -10, 13, 12, 11, -11, -12, -13, 15, 14, -14, -15 231 }; 232 233 static const mpc_huffman mpc_huff_Q7_1 [9] = { 234 {0xc000, 2, 3}, {0x8000, 3, 6}, {0x6000, 4, 10}, {0x4000, 5, 16}, {0x2800, 6, 24}, {0x1400, 7, 34}, {0xa00, 8, 44}, {0x400, 9, 54}, {0x0, 10, 62} 235 }; // 9 236 static const mpc_int8_t mpc_sym_Q7_1 [63] = { 237 0, 1, -1, 2, -2, 4, 3, -3, -4, 7, 6, 5, -5, -6, -7, 13, 11, 10, 9, 8, -8, -9, -10, -11, -12, 17, 16, 15, 14, 12, -13, -14, -15, -16, -17, 28, 27, 21, 20, 19, 18, -18, -19, -20, -21, -27, -28, 31, 30, 29, 26, 25, 24, 23, 22, -22, -23, -24, -25, -26, -29, -30, -31 238 }; 239 static const mpc_huffman mpc_huff_Q7_2 [5] = { 240 {0x6000, 5, 31}, {0x2400, 6, 43}, {0x1000, 7, 52}, {0x200, 8, 60}, {0x0, 9, 62} 241 }; // 5 242 static const mpc_int8_t mpc_sym_Q7_2 [63] = { 243 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7, -8, -9, 17, 16, 15, 14, 13, 12, 11, -10, -11, -12, -13, -14, -15, -16, -17, 22, 21, 20, 19, 18, -18, -19, -20, -21, -22, 29, 28, 27, 26, 25, 24, 23, -23, -24, -25, -26, -27, -28, -29, 31, 30, -30, -31 244 }; 245 246 static const mpc_huffman mpc_huff_Q8_1 [11] = { 247 {0xc000, 2, 3}, {0x8000, 3, 6}, {0x7000, 4, 10}, {0x5800, 5, 17}, {0x3800, 6, 28}, {0x2800, 7, 42}, {0x1900, 8, 62}, {0xd00, 9, 87}, {0x280, 10, 113}, {0x60, 11, 123}, {0x0, 12, 126} 248 }; // 11 249 static const mpc_int8_t mpc_sym_Q8_1 [127] = { 250 0, 1, -1, -2, 3, 2, -3, 7, 6, 5, 4, -4, -5, -6, -7, 11, 10, 9, 8, -8, -9, -10, -11, 19, 18, 17, 16, 15, 14, 13, 12, -12, -13, -14, -15, -16, -17, -19, 56, 55, 31, 28, 27, 26, 25, 24, 23, 22, 21, 20, -18, -20, -21, -22, -23, -24, -25, -26, -27, -33, -54, -56, 63, 62, 61, 60, 59, 58, 57, 54, 53, 43, 40, 39, 38, 37, 36, 35, 34, 33, 32, 30, 29, -28, -29, -30, -31, -32, -34, -35, -36, -37, -38, -39, -40, -41, -43, -53, -55, -57, -58, -59, -60, -61, 49, 47, 46, 45, 44, 42, 41, -42, -44, -45, -46, -47, -48, -49, -50, -62, -63, 52, 51, 50, 48, -51, -52 251 }; 252 static const mpc_huffman mpc_huff_Q8_2 [4] = { 253 {0x9800, 6, 63}, {0x2a00, 7, 101}, {0x400, 8, 122}, {0x0, 9, 126} 254 }; // 4 255 static const mpc_int8_t mpc_sym_Q8_2 [127] = { 256 13, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 12, -14, -15, -16, -17, -18, -19, -20, -21, -22, -23, -24, -25, -26, -27, -28, -29, -30, -31, -32, -33, -34, -35, -36, -37, -38, -39, -40, -41, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, -42, -43, -44, -45, -46, -47, -48, -49, -50, -51, -52, -53, -54, -55, -56, -57, -58, -59, 63, 62, 61, 60, -60, -61, -62, -63 257 }; 258 259 static const mpc_huffman mpc_huff_Q9up [6] = { 260 {0xf800, 6, 63}, {0xac00, 7, 125}, {0x2600, 8, -45}, {0x280, 9, -7}, {0x40, 10, -2}, {0x0, 11, -1} 261 }; // 6 262 static const mpc_int8_t mpc_sym_Q9up [256] = { 263 -128, 127, -108, -110, -111, -112, -113, -114, -115, -116, -117, -118, -119, -120, -121, -122, -123, -124, -125, -126, -127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, -44, -45, -46, -47, -48, -49, -50, -51, -52, -53, -54, -55, -56, -57, -58, -59, -60, -61, -62, -63, -64, -65, -66, -67, -68, -69, -70, -71, -72, -73, -74, -75, -76, -77, -78, -79, -80, -81, -82, -83, -84, -85, -86, -87, -88, -89, -90, -91, -92, -93, -94, -95, -96, -97, -98, -99, -100, -101, -102, -103, -104, -105, -106, -107, -109, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 40, 20, 19, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16, -17, -18, -19, -20, -21, -22, -23, -24, -25, -26, -27, -28, -29, -30, -31, -32, -33, -34, -35, -36, -37, -38, -39, -40, -41, -42, -43, 41, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, -3, -4, -5, -6, 4, 3, 2, 1, 0, -1, -2 264 }; 265 mpc_can_data mpc_can_Q9up = {mpc_huff_Q9up, mpc_sym_Q9up}; 266 267 268 mpc_can_data mpc_can_Q [6][2] = { 269 {{mpc_huff_Q2_1, mpc_sym_Q2_1}, {mpc_huff_Q2_2, mpc_sym_Q2_2}}, 270 {{mpc_huff_Q3, mpc_sym_Q3}, {mpc_huff_Q4, mpc_sym_Q4}}, 271 {{mpc_huff_Q5_1, mpc_sym_Q5_1}, {mpc_huff_Q5_2, mpc_sym_Q5_2}}, 272 {{mpc_huff_Q6_1, mpc_sym_Q6_1}, {mpc_huff_Q6_2, mpc_sym_Q6_2}}, 273 {{mpc_huff_Q7_1, mpc_sym_Q7_1}, {mpc_huff_Q7_2, mpc_sym_Q7_2}}, 274 {{mpc_huff_Q8_1, mpc_sym_Q8_1}, {mpc_huff_Q8_2, mpc_sym_Q8_2}} 223 275 }; 224 276 … … 247 299 } 248 300 301 static void can_fill_lut(mpc_can_data * data, const int bits) 302 { 303 int i, idx = 0; 304 const int shift = 16 - bits; 305 const mpc_huffman * table = data->table; 306 const mpc_int8_t * sym = data->sym; 307 mpc_huff_lut * lut = data->lut; 308 for (i = (1 << bits) - 1; i >= 0 ; i--) { 309 if ((table[idx].Code >> shift) < i) { 310 if (table[idx].Length <= bits) { 311 lut[i].Length = table[idx].Length; 312 lut[i].Value = sym[(table[idx].Value - (i >> (bits - table[idx].Length))) & 0xFF]; 313 } else { 314 lut[i].Length = 0; 315 lut[i].Value = idx; 316 } 317 } else { 318 if (table[idx].Length <= bits) { 319 lut[i].Length = table[idx].Length; 320 lut[i].Value = sym[(table[idx].Value - (i >> (bits - table[idx].Length))) & 0xFF]; 321 } else { 322 lut[i].Length = 0; 323 lut[i].Value = idx; 324 } 325 if (i != 0) 326 do { 327 idx++; 328 } while ((table[idx].Code >> shift) == i); 329 } 330 } 331 } 332 249 333 void huff_init_lut(const int bits) 250 334 { … … 254 338 huff_fill_lut(mpc_HuffHdr.table, mpc_HuffHdr.lut, bits); 255 339 256 huff_fill_lut(mpc_HuffSCFI_1.table, mpc_HuffSCFI_1.lut, bits); 257 huff_fill_lut(mpc_HuffSCFI_2.table, mpc_HuffSCFI_2.lut, bits); 258 huff_fill_lut(mpc_HuffDSCF_1.table, mpc_HuffDSCF_1.lut, bits); 259 huff_fill_lut(mpc_HuffDSCF_2.table, mpc_HuffDSCF_2.lut, bits); 260 huff_fill_lut(mpc_HuffRes[0].table, mpc_HuffRes[0].lut, bits); 261 huff_fill_lut(mpc_HuffRes[1].table, mpc_HuffRes[1].lut, bits); 262 huff_fill_lut(mpc_HuffQ9up_8.table, mpc_HuffQ9up_8.lut, bits); 263 264 265 for( i = 0; i < 8; i++){ 340 can_fill_lut(&mpc_can_SCFI[0], bits); 341 can_fill_lut(&mpc_can_SCFI[1], bits); 342 can_fill_lut(&mpc_can_DSCF[0], bits); 343 can_fill_lut(&mpc_can_DSCF[1], bits); 344 can_fill_lut(&mpc_can_Res[0], bits); 345 can_fill_lut(&mpc_can_Res[1], bits); 346 can_fill_lut(&mpc_can_Q1, bits); 347 can_fill_lut(&mpc_can_Q9up, bits); 348 349 350 for( i = 0; i < 7; i++){ 266 351 for( j = 0; j < 2; j++){ 267 huff_fill_lut(mpc_HuffQ_8[i][j].table, mpc_HuffQ_8[i][j].lut, bits);268 if (i != 7)huff_fill_lut(mpc_HuffQ[i][j].table, mpc_HuffQ[i][j].lut, bits);352 if (i != 6) can_fill_lut(&mpc_can_Q[i][j], bits); 353 huff_fill_lut(mpc_HuffQ[i][j].table, mpc_HuffQ[i][j].lut, bits); 269 354 } 270 355 }
Note: See TracChangeset
for help on using the changeset viewer.