00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef AVCODEC_MPC8HUFF_H
00023 #define AVCODEC_MPC8HUFF_H
00024
00025 #include <stdint.h>
00026
00027 #define MPC8_BANDS_SIZE 33
00028 #define MPC8_BANDS_BITS 9
00029
00030 static const uint8_t mpc8_bands_codes[MPC8_BANDS_SIZE] = {
00031 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04,
00032 0x05, 0x06, 0x01, 0x02, 0x03, 0x00, 0x04, 0x05,
00033 0x06, 0x07, 0x08, 0x01, 0x09, 0x0A, 0x0B, 0x07,
00034 0x08, 0x09, 0x06, 0x07, 0x05, 0x05, 0x03, 0x03,
00035 0x01,
00036 };
00037 static const int8_t mpc8_bands_bits[MPC8_BANDS_SIZE] = {
00038 1, 3, 5, 6, 7, 8, 8, 9,
00039 10, 11, 12, 12, 12, 13, 12, 12,
00040 12, 12, 12, 13, 12, 12, 12, 11,
00041 11, 11, 10, 10, 9, 8, 6, 5,
00042 2,
00043 };
00044
00045 #define MPC8_SCFI0_SIZE 4
00046 #define MPC8_SCFI0_BITS 3
00047
00048 static const uint8_t mpc8_scfi0_codes[MPC8_SCFI0_SIZE] = {
00049 0x00, 0x01, 0x01, 0x01,
00050 };
00051 static const int8_t mpc8_scfi0_bits[MPC8_SCFI0_SIZE] = {
00052 3, 3, 1, 2,
00053 };
00054
00055 #define MPC8_SCFI1_SIZE 16
00056 #define MPC8_SCFI1_BITS 7
00057
00058 static const uint8_t mpc8_scfi1_codes[MPC8_SCFI1_SIZE] = {
00059 0x01, 0x00, 0x02, 0x03, 0x01, 0x03, 0x04, 0x05,
00060 0x04, 0x06, 0x02, 0x02, 0x05, 0x07, 0x03, 0x03,
00061
00062 };
00063 static const int8_t mpc8_scfi1_bits[MPC8_SCFI1_SIZE] = {
00064 6, 7, 6, 6, 7, 5, 5, 5,
00065 6, 5, 2, 3, 6, 5, 3, 2,
00066
00067 };
00068
00069 #define MPC8_DSCF0_SIZE 64
00070 #define MPC8_DSCF0_BITS 9
00071
00072 static const uint8_t mpc8_dscf0_codes[MPC8_DSCF0_SIZE] = {
00073 0x03, 0x04, 0x05, 0x04, 0x05, 0x06, 0x05, 0x06,
00074 0x07, 0x08, 0x09, 0x07, 0x08, 0x09, 0x0A, 0x07,
00075 0x08, 0x09, 0x0A, 0x07, 0x08, 0x09, 0x0A, 0x06,
00076 0x07, 0x05, 0x04, 0x05, 0x06, 0x06, 0x07, 0x0A,
00077 0x08, 0x05, 0x06, 0x07, 0x09, 0x07, 0x08, 0x09,
00078 0x0B, 0x0B, 0x0C, 0x0D, 0x0B, 0x0C, 0x0D, 0x0B,
00079 0x0C, 0x0D, 0x07, 0x08, 0x09, 0x06, 0x07, 0x03,
00080 0x04, 0x05, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
00081 };
00082 static const int8_t mpc8_dscf0_bits[MPC8_DSCF0_SIZE] = {
00083 12, 12, 12, 11, 11, 11, 10, 10,
00084 10, 10, 10, 9, 9, 9, 9, 8,
00085 8, 8, 8, 7, 7, 7, 7, 6,
00086 6, 5, 4, 4, 5, 4, 4, 10,
00087 4, 3, 3, 3, 4, 5, 6, 6,
00088 7, 8, 8, 8, 9, 9, 9, 10,
00089 10, 10, 11, 11, 11, 12, 12, 13,
00090 13, 13, 14, 14, 14, 14, 14, 14,
00091
00092 };
00093
00094 #define MPC8_DSCF1_SIZE 65
00095 #define MPC8_DSCF1_BITS 9
00096
00097 static const uint8_t mpc8_dscf1_codes[MPC8_DSCF1_SIZE] = {
00098 0x00, 0x03, 0x04, 0x04, 0x05, 0x06, 0x05, 0x06,
00099 0x07, 0x08, 0x07, 0x08, 0x09, 0x0A, 0x07, 0x08,
00100 0x09, 0x0A, 0x07, 0x08, 0x09, 0x06, 0x07, 0x05,
00101 0x06, 0x04, 0x03, 0x03, 0x04, 0x03, 0x04, 0x05,
00102 0x06, 0x07, 0x05, 0x04, 0x05, 0x05, 0x07, 0x08,
00103 0x09, 0x0A, 0x0B, 0x0B, 0x0C, 0x0D, 0x0B, 0x0C,
00104 0x0D, 0x09, 0x0A, 0x0B, 0x0C, 0x07, 0x08, 0x09,
00105 0x05, 0x06, 0x07, 0x01, 0x02, 0x03, 0x04, 0x05,
00106 0x0D,
00107 };
00108 static const int8_t mpc8_dscf1_bits[MPC8_DSCF1_SIZE] = {
00109 15, 14, 14, 13, 13, 13, 12, 12,
00110 12, 12, 11, 11, 11, 11, 10, 10,
00111 10, 10, 9, 9, 9, 8, 8, 7,
00112 7, 6, 5, 4, 4, 3, 3, 3,
00113 3, 3, 4, 5, 5, 6, 7, 8,
00114 8, 9, 9, 10, 10, 10, 11, 11,
00115 11, 12, 12, 12, 12, 13, 13, 13,
00116 14, 14, 14, 15, 15, 15, 15, 15,
00117 12,
00118 };
00119
00120 #define MPC8_RES_SIZE 17
00121 #define MPC8_RES_BITS 9
00122
00123 static const uint8_t mpc8_res_codes[2][MPC8_RES_SIZE] = {
00124 {
00125 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
00126 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01,
00127 0x01,
00128 },
00129 {
00130 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
00131 0x00, 0x01, 0x02, 0x03, 0x01, 0x01, 0x01, 0x01,
00132 0x03,
00133 }
00134 };
00135 static const int8_t mpc8_res_bits[2][MPC8_RES_SIZE] = {
00136 {
00137 1, 2, 4, 5, 6, 7, 9, 10,
00138 11, 12, 13, 14, 15, 16, 16, 8,
00139 3,
00140 },
00141 {
00142 2, 2, 3, 5, 7, 8, 10, 12,
00143 14, 14, 14, 14, 11, 9, 6, 4,
00144 2,
00145 }
00146 };
00147
00148 #define MPC8_Q1_SIZE 19
00149 #define MPC8_Q1_BITS 9
00150
00151 static const uint8_t mpc8_q1_codes[MPC8_Q1_SIZE] = {
00152 0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
00153 0x03, 0x04, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01,
00154 0x01, 0x00, 0x01,
00155 };
00156 static const int8_t mpc8_q1_bits[MPC8_Q1_SIZE] = {
00157 6, 4, 4, 3, 3, 3, 3, 3,
00158 4, 4, 4, 5, 7, 8, 9, 10,
00159 11, 12, 12,
00160 };
00161
00162 #define MPC8_Q9UP_SIZE 256
00163 #define MPC8_Q9UP_BITS 9
00164
00165 static const uint8_t mpc8_q9up_codes[MPC8_Q9UP_SIZE] = {
00166 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x06, 0x07,
00167 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
00168 0x10, 0x11, 0x12, 0x26, 0x27, 0x13, 0x14, 0x15,
00169 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D,
00170 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
00171 0x28, 0x26, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E,
00172 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36,
00173 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E,
00174 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46,
00175 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E,
00176 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56,
00177 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E,
00178 0x5F, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66,
00179 0x67, 0x68, 0x69, 0x6A, 0x56, 0x57, 0x58, 0x59,
00180 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, 0x60, 0x61,
00181 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x3E,
00182 0x3F, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
00183 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
00184 0x78, 0x79, 0x7A, 0x6B, 0x7B, 0x6C, 0x6D, 0x6E,
00185 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76,
00186 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E,
00187 0x7F, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86,
00188 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E,
00189 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
00190 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E,
00191 0x9F, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6,
00192 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0x27, 0x28, 0x29,
00193 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31,
00194 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
00195 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41,
00196 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
00197 0x4A, 0x4B, 0x06, 0x07, 0x08, 0x09, 0x00, 0x01,
00198 };
00199 static const int8_t mpc8_q9up_bits[MPC8_Q9UP_SIZE] = {
00200 10, 10, 10, 10, 10, 9, 9, 9,
00201 9, 9, 9, 9, 9, 9, 9, 9,
00202 9, 9, 9, 8, 8, 9, 9, 9,
00203 9, 9, 9, 9, 9, 9, 9, 9,
00204 9, 9, 9, 9, 9, 9, 9, 9,
00205 8, 9, 8, 8, 8, 8, 8, 8,
00206 8, 8, 8, 8, 8, 8, 8, 8,
00207 8, 8, 8, 8, 8, 8, 8, 8,
00208 8, 8, 8, 8, 8, 8, 8, 8,
00209 8, 8, 8, 8, 8, 8, 8, 8,
00210 8, 8, 8, 8, 8, 8, 8, 8,
00211 8, 8, 8, 8, 8, 8, 8, 8,
00212 8, 8, 8, 8, 8, 8, 8, 8,
00213 8, 8, 8, 8, 7, 7, 7, 7,
00214 7, 7, 7, 7, 7, 7, 7, 7,
00215 7, 7, 7, 7, 7, 7, 7, 6,
00216 6, 7, 7, 7, 7, 7, 7, 7,
00217 7, 7, 7, 7, 7, 7, 7, 7,
00218 7, 7, 7, 8, 7, 8, 8, 8,
00219 8, 8, 8, 8, 8, 8, 8, 8,
00220 8, 8, 8, 8, 8, 8, 8, 8,
00221 8, 8, 8, 8, 8, 8, 8, 8,
00222 8, 8, 8, 8, 8, 8, 8, 8,
00223 8, 8, 8, 8, 8, 8, 8, 8,
00224 8, 8, 8, 8, 8, 8, 8, 8,
00225 8, 8, 8, 8, 8, 8, 8, 8,
00226 8, 8, 8, 8, 8, 9, 9, 9,
00227 9, 9, 9, 9, 9, 9, 9, 9,
00228 9, 9, 9, 9, 9, 9, 9, 9,
00229 9, 9, 9, 9, 9, 9, 9, 9,
00230 9, 9, 9, 9, 9, 9, 9, 9,
00231 9, 9, 10, 10, 10, 10, 11, 11,
00232 };
00233
00234 #define MPC8_Q2_SIZE 125
00235 #define MPC8_Q2_BITS 9
00236
00237 static const uint8_t mpc8_q2_codes[2][MPC8_Q2_SIZE] = {
00238 {
00239 0x02, 0x03, 0x0F, 0x04, 0x00, 0x05, 0x0C, 0x12,
00240 0x0D, 0x06, 0x07, 0x13, 0x15, 0x14, 0x08, 0x09,
00241 0x0E, 0x15, 0x0F, 0x0A, 0x03, 0x0B, 0x10, 0x0C,
00242 0x01, 0x0D, 0x10, 0x16, 0x11, 0x0E, 0x12, 0x0F,
00243 0x10, 0x16, 0x13, 0x17, 0x11, 0x08, 0x12, 0x18,
00244 0x14, 0x13, 0x14, 0x17, 0x15, 0x0F, 0x16, 0x19,
00245 0x17, 0x10, 0x11, 0x1A, 0x18, 0x1B, 0x12, 0x1C,
00246 0x15, 0x09, 0x16, 0x1D, 0x19, 0x0A, 0x07, 0x0B,
00247 0x1A, 0x1E, 0x17, 0x0C, 0x18, 0x1F, 0x13, 0x20,
00248 0x1B, 0x21, 0x14, 0x11, 0x18, 0x22, 0x19, 0x12,
00249 0x1A, 0x19, 0x1A, 0x1B, 0x1B, 0x23, 0x1C, 0x0D,
00250 0x1D, 0x24, 0x1C, 0x1C, 0x1E, 0x1F, 0x1D, 0x13,
00251 0x1E, 0x25, 0x1F, 0x14, 0x02, 0x15, 0x15, 0x16,
00252 0x04, 0x17, 0x20, 0x26, 0x21, 0x18, 0x16, 0x27,
00253 0x1D, 0x28, 0x19, 0x1A, 0x22, 0x29, 0x23, 0x1B,
00254 0x03, 0x1C, 0x17, 0x1D, 0x05,
00255 },
00256 {
00257 0x02, 0x03, 0x0F, 0x04, 0x00, 0x05, 0x0C, 0x0D,
00258 0x0E, 0x06, 0x07, 0x0F, 0x1E, 0x10, 0x10, 0x08,
00259 0x11, 0x12, 0x13, 0x09, 0x03, 0x0A, 0x11, 0x0B,
00260 0x01, 0x0C, 0x14, 0x15, 0x16, 0x0D, 0x17, 0x12,
00261 0x0E, 0x13, 0x18, 0x19, 0x14, 0x0F, 0x10, 0x1A,
00262 0x1B, 0x15, 0x11, 0x16, 0x1C, 0x0E, 0x1D, 0x1E,
00263 0x1F, 0x0F, 0x12, 0x20, 0x1F, 0x21, 0x13, 0x22,
00264 0x12, 0x13, 0x14, 0x23, 0x20, 0x15, 0x0F, 0x16,
00265 0x21, 0x24, 0x17, 0x18, 0x19, 0x25, 0x14, 0x26,
00266 0x22, 0x27, 0x15, 0x10, 0x28, 0x29, 0x2A, 0x11,
00267 0x2B, 0x17, 0x1A, 0x18, 0x2C, 0x2D, 0x1B, 0x1C,
00268 0x19, 0x2E, 0x2F, 0x1A, 0x1D, 0x1B, 0x30, 0x12,
00269 0x31, 0x32, 0x33, 0x13, 0x02, 0x14, 0x15, 0x16,
00270 0x04, 0x17, 0x34, 0x35, 0x36, 0x18, 0x16, 0x37,
00271 0x23, 0x38, 0x19, 0x1A, 0x39, 0x3A, 0x3B, 0x1B,
00272 0x03, 0x1C, 0x17, 0x1D, 0x05,
00273 }
00274 };
00275 static const int8_t mpc8_q2_bits[2][MPC8_Q2_SIZE] = {
00276 {
00277 12, 11, 10, 11, 13, 11, 9, 8,
00278 9, 11, 11, 8, 7, 8, 11, 11,
00279 9, 8, 9, 11, 12, 11, 10, 11,
00280 13, 11, 9, 8, 9, 11, 9, 6,
00281 6, 7, 9, 8, 6, 4, 6, 8,
00282 9, 6, 6, 7, 9, 11, 9, 8,
00283 9, 11, 10, 8, 7, 8, 10, 8,
00284 6, 4, 6, 8, 7, 4, 3, 4,
00285 7, 8, 6, 4, 6, 8, 10, 8,
00286 7, 8, 10, 11, 9, 8, 9, 11,
00287 9, 6, 6, 6, 9, 8, 6, 4,
00288 6, 8, 9, 7, 6, 6, 9, 11,
00289 9, 8, 9, 11, 13, 11, 10, 11,
00290 12, 11, 9, 8, 9, 11, 10, 8,
00291 7, 8, 11, 11, 9, 8, 9, 11,
00292 13, 11, 10, 11, 12,
00293 },
00294 {
00295 11, 10, 9, 10, 12, 10, 8, 8,
00296 8, 10, 10, 8, 7, 8, 9, 10,
00297 8, 8, 8, 10, 11, 10, 9, 10,
00298 12, 10, 8, 8, 8, 10, 8, 6,
00299 5, 6, 8, 8, 6, 5, 5, 8,
00300 8, 6, 5, 6, 8, 10, 8, 8,
00301 8, 10, 9, 8, 7, 8, 9, 8,
00302 5, 5, 5, 8, 7, 5, 4, 5,
00303 7, 8, 5, 5, 5, 8, 9, 8,
00304 7, 8, 9, 10, 8, 8, 8, 10,
00305 8, 6, 5, 6, 8, 8, 5, 5,
00306 6, 8, 8, 6, 5, 6, 8, 10,
00307 8, 8, 8, 10, 12, 10, 10, 10,
00308 11, 10, 8, 8, 8, 10, 9, 8,
00309 7, 8, 10, 10, 8, 8, 8, 10,
00310 12, 10, 9, 10, 11,
00311 }
00312 };
00313
00314 #define MPC8_Q3_SIZE 49
00315 #define MPC8_Q3_BITS 9
00316 #define MPC8_Q3_OFFSET -48
00317
00318 static const uint8_t mpc8_q3_codes[MPC8_Q3_SIZE] = {
00319 0x07, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x0F,
00320 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x13, 0x12, 0x11,
00321 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09,
00322 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A,
00323 0x09, 0x08, 0x07, 0x06, 0x05, 0x09, 0x08, 0x07,
00324 0x06, 0x05, 0x04, 0x03, 0x02, 0x03, 0x02, 0x01,
00325 0x00,
00326 };
00327 static const int8_t mpc8_q3_bits[MPC8_Q3_SIZE] = {
00328 3, 4, 4, 4, 4, 4, 4, 5,
00329 5, 5, 5, 5, 5, 6, 6, 6,
00330 6, 6, 6, 6, 6, 6, 6, 6,
00331 7, 7, 7, 7, 7, 7, 7, 7,
00332 7, 7, 7, 7, 7, 8, 8, 8,
00333 8, 8, 8, 8, 8, 9, 9, 9,
00334 9,
00335 };
00336 static const int8_t mpc8_q3_syms[MPC8_Q3_SIZE] = {
00337 48, 65, 64, 49, 63, 32, 47, 80,
00338 79, 50, 62, 33, 16, 82, 81, 95,
00339 94, 66, 78, 34, 46, 17, 31, 30,
00340 97, 96, 111, 67, 77, 51, 61, 35,
00341 45, 18, 1, 0, 15, 98, 110, 83,
00342 93, 19, 29, 2, 14, 99, 109, 3,
00343 13,
00344 };
00345
00346 #define MPC8_Q4_SIZE 81
00347 #define MPC8_Q4_BITS 9
00348 #define MPC8_Q4_OFFSET -64
00349
00350 static const uint8_t mpc8_q4_codes[MPC8_Q4_SIZE] = {
00351 0x0F, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, 0x17,
00352 0x16, 0x15, 0x14, 0x13, 0x12, 0x23, 0x22, 0x21,
00353 0x20, 0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19,
00354 0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11,
00355 0x10, 0x0F, 0x0E, 0x0D, 0x19, 0x18, 0x17, 0x16,
00356 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E,
00357 0x0D, 0x0C, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12,
00358 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A,
00359 0x09, 0x08, 0x07, 0x06, 0x05, 0x09, 0x08, 0x07,
00360 0x06, 0x05, 0x04, 0x03, 0x02, 0x03, 0x02, 0x01,
00361 0x00,
00362 };
00363 static const int8_t mpc8_q4_bits[MPC8_Q4_SIZE] = {
00364 4, 5, 5, 5, 5, 5, 5, 5,
00365 5, 5, 5, 5, 5, 6, 6, 6,
00366 6, 6, 6, 6, 6, 6, 6, 6,
00367 6, 6, 6, 6, 6, 6, 6, 6,
00368 6, 6, 6, 6, 7, 7, 7, 7,
00369 7, 7, 7, 7, 7, 7, 7, 7,
00370 7, 7, 8, 8, 8, 8, 8, 8,
00371 8, 8, 8, 8, 8, 8, 8, 8,
00372 8, 8, 8, 8, 8, 9, 9, 9,
00373 9, 9, 9, 9, 9, 10, 10, 10,
00374 10,
00375 };
00376 static const int8_t mpc8_q4_syms[MPC8_Q4_SIZE] = {
00377 64, 96, 81, 80, 95, 66, 65, 79,
00378 78, 49, 48, 63, 32, 113, 112, 98,
00379 97, 111, 110, 83, 82, 94, 93, 67,
00380 77, 51, 50, 62, 61, 34, 33, 47,
00381 46, 17, 16, 31, 128, 114, 127, 126,
00382 99, 109, 68, 76, 35, 45, 18, 30,
00383 0, 15, 130, 129, 143, 142, 115, 125,
00384 100, 108, 84, 92, 52, 60, 36, 44,
00385 19, 29, 2, 1, 14, 131, 141, 116,
00386 124, 20, 28, 3, 13, 132, 140, 4,
00387 12,
00388 };
00389
00390 #define MPC8_Q5_SIZE 15
00391 #define MPC8_Q5_BITS 7
00392 #define MPC8_Q5_OFFSET -7
00393
00394 static const uint8_t mpc8_q5_codes[2][MPC8_Q5_SIZE] = {
00395 {
00396 0x00, 0x01, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03,
00397 0x04, 0x05, 0x03, 0x03, 0x03, 0x02, 0x03,
00398 },
00399 {
00400 0x00, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x05,
00401 0x06, 0x07, 0x04, 0x05, 0x03, 0x02, 0x03,
00402 }
00403 };
00404 static const int8_t mpc8_q5_bits[2][MPC8_Q5_SIZE] = {
00405 {
00406 7, 7, 6, 5, 4, 3, 3, 2,
00407 3, 3, 4, 5, 6, 7, 7,
00408 },
00409 {
00410 6, 6, 5, 4, 4, 3, 3, 3,
00411 3, 3, 4, 4, 5, 6, 6,
00412 }
00413 };
00414
00415 #define MPC8_Q6_SIZE 31
00416 #define MPC8_Q6_BITS 9
00417 #define MPC8_Q6_OFFSET -15
00418
00419 static const uint8_t mpc8_q6_codes[2][MPC8_Q6_SIZE] = {
00420 {
00421 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x04, 0x03,
00422 0x04, 0x05, 0x05, 0x06, 0x04, 0x05, 0x04, 0x03,
00423 0x05, 0x06, 0x07, 0x07, 0x06, 0x07, 0x08, 0x09,
00424 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07,
00425 },
00426 {
00427 0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x05, 0x04,
00428 0x05, 0x06, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
00429 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x07, 0x08, 0x09,
00430 0x06, 0x07, 0x05, 0x06, 0x07, 0x02, 0x03,
00431 }
00432 };
00433 static const int8_t mpc8_q6_bits[2][MPC8_Q6_SIZE] = {
00434 {
00435 9, 9, 9, 9, 8, 8, 7, 6,
00436 6, 6, 5, 5, 4, 4, 3, 2,
00437 3, 4, 4, 5, 6, 6, 6, 6,
00438 7, 8, 8, 9, 9, 9, 9,
00439 },
00440 {
00441 8, 8, 7, 7, 7, 6, 6, 5,
00442 5, 5, 4, 4, 4, 4, 4, 4,
00443 4, 4, 4, 4, 4, 5, 5, 5,
00444 6, 6, 7, 7, 7, 8, 8,
00445 }
00446 };
00447
00448 #define MPC8_Q7_SIZE 63
00449 #define MPC8_Q7_BITS 9
00450 #define MPC8_Q7_OFFSET -31
00451
00452 static const uint8_t mpc8_q7_codes[2][MPC8_Q7_SIZE] = {
00453 {
00454 0x00, 0x01, 0x02, 0x08, 0x09, 0x03, 0x04, 0x05,
00455 0x06, 0x07, 0x0A, 0x0B, 0x0C, 0x0D, 0x0A, 0x0B,
00456 0x0C, 0x0D, 0x0E, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,
00457 0x0A, 0x0B, 0x0C, 0x08, 0x09, 0x06, 0x04, 0x03,
00458 0x05, 0x07, 0x0A, 0x0B, 0x0D, 0x0E, 0x0F, 0x0F,
00459 0x10, 0x11, 0x12, 0x0F, 0x13, 0x10, 0x11, 0x12,
00460 0x13, 0x0E, 0x0F, 0x10, 0x11, 0x08, 0x09, 0x0A,
00461 0x0B, 0x0C, 0x12, 0x13, 0x0D, 0x0E, 0x0F,
00462 },
00463 {
00464 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
00465 0x08, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x09, 0x0A,
00466 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x0C, 0x0D,
00467 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
00468 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D,
00469 0x1E, 0x1F, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
00470 0x17, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x09, 0x0A,
00471 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x02, 0x03,
00472 }
00473 };
00474 static const int8_t mpc8_q7_bits[2][MPC8_Q7_SIZE] = {
00475 {
00476 10, 10, 10, 9, 9, 10, 10, 10,
00477 10, 10, 9, 9, 9, 9, 8, 8,
00478 8, 8, 8, 7, 7, 7, 7, 7,
00479 6, 6, 6, 5, 5, 4, 3, 2,
00480 3, 4, 5, 5, 6, 6, 6, 7,
00481 7, 7, 7, 8, 7, 8, 8, 8,
00482 8, 9, 9, 9, 9, 10, 10, 10,
00483 10, 10, 9, 9, 10, 10, 10,
00484 },
00485 {
00486 9, 9, 8, 8, 8, 8, 8, 8,
00487 8, 7, 7, 7, 7, 7, 6, 6,
00488 6, 6, 6, 6, 6, 6, 5, 5,
00489 5, 5, 5, 5, 5, 5, 5, 5,
00490 5, 5, 5, 5, 5, 5, 5, 5,
00491 5, 5, 6, 6, 6, 6, 6, 6,
00492 6, 7, 7, 7, 7, 7, 8, 8,
00493 8, 8, 8, 8, 8, 9, 9,
00494 }
00495 };
00496
00497 #define MPC8_Q8_SIZE 127
00498 #define MPC8_Q8_BITS 9
00499 #define MPC8_Q8_OFFSET -63
00500
00501 static const uint8_t mpc8_q8_codes[2][MPC8_Q8_SIZE] = {
00502 {
00503 0x03, 0x04, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x1A,
00504 0x0F, 0x1B, 0x10, 0x00, 0x01, 0x05, 0x06, 0x07,
00505 0x08, 0x09, 0x0A, 0x0B, 0x11, 0x0C, 0x12, 0x13,
00506 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1C, 0x1A,
00507 0x1B, 0x1C, 0x1D, 0x1E, 0x1D, 0x1E, 0x1F, 0x20,
00508 0x21, 0x22, 0x23, 0x24, 0x19, 0x25, 0x1A, 0x1B,
00509 0x1C, 0x1D, 0x1E, 0x1F, 0x14, 0x15, 0x16, 0x17,
00510 0x0E, 0x0F, 0x10, 0x11, 0x0B, 0x07, 0x04, 0x03,
00511 0x05, 0x0C, 0x0D, 0x12, 0x13, 0x14, 0x15, 0x18,
00512 0x19, 0x1A, 0x1B, 0x20, 0x21, 0x22, 0x23, 0x24,
00513 0x25, 0x26, 0x27, 0x26, 0x27, 0x28, 0x29, 0x2A,
00514 0x2B, 0x2C, 0x2D, 0x2E, 0x1F, 0x20, 0x2F, 0x21,
00515 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29,
00516 0x0D, 0x0E, 0x2A, 0x0F, 0x10, 0x11, 0x12, 0x02,
00517 0x13, 0x03, 0x04, 0x05, 0x2B, 0x2C, 0x30, 0x31,
00518 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33,
00519 },
00520 {
00521 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
00522 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
00523 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x15, 0x16,
00524 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E,
00525 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
00526 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E,
00527 0x2F, 0x30, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B,
00528 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33,
00529 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B,
00530 0x3C, 0x3D, 0x3E, 0x31, 0x3F, 0x32, 0x33, 0x34,
00531 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C,
00532 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44,
00533 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x16,
00534 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E,
00535 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
00536 0x27, 0x28, 0x29, 0x04, 0x05, 0x06, 0x07,
00537 }
00538 };
00539 static const int8_t mpc8_q8_bits[2][MPC8_Q8_SIZE] = {
00540 {
00541 11, 11, 10, 10, 10, 10, 10, 9,
00542 10, 9, 10, 12, 12, 11, 11, 11,
00543 11, 11, 11, 11, 10, 11, 10, 10,
00544 10, 10, 10, 10, 10, 10, 9, 10,
00545 10, 10, 10, 10, 9, 9, 9, 9,
00546 9, 9, 9, 9, 8, 9, 8, 8,
00547 8, 8, 8, 8, 7, 7, 7, 7,
00548 6, 6, 6, 6, 5, 4, 3, 2,
00549 3, 5, 5, 6, 6, 6, 6, 7,
00550 7, 7, 7, 8, 8, 8, 8, 8,
00551 8, 8, 8, 9, 9, 9, 9, 9,
00552 9, 9, 9, 9, 10, 10, 9, 10,
00553 10, 10, 10, 10, 10, 10, 10, 10,
00554 11, 11, 10, 11, 11, 11, 11, 12,
00555 11, 12, 12, 12, 10, 10, 9, 9,
00556 10, 10, 10, 10, 10, 10, 10,
00557 },
00558 {
00559 9, 9, 9, 9, 8, 8, 8, 8,
00560 8, 8, 8, 8, 8, 8, 8, 8,
00561 8, 8, 8, 8, 8, 8, 7, 7,
00562 7, 7, 7, 7, 7, 7, 7, 7,
00563 7, 7, 7, 7, 7, 7, 7, 7,
00564 7, 7, 7, 7, 7, 7, 7, 7,
00565 7, 7, 6, 6, 6, 6, 6, 6,
00566 6, 6, 6, 6, 6, 6, 6, 6,
00567 6, 6, 6, 6, 6, 6, 6, 6,
00568 6, 6, 6, 7, 6, 7, 7, 7,
00569 7, 7, 7, 7, 7, 7, 7, 7,
00570 7, 7, 7, 7, 7, 7, 7, 7,
00571 7, 7, 7, 7, 7, 7, 7, 8,
00572 8, 8, 8, 8, 8, 8, 8, 8,
00573 8, 8, 8, 8, 8, 8, 8, 8,
00574 8, 8, 8, 9, 9, 9, 9,
00575 }
00576 };
00577
00578 #endif