mirror of
https://github.com/darlinghq/darling-IOGraphics.git
synced 2024-11-23 12:29:54 +00:00
700 lines
52 KiB
C
700 lines
52 KiB
C
/*
|
|
cc -o /tmp/fitline fitline.c
|
|
*/
|
|
|
|
#include <stdlib.h>
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#include <stdio.h>
|
|
#include <strings.h>
|
|
#include <assert.h>
|
|
#include <IOKit/graphics/IOGraphicsTypesPrivate.h>
|
|
|
|
#define SRCDATACOUNT 1024
|
|
|
|
static uint16_t data[3][SRCDATACOUNT] = {{
|
|
#if 0
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
},{
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
},{
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
|
|
#elif 0
|
|
// k92
|
|
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
|
|
0x0000,0x002b,0x00c4,0x0129,0x0176,0x01de,0x0241,0x02a9,0x0320,0x039b,0x0423,0x04ac,0x0540,0x05dc,0x068c,0x0749,
|
|
0x080b,0x08e5,0x09bf,0x0aad,0x0bac,0x0cb5,0x0dc3,0x0edd,0x1006,0x1133,0x126f,0x13b5,0x14fc,0x1646,0x179d,0x18f6,
|
|
0x1a50,0x1bab,0x1d06,0x1e5e,0x1fb3,0x210d,0x2265,0x23b4,0x2505,0x2658,0x27a2,0x28ea,0x2a38,0x2b7c,0x2cbf,0x2e00,
|
|
0x2f43,0x3085,0x31c3,0x3303,0x3443,0x3584,0x36bc,0x37f4,0x392b,0x3a5a,0x3b90,0x3cc4,0x3df6,0x3f27,0x4057,0x4186,
|
|
0x42b2,0x43dc,0x4504,0x4629,0x4749,0x4866,0x497f,0x4a95,0x4bab,0x4cbd,0x4dce,0x4edc,0x4fee,0x510c,0x5232,0x5355,
|
|
0x5478,0x559a,0x56bb,0x57da,0x58fa,0x5a1d,0x5b3c,0x5c59,0x5d74,0x5e90,0x5faa,0x60c3,0x61dc,0x62f3,0x640b,0x6524,
|
|
0x6639,0x674a,0x6855,0x6960,0x6a6a,0x6b70,0x6c7a,0x6d80,0x6e83,0x6f87,0x7088,0x7185,0x7284,0x737c,0x7473,0x756a,
|
|
0x7660,0x7752,0x7843,0x7933,0x7a18,0x7af1,0x7bc4,0x7c97,0x7d6e,0x7e46,0x7f21,0x8000,0x80e3,0x81c9,0x82b2,0x83a0,
|
|
0x8491,0x8585,0x8679,0x8773,0x886e,0x896b,0x8a6f,0x8b93,0x8cea,0x8e3a,0x8f88,0x90d2,0x9218,0x9359,0x9499,0x95d2,
|
|
0x9707,0x9839,0x9966,0x9a8e,0x9bba,0x9cde,0x9e03,0x9f27,0xa04e,0xa176,0xa29c,0xa3c1,0xa4e3,0xa608,0xa72b,0xa84e,
|
|
0xa970,0xaa92,0xabb2,0xacce,0xadec,0xaf09,0xb026,0xb140,0xb25b,0xb375,0xb48f,0xb5a9,0xb6c6,0xb7e2,0xb8ff,0xba1a,
|
|
0xbb35,0xbc4d,0xbd61,0xbe74,0xbf85,0xc096,0xc1a5,0xc2ae,0xc3ba,0xc4c6,0xc5d4,0xc6dd,0xc7e5,0xc8ed,0xc9e5,0xcad8,
|
|
0xcbc5,0xccb2,0xcd9a,0xce7e,0xcf5e,0xd03b,0xd115,0xd1ef,0xd2c3,0xd399,0xd46e,0xd540,0xd612,0xd6e4,0xd7ae,0xd873,
|
|
0xd934,0xd9f4,0xdaaf,0xdb66,0xdc1b,0xdccf,0xdd81,0xde32,0xdee4,0xdf96,0xe04b,0xe103,0xe1bb,0xe276,0xe337,0xe400,
|
|
0xe4cd,0xe597,0xe660,0xe728,0xe7ef,0xe8b2,0xe971,0xea2e,0xeaea,0xeba2,0xec59,0xed0d,0xedbe,0xee70,0xef23,0xefdc,
|
|
0xf09f,0xf169,0xf23a,0xf312,0xf3f4,0xf4e2,0xf5db,0xf6e2,0xf7f5,0xf914,0xfa3f,0xfb73,0xfcb0,0xfdf2,0xff25,0xffff,
|
|
},{
|
|
0x0000,0x001d,0x0083,0x0111,0x0157,0x01b7,0x021e,0x0276,0x02e0,0x034c,0x03c1,0x0442,0x04cf,0x0563,0x0602,0x06ae,
|
|
0x0766,0x0827,0x08f0,0x09ce,0x0ab5,0x0ba8,0x0ca0,0x0da3,0x0eb3,0x0fcd,0x10f4,0x1219,0x1348,0x1479,0x15b1,0x16e9,
|
|
0x1828,0x1962,0x1aa2,0x1bda,0x1d17,0x1e54,0x1f87,0x20bd,0x21f1,0x2325,0x244f,0x257b,0x26a4,0x27cb,0x28ed,0x2a10,
|
|
0x2b31,0x2c53,0x2d70,0x2e8d,0x2fad,0x30c8,0x31e0,0x32f8,0x340f,0x3522,0x363a,0x374d,0x3863,0x3974,0x3a83,0x3b93,
|
|
0x3ca2,0x3dae,0x3eb8,0x3fbf,0x40c3,0x41c5,0x42c3,0x43c0,0x44bc,0x45b5,0x46ac,0x47a2,0x489c,0x49a3,0x4ab1,0x4bbf,
|
|
0x4cca,0x4dd6,0x4ee1,0x4feb,0x50f4,0x5200,0x530b,0x5412,0x551a,0x5622,0x5727,0x582e,0x5933,0x5a38,0x5b3e,0x5c45,
|
|
0x5d48,0x5e47,0x5f40,0x6038,0x6130,0x6227,0x631f,0x6416,0x650d,0x6604,0x66f9,0x67ef,0x68e4,0x69d8,0x6acc,0x6bc1,
|
|
0x6cb7,0x6daa,0x6e9e,0x6f8f,0x7078,0x7146,0x720d,0x72d4,0x739e,0x746c,0x7538,0x7607,0x76da,0x77af,0x7886,0x795d,
|
|
0x7a36,0x7b11,0x7bec,0x7cca,0x7daa,0x7e89,0x7f68,0x8055,0x8157,0x8261,0x836d,0x8476,0x857f,0x8687,0x8793,0x889e,
|
|
0x89a7,0x8ab0,0x8bbc,0x8cc7,0x8dd1,0x8edd,0x8fe8,0x90f3,0x9200,0x9310,0x9421,0x9532,0x9641,0x9753,0x9866,0x9976,
|
|
0x9a85,0x9b96,0x9ca6,0x9db4,0x9ebf,0x9fcc,0xa0d6,0xa1e1,0xa2e9,0xa3ef,0xa4f9,0xa60a,0xa729,0xa84c,0xa971,0xaa9a,
|
|
0xabc1,0xacea,0xae10,0xaf3d,0xb06a,0xb197,0xb2c6,0xb3f7,0xb528,0xb65c,0xb78f,0xb8c1,0xb9f4,0xbb20,0xbc43,0xbd64,
|
|
0xbe84,0xbf9c,0xc0af,0xc1c1,0xc2cb,0xc3ce,0xc4d0,0xc5c8,0xc6be,0xc7b1,0xc8a2,0xc98f,0xca7b,0xcb67,0xcc55,0xcd42,
|
|
0xce2c,0xcf14,0xcff9,0xd0d9,0xd1b5,0xd290,0xd36b,0xd444,0xd51d,0xd5f8,0xd6d3,0xd7b2,0xd892,0xd974,0xda5a,0xdb43,
|
|
0xdc2f,0xdd1b,0xde0a,0xdefa,0xdfec,0xe0e0,0xe1d5,0xe2cb,0xe3c5,0xe4c1,0xe5be,0xe6be,0xe7bc,0xe8bd,0xe9be,0xeabf,
|
|
0xebc3,0xeccd,0xede5,0xef06,0xf034,0xf172,0xf2bc,0xf416,0xf583,0xf6fd,0xf885,0xfa18,0xfbb5,0xfd57,0xfefe,0xffff,
|
|
},{
|
|
0x0000,0x0056,0x0114,0x0165,0x01de,0x0234,0x0285,0x02e7,0x0346,0x03ac,0x041d,0x048e,0x050b,0x0589,0x0612,0x06a4,
|
|
0x073e,0x07de,0x0886,0x0938,0x09f6,0x0ab6,0x0b80,0x0c53,0x0d2d,0x0e0d,0x0ef2,0x0fe2,0x10cf,0x11c3,0x12c1,0x13cd,
|
|
0x14dd,0x15ef,0x1704,0x1818,0x1928,0x1a40,0x1b52,0x1c65,0x1d77,0x1e87,0x1f95,0x20a4,0x21b3,0x22bf,0x23c9,0x24d3,
|
|
0x25df,0x26e9,0x27f0,0x28f8,0x2a00,0x2b08,0x2c08,0x2cff,0x2df1,0x2edf,0x2fd0,0x30c0,0x31af,0x329d,0x3389,0x3475,
|
|
0x355e,0x3646,0x372b,0x380f,0x38ef,0x39d1,0x3aae,0x3b89,0x3c64,0x3d3f,0x3e19,0x3ef0,0x3fc9,0x40a3,0x417f,0x425f,
|
|
0x433f,0x441e,0x4502,0x45e4,0x46c7,0x47aa,0x488d,0x4972,0x4a55,0x4b3b,0x4c1d,0x4d00,0x4de2,0x4ec2,0x4fa3,0x5084,
|
|
0x5166,0x524e,0x533b,0x5424,0x550c,0x55ef,0x56ce,0x57aa,0x5884,0x5958,0x5a2a,0x5afc,0x5bcc,0x5c9b,0x5d69,0x5e3a,
|
|
0x5f0b,0x5fdd,0x60b1,0x618a,0x6265,0x632a,0x63e5,0x649d,0x6559,0x661a,0x66df,0x67aa,0x6879,0x694d,0x6a25,0x6b01,
|
|
0x6bdd,0x6cbb,0x6d99,0x6e74,0x6f4e,0x7027,0x70fd,0x71cb,0x7290,0x7353,0x7417,0x74da,0x759c,0x765d,0x7720,0x77e2,
|
|
0x78a3,0x7963,0x7a25,0x7ae6,0x7ba6,0x7c67,0x7d27,0x7de8,0x7eaa,0x7f73,0x804e,0x8130,0x8211,0x82f5,0x83da,0x84be,
|
|
0x85a2,0x8687,0x876c,0x8850,0x8932,0x8a14,0x8af6,0x8bd6,0x8cb4,0x8d91,0x8e6f,0x8f51,0x9035,0x911e,0x920b,0x92fa,
|
|
0x93ed,0x94e2,0x95d7,0x96d4,0x97d4,0x98d5,0x99d9,0x9ae0,0x9be9,0x9cf5,0x9dff,0x9f09,0xa01c,0xa13f,0xa26e,0xa39d,
|
|
0xa4ce,0xa601,0xa734,0xa867,0xa99b,0xaac9,0xabf2,0xad16,0xae36,0xaf50,0xb064,0xb174,0xb281,0xb38e,0xb4a3,0xb5be,
|
|
0xb6d6,0xb7ec,0xb900,0xba12,0xbb22,0xbc34,0xbd49,0xbe62,0xbf81,0xc0a6,0xc1d4,0xc30a,0xc447,0xc58d,0xc6d6,0xc80b,
|
|
0xc935,0xca5f,0xcb8c,0xccbc,0xcdf0,0xcf29,0xd061,0xd1a0,0xd2de,0xd41e,0xd55c,0xd69c,0xd7da,0xd918,0xda58,0xdba1,
|
|
0xdcf6,0xde59,0xdfd0,0xe15c,0xe308,0xe4d8,0xe6d4,0xe909,0xeb74,0xee12,0xf0e7,0xf3e3,0xf71d,0xfa6f,0xfddf,0xffff,
|
|
#elif 0
|
|
0x0000,0x0101,0x0202,0x0303,0x0404,0x0505,0x0606,0x0707,0x0808,0x0909,0x0a0a,0x0b0b,0x0c0c,0x0d0d,0x0e0e,0x0f0f,
|
|
0x1010,0x1111,0x1212,0x1313,0x1414,0x1515,0x1616,0x1717,0x1818,0x1919,0x1a1a,0x1b1b,0x1c1c,0x1d1d,0x1e1e,0x1f1f,
|
|
0x2020,0x2121,0x2222,0x2323,0x2424,0x2525,0x2626,0x2727,0x2828,0x2929,0x2a2a,0x2b2b,0x2c2c,0x2d2d,0x2e2e,0x2f2f,
|
|
0x3030,0x3131,0x3232,0x3333,0x3434,0x3535,0x3636,0x3737,0x3838,0x3939,0x3a3a,0x3b3b,0x3c3c,0x3d3d,0x3e3e,0x3f3f,
|
|
0x4040,0x4141,0x4242,0x4343,0x4444,0x4545,0x4646,0x4747,0x4848,0x4949,0x4a4a,0x4b4b,0x4c4c,0x4d4d,0x4e4e,0x4f4f,
|
|
0x5050,0x5151,0x5252,0x5353,0x5454,0x5555,0x5656,0x5757,0x5858,0x5959,0x5a5a,0x5b5b,0x5c5c,0x5d5d,0x5e5e,0x5f5f,
|
|
0x6060,0x6161,0x6262,0x6363,0x6464,0x6565,0x6666,0x6767,0x6868,0x6969,0x6a6a,0x6b6b,0x6c6c,0x6d6d,0x6e6e,0x6f6f,
|
|
0x7070,0x7171,0x7272,0x7373,0x7474,0x7575,0x7676,0x7777,0x7878,0x7979,0x7a7a,0x7b7b,0x7c7c,0x7d7d,0x7e7e,0x7f7f,
|
|
0x8080,0x8181,0x8282,0x8383,0x8484,0x8585,0x8686,0x8787,0x8888,0x8989,0x8a8a,0x8b8b,0x8c8c,0x8d8d,0x8e8e,0x8f8f,
|
|
0x9090,0x9191,0x9292,0x9393,0x9494,0x9595,0x9696,0x9797,0x9898,0x9999,0x9a9a,0x9b9b,0x9c9c,0x9d9d,0x9e9e,0x9f9f,
|
|
0xa0a0,0xa1a1,0xa2a2,0xa3a3,0xa4a4,0xa5a5,0xa6a6,0xa7a7,0xa8a8,0xa9a9,0xaaaa,0xabab,0xacac,0xadad,0xaeae,0xafaf,
|
|
0xb0b0,0xb1b1,0xb2b2,0xb3b3,0xb4b4,0xb5b5,0xb6b6,0xb7b7,0xb8b8,0xb9b9,0xbaba,0xbbbb,0xbcbc,0xbdbd,0xbebe,0xbfbf,
|
|
0xc0c0,0xc1c1,0xc2c2,0xc3c3,0xc4c4,0xc5c5,0xc6c6,0xc7c7,0xc8c8,0xc9c9,0xcaca,0xcbcb,0xcccc,0xcdcd,0xcece,0xcfcf,
|
|
0xd0d0,0xd1d1,0xd2d2,0xd3d3,0xd4d4,0xd5d5,0xd6d6,0xd7d7,0xd8d8,0xd9d9,0xdada,0xdbdb,0xdcdc,0xdddd,0xdede,0xdfdf,
|
|
0xe0e0,0xe1e1,0xe2e2,0xe3e3,0xe4e4,0xe5e5,0xe6e6,0xe7e7,0xe8e8,0xe9e9,0xeaea,0xebeb,0xecec,0xeded,0xeeee,0xefef,
|
|
0xf0f0,0xf1f1,0xf2f2,0xf3f3,0xf4f4,0xf5f5,0xf6f6,0xf7f7,0xf8f8,0xf9f9,0xfafa,0xfbfb,0xfcfc,0xfdfd,0xfefe,0xffff,
|
|
},{
|
|
0x0000,0x0101,0x0202,0x0303,0x0404,0x0505,0x0606,0x0707,0x0808,0x0909,0x0a0a,0x0b0b,0x0c0c,0x0d0d,0x0e0e,0x0f0f,
|
|
0x1010,0x1111,0x1212,0x1313,0x1414,0x1515,0x1616,0x1717,0x1818,0x1919,0x1a1a,0x1b1b,0x1c1c,0x1d1d,0x1e1e,0x1f1f,
|
|
0x2020,0x2121,0x2222,0x2323,0x2424,0x2525,0x2626,0x2727,0x2828,0x2929,0x2a2a,0x2b2b,0x2c2c,0x2d2d,0x2e2e,0x2f2f,
|
|
0x3030,0x3131,0x3232,0x3333,0x3434,0x3535,0x3636,0x3737,0x3838,0x3939,0x3a3a,0x3b3b,0x3c3c,0x3d3d,0x3e3e,0x3f3f,
|
|
0x4040,0x4141,0x4242,0x4343,0x4444,0x4545,0x4646,0x4747,0x4848,0x4949,0x4a4a,0x4b4b,0x4c4c,0x4d4d,0x4e4e,0x4f4f,
|
|
0x5050,0x5151,0x5252,0x5353,0x5454,0x5555,0x5656,0x5757,0x5858,0x5959,0x5a5a,0x5b5b,0x5c5c,0x5d5d,0x5e5e,0x5f5f,
|
|
0x6060,0x6161,0x6262,0x6363,0x6464,0x6565,0x6666,0x6767,0x6868,0x6969,0x6a6a,0x6b6b,0x6c6c,0x6d6d,0x6e6e,0x6f6f,
|
|
0x7070,0x7171,0x7272,0x7373,0x7474,0x7575,0x7676,0x7777,0x7878,0x7979,0x7a7a,0x7b7b,0x7c7c,0x7d7d,0x7e7e,0x7f7f,
|
|
0x8080,0x8181,0x8282,0x8383,0x8484,0x8585,0x8686,0x8787,0x8888,0x8989,0x8a8a,0x8b8b,0x8c8c,0x8d8d,0x8e8e,0x8f8f,
|
|
0x9090,0x9191,0x9292,0x9393,0x9494,0x9595,0x9696,0x9797,0x9898,0x9999,0x9a9a,0x9b9b,0x9c9c,0x9d9d,0x9e9e,0x9f9f,
|
|
0xa0a0,0xa1a1,0xa2a2,0xa3a3,0xa4a4,0xa5a5,0xa6a6,0xa7a7,0xa8a8,0xa9a9,0xaaaa,0xabab,0xacac,0xadad,0xaeae,0xafaf,
|
|
0xb0b0,0xb1b1,0xb2b2,0xb3b3,0xb4b4,0xb5b5,0xb6b6,0xb7b7,0xb8b8,0xb9b9,0xbaba,0xbbbb,0xbcbc,0xbdbd,0xbebe,0xbfbf,
|
|
0xc0c0,0xc1c1,0xc2c2,0xc3c3,0xc4c4,0xc5c5,0xc6c6,0xc7c7,0xc8c8,0xc9c9,0xcaca,0xcbcb,0xcccc,0xcdcd,0xcece,0xcfcf,
|
|
0xd0d0,0xd1d1,0xd2d2,0xd3d3,0xd4d4,0xd5d5,0xd6d6,0xd7d7,0xd8d8,0xd9d9,0xdada,0xdbdb,0xdcdc,0xdddd,0xdede,0xdfdf,
|
|
0xe0e0,0xe1e1,0xe2e2,0xe3e3,0xe4e4,0xe5e5,0xe6e6,0xe7e7,0xe8e8,0xe9e9,0xeaea,0xebeb,0xecec,0xeded,0xeeee,0xefef,
|
|
0xf0f0,0xf1f1,0xf2f2,0xf3f3,0xf4f4,0xf5f5,0xf6f6,0xf7f7,0xf8f8,0xf9f9,0xfafa,0xfbfb,0xfcfc,0xfdfd,0xfefe,0xffff,
|
|
},{
|
|
0x0000,0x0101,0x0202,0x0303,0x0404,0x0505,0x0606,0x0707,0x0808,0x0909,0x0a0a,0x0b0b,0x0c0c,0x0d0d,0x0e0e,0x0f0f,
|
|
0x1010,0x1111,0x1212,0x1313,0x1414,0x1515,0x1616,0x1717,0x1818,0x1919,0x1a1a,0x1b1b,0x1c1c,0x1d1d,0x1e1e,0x1f1f,
|
|
0x2020,0x2121,0x2222,0x2323,0x2424,0x2525,0x2626,0x2727,0x2828,0x2929,0x2a2a,0x2b2b,0x2c2c,0x2d2d,0x2e2e,0x2f2f,
|
|
0x3030,0x3131,0x3232,0x3333,0x3434,0x3535,0x3636,0x3737,0x3838,0x3939,0x3a3a,0x3b3b,0x3c3c,0x3d3d,0x3e3e,0x3f3f,
|
|
0x4040,0x4141,0x4242,0x4343,0x4444,0x4545,0x4646,0x4747,0x4848,0x4949,0x4a4a,0x4b4b,0x4c4c,0x4d4d,0x4e4e,0x4f4f,
|
|
0x5050,0x5151,0x5252,0x5353,0x5454,0x5555,0x5656,0x5757,0x5858,0x5959,0x5a5a,0x5b5b,0x5c5c,0x5d5d,0x5e5e,0x5f5f,
|
|
0x6060,0x6161,0x6262,0x6363,0x6464,0x6565,0x6666,0x6767,0x6868,0x6969,0x6a6a,0x6b6b,0x6c6c,0x6d6d,0x6e6e,0x6f6f,
|
|
0x7070,0x7171,0x7272,0x7373,0x7474,0x7575,0x7676,0x7777,0x7878,0x7979,0x7a7a,0x7b7b,0x7c7c,0x7d7d,0x7e7e,0x7f7f,
|
|
0x8080,0x8181,0x8282,0x8383,0x8484,0x8585,0x8686,0x8787,0x8888,0x8989,0x8a8a,0x8b8b,0x8c8c,0x8d8d,0x8e8e,0x8f8f,
|
|
0x9090,0x9191,0x9292,0x9393,0x9494,0x9595,0x9696,0x9797,0x9898,0x9999,0x9a9a,0x9b9b,0x9c9c,0x9d9d,0x9e9e,0x9f9f,
|
|
0xa0a0,0xa1a1,0xa2a2,0xa3a3,0xa4a4,0xa5a5,0xa6a6,0xa7a7,0xa8a8,0xa9a9,0xaaaa,0xabab,0xacac,0xadad,0xaeae,0xafaf,
|
|
0xb0b0,0xb1b1,0xb2b2,0xb3b3,0xb4b4,0xb5b5,0xb6b6,0xb7b7,0xb8b8,0xb9b9,0xbaba,0xbbbb,0xbcbc,0xbdbd,0xbebe,0xbfbf,
|
|
0xc0c0,0xc1c1,0xc2c2,0xc3c3,0xc4c4,0xc5c5,0xc6c6,0xc7c7,0xc8c8,0xc9c9,0xcaca,0xcbcb,0xcccc,0xcdcd,0xcece,0xcfcf,
|
|
0xd0d0,0xd1d1,0xd2d2,0xd3d3,0xd4d4,0xd5d5,0xd6d6,0xd7d7,0xd8d8,0xd9d9,0xdada,0xdbdb,0xdcdc,0xdddd,0xdede,0xdfdf,
|
|
0xe0e0,0xe1e1,0xe2e2,0xe3e3,0xe4e4,0xe5e5,0xe6e6,0xe7e7,0xe8e8,0xe9e9,0xeaea,0xebeb,0xecec,0xeded,0xeeee,0xefef,
|
|
0xf0f0,0xf1f1,0xf2f2,0xf3f3,0xf4f4,0xf5f5,0xf6f6,0xf7f7,0xf8f8,0xf9f9,0xfafa,0xfbfb,0xfcfc,0xfdfd,0xfefe,0xffff,
|
|
#elif 0
|
|
// k99
|
|
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
|
|
0x0000,0x0056,0x012e,0x01eb,0x02c4,0x0383,0x0441,0x0507,0x05da,0x06ae,0x078c,0x086f,0x0951,0x0a36,0x0b2c,0x0c16,
|
|
0x0d2c,0x0e45,0x0f57,0x106e,0x118a,0x12b0,0x13d7,0x14fd,0x1627,0x1752,0x1883,0x19b9,0x1aec,0x1c29,0x1d61,0x1ea5,
|
|
0x1ff1,0x2136,0x2282,0x23cc,0x2518,0x2661,0x27ad,0x28f7,0x2a46,0x2b93,0x2ce2,0x2e30,0x2f7d,0x30c8,0x3212,0x3358,
|
|
0x349e,0x35e3,0x3726,0x3866,0x39a2,0x3ade,0x3c1a,0x3d4f,0x3e84,0x3fb6,0x40e8,0x4216,0x4347,0x4457,0x4564,0x4672,
|
|
0x477d,0x4886,0x498d,0x4a93,0x4b98,0x4c99,0x4d9a,0x4e9a,0x4f99,0x5098,0x5197,0x5296,0x5399,0x549d,0x55a0,0x56a4,
|
|
0x57a6,0x58a7,0x59a9,0x5aaa,0x5baa,0x5caa,0x5da9,0x5ea7,0x5fa6,0x60a5,0x61a1,0x629b,0x6394,0x648b,0x6582,0x6678,
|
|
0x676c,0x6860,0x6952,0x6a43,0x6b35,0x6c25,0x6d16,0x6e06,0x6ef6,0x6fe5,0x70d4,0x71c2,0x72b1,0x739f,0x748d,0x757a,
|
|
0x7666,0x7752,0x783c,0x7925,0x7a0e,0x7af5,0x7bdb,0x7cc1,0x7da6,0x7e8b,0x7f70,0x8057,0x8140,0x822b,0x831a,0x840d,
|
|
0x8506,0x8605,0x870a,0x8815,0x8925,0x8a3b,0x8b56,0x8c73,0x8d7e,0x8e87,0x8f90,0x9099,0x91a1,0x92a8,0x93af,0x94b5,
|
|
0x95bb,0x96c1,0x97c8,0x98ce,0x99d4,0x9adb,0x9be4,0x9cf5,0x9e06,0x9f16,0xa025,0xa131,0xa23a,0xa341,0xa447,0xa549,
|
|
0xa64b,0xa74c,0xa84c,0xa94b,0xaa4b,0xab4d,0xac57,0xad64,0xae70,0xaf7c,0xb087,0xb191,0xb29a,0xb3a2,0xb4a7,0xb5ad,
|
|
0xb6b1,0xb7b5,0xb8b7,0xb9ba,0xbabb,0xbbc3,0xbccb,0xbdd2,0xbed9,0xbfe0,0xc0e7,0xc1ed,0xc2f2,0xc3f7,0xc4fb,0xc5ff,
|
|
0xc702,0xc804,0xc906,0xca0a,0xcb16,0xcc25,0xcd36,0xce48,0xcf5c,0xd070,0xd186,0xd29c,0xd3b2,0xd4c8,0xd5dd,0xd6f0,
|
|
0xd802,0xd913,0xda1d,0xdb16,0xdc07,0xdcf6,0xdde2,0xdecc,0xdfb5,0xe09c,0xe184,0xe26c,0xe356,0xe442,0xe531,0xe622,
|
|
0xe716,0xe806,0xe8d2,0xe9a2,0xea78,0xeb52,0xec2f,0xed0e,0xedf0,0xeed2,0xefb4,0xf095,0xf176,0xf255,0xf331,0xf409,
|
|
0xf4dd,0xf5a7,0xf668,0xf719,0xf7ab,0xf814,0xf851,0xf88e,0xf8cb,0xf90f,0xf961,0xf9b3,0xfa1b,0xfaf0,0xfca7,0xffff,
|
|
},{
|
|
0x0000,0x0056,0x0145,0x0228,0x02d1,0x0383,0x0441,0x0506,0x05c6,0x0698,0x0769,0x0839,0x0914,0x09ec,0x0ac5,0x0bae,
|
|
0x0cb2,0x0dbe,0x0ed4,0x0fe8,0x10f5,0x120f,0x132d,0x1445,0x1561,0x1681,0x17a4,0x18ca,0x19f4,0x1b19,0x1c41,0x1d7d,
|
|
0x1ebc,0x1ff9,0x2137,0x2271,0x23b2,0x24f1,0x262e,0x276d,0x28ad,0x29ef,0x2b2d,0x2c70,0x2db0,0x2ef2,0x3028,0x3160,
|
|
0x3297,0x33cd,0x3502,0x3636,0x3765,0x3893,0x39c0,0x3aee,0x3c18,0x3d42,0x3e6a,0x3f93,0x40b2,0x41bc,0x42bd,0x43bc,
|
|
0x44bb,0x45b9,0x46b5,0x47b0,0x48aa,0x49a2,0x4a99,0x4b8f,0x4c83,0x4d77,0x4e6b,0x4f5f,0x5055,0x514d,0x5242,0x533a,
|
|
0x5430,0x5526,0x561c,0x5712,0x5807,0x58fd,0x59f3,0x5ae8,0x5bde,0x5cd3,0x5dc6,0x5eb7,0x5fa7,0x6096,0x6185,0x6274,
|
|
0x6361,0x644e,0x653b,0x6627,0x6713,0x67fe,0x68ea,0x69d5,0x6ac0,0x6bab,0x6c92,0x6d7a,0x6e61,0x6f48,0x702e,0x7115,
|
|
0x71fb,0x72e1,0x73c6,0x74ab,0x7590,0x7675,0x7758,0x783d,0x7920,0x7a03,0x7ae7,0x7bcb,0x7cb1,0x7d98,0x7e81,0x7f6d,
|
|
0x805b,0x814c,0x823e,0x8334,0x842b,0x8524,0x861e,0x871b,0x881e,0x8923,0x8a28,0x8b2d,0x8c32,0x8d37,0x8e3c,0x8f40,
|
|
0x9045,0x914a,0x9250,0x9356,0x945b,0x9561,0x9669,0x977c,0x9890,0x99a3,0x9ab5,0x9bc5,0x9cd5,0x9de1,0x9eec,0x9ff6,
|
|
0xa0fe,0xa204,0xa30a,0xa40f,0xa513,0xa61c,0xa730,0xa84a,0xa962,0xaa79,0xab8e,0xaca3,0xadb5,0xaec5,0xafd2,0xb0df,
|
|
0xb1ea,0xb2f4,0xb3fc,0xb505,0xb610,0xb726,0xb840,0xb959,0xba72,0xbb8a,0xbca0,0xbdb4,0xbec7,0xbfd9,0xc0e9,0xc1f9,
|
|
0xc307,0xc415,0xc521,0xc634,0xc756,0xc87f,0xc9a8,0xcad2,0xcbfb,0xcd25,0xce4f,0xcf78,0xd0a0,0xd1c9,0xd2f1,0xd418,
|
|
0xd53f,0xd665,0xd789,0xd8a4,0xd9ba,0xdac9,0xdbd3,0xdcd7,0xddd6,0xded0,0xdfc6,0xe0bc,0xe1b0,0xe2a4,0xe39a,0xe492,
|
|
0xe58d,0xe689,0xe77e,0xe869,0xe952,0xea3e,0xeb2d,0xec1e,0xed10,0xee03,0xeef4,0xefe2,0xf0cb,0xf1ae,0xf28d,0xf365,
|
|
0xf43e,0xf51d,0xf5fd,0xf6b7,0xf75d,0xf7f9,0xf885,0xf912,0xf9a6,0xfa45,0xfaf0,0xfbbb,0xfc9e,0xfd9e,0xfebe,0xffff,
|
|
},{
|
|
0x0000,0x0056,0x0123,0x01b0,0x024c,0x02f0,0x0396,0x0440,0x04e3,0x0583,0x062d,0x06dd,0x0791,0x084a,0x0904,0x09bf,
|
|
0x0a7f,0x0b44,0x0c0d,0x0cd7,0x0da3,0x0e73,0x0f47,0x1021,0x10f6,0x11d1,0x12ae,0x138d,0x1471,0x1561,0x165c,0x1756,
|
|
0x1850,0x194c,0x1a45,0x1b41,0x1c3c,0x1d37,0x1e31,0x1f2c,0x2029,0x2123,0x2220,0x231d,0x2415,0x2512,0x260e,0x270a,
|
|
0x2803,0x28fe,0x29f8,0x2af3,0x2bed,0x2ce6,0x2de0,0x2ed9,0x2fce,0x30b6,0x3197,0x3279,0x335a,0x343b,0x351a,0x35f9,
|
|
0x36d8,0x37b5,0x3891,0x396c,0x3a45,0x3b1e,0x3bf3,0x3cc8,0x3d9c,0x3e6e,0x3f3f,0x400d,0x40db,0x41a8,0x4273,0x4340,
|
|
0x4408,0x44d1,0x4599,0x4662,0x4729,0x47ef,0x48b2,0x4973,0x4a34,0x4af4,0x4bb6,0x4c78,0x4d3a,0x4dfb,0x4ebd,0x4f80,
|
|
0x5042,0x5105,0x51c8,0x528b,0x534e,0x5411,0x54d4,0x5598,0x565c,0x571e,0x57e2,0x58a6,0x596a,0x5a2e,0x5af1,0x5bb5,
|
|
0x5c79,0x5d3c,0x5dfc,0x5ebd,0x5f7e,0x603f,0x60fe,0x61bf,0x627f,0x633f,0x63fe,0x64be,0x657e,0x663d,0x66fd,0x67bc,
|
|
0x687b,0x693b,0x69fa,0x6ab9,0x6b78,0x6c37,0x6cf7,0x6db6,0x6e76,0x6f36,0x6ff5,0x70b4,0x7175,0x7233,0x72ef,0x73aa,
|
|
0x7466,0x7522,0x75df,0x769d,0x775c,0x781b,0x78dc,0x799d,0x7a61,0x7b26,0x7bec,0x7cb4,0x7d7e,0x7e49,0x7f16,0x7fe5,
|
|
0x80b5,0x8187,0x8259,0x832d,0x8403,0x84d8,0x85af,0x8687,0x875f,0x8837,0x8914,0x89f8,0x8ade,0x8bc5,0x8cac,0x8d93,
|
|
0x8e7b,0x8f64,0x904d,0x9138,0x9225,0x9313,0x9404,0x94f7,0x95ec,0x96e5,0x97e0,0x98df,0x99e0,0x9ae5,0x9bed,0x9cf7,
|
|
0x9e05,0x9f14,0xa027,0xa13d,0xa255,0xa36e,0xa488,0xa599,0xa69b,0xa79d,0xa8a0,0xa9a6,0xaaae,0xabb8,0xacc5,0xadd4,
|
|
0xaee7,0xaffd,0xb116,0xb232,0xb353,0xb478,0xb5a0,0xb6cc,0xb7fd,0xb932,0xba69,0xbba4,0xbce3,0xbe25,0xbf69,0xc0af,
|
|
0xc1fa,0xc346,0xc494,0xc5e4,0xc741,0xc8aa,0xca25,0xcbae,0xcd44,0xcee8,0xd099,0xd258,0xd423,0xd5fa,0xd7df,0xd9ce,
|
|
0xdbca,0xddd3,0xdfe7,0xe207,0xe435,0xe66d,0xe8b2,0xeb03,0xed64,0xefd0,0xf24e,0xf4dc,0xf77e,0xfa36,0xfd07,0xffff,
|
|
#else
|
|
0x0000,0x0052,0x00a5,0x00f7,0x014a,0x0188,0x01c7,0x0205,0x0244,0x028a,0x02d1,0x0317,0x035e,0x03b1,0x0405,0x0459,
|
|
0x04ad,0x0507,0x0563,0x05be,0x0619,0x0663,0x06ab,0x06f4,0x073c,0x078e,0x07e0,0x0832,0x0884,0x08d4,0x0923,0x0973,
|
|
0x09c3,0x0a11,0x0a60,0x0aae,0x0afc,0x0b4f,0x0ba2,0x0bf5,0x0c48,0x0c97,0x0ce6,0x0d35,0x0d83,0x0dd6,0x0e29,0x0e7c,
|
|
0x0ecf,0x0f21,0x0f73,0x0fc5,0x1017,0x106d,0x10c3,0x111a,0x1170,0x11c3,0x1215,0x1268,0x12ba,0x130d,0x1361,0x13b5,
|
|
0x1409,0x145f,0x14b7,0x150e,0x1565,0x15bb,0x1610,0x1666,0x16bb,0x1712,0x176a,0x17c1,0x1818,0x186e,0x18c4,0x191a,
|
|
0x196f,0x19c5,0x1a1a,0x1a70,0x1ac5,0x1b1d,0x1b75,0x1bcd,0x1c26,0x1c7e,0x1cd6,0x1d2e,0x1d86,0x1ddd,0x1e35,0x1e8c,
|
|
0x1ee4,0x1f3b,0x1f93,0x1fea,0x2042,0x209b,0x20f5,0x214f,0x21a9,0x2201,0x2258,0x22af,0x2306,0x235f,0x23b8,0x2412,
|
|
0x246b,0x24c5,0x251e,0x2577,0x25d1,0x262a,0x2682,0x26da,0x2732,0x278b,0x27e4,0x283e,0x2897,0x28f0,0x2949,0x29a3,
|
|
0x29fc,0x2a55,0x2aae,0x2b06,0x2b5f,0x2bb7,0x2c0f,0x2c67,0x2cbf,0x2d18,0x2d71,0x2dca,0x2e23,0x2e7c,0x2ed4,0x2f2d,
|
|
0x2f86,0x2fde,0x3035,0x308c,0x30e4,0x313b,0x3194,0x31ec,0x3244,0x329c,0x32f5,0x334d,0x33a5,0x33fd,0x3454,0x34ab,
|
|
0x3502,0x3559,0x35b1,0x3609,0x3661,0x36b7,0x370c,0x3761,0x37b6,0x3804,0x384d,0x3896,0x38df,0x3927,0x396e,0x39b5,
|
|
0x39fc,0x3a42,0x3a88,0x3ace,0x3b14,0x3b5a,0x3ba0,0x3be6,0x3c2c,0x3c73,0x3cb9,0x3cff,0x3d45,0x3d8b,0x3dd1,0x3e18,
|
|
0x3e5e,0x3ea4,0x3eea,0x3f30,0x3f76,0x3fbc,0x4002,0x4048,0x408d,0x40d3,0x411a,0x4160,0x41a6,0x41ec,0x4232,0x4277,
|
|
0x42bd,0x4303,0x4348,0x438e,0x43d3,0x4419,0x445e,0x44a4,0x44e9,0x452f,0x4575,0x45bb,0x4600,0x4646,0x468b,0x46d1,
|
|
0x4716,0x475b,0x47a0,0x47e5,0x482a,0x486f,0x48b4,0x48f8,0x493d,0x4981,0x49c6,0x4a0a,0x4a4f,0x4a94,0x4ad9,0x4b1e,
|
|
0x4b63,0x4ba8,0x4bec,0x4c31,0x4c75,0x4cba,0x4cfe,0x4d42,0x4d87,0x4dcb,0x4e10,0x4e54,0x4e99,0x4edd,0x4f21,0x4f65,
|
|
0x4fa9,0x4fed,0x5032,0x5076,0x50ba,0x50fe,0x5142,0x5186,0x51ca,0x520e,0x5251,0x5295,0x52d8,0x531c,0x535f,0x53a3,
|
|
0x53e6,0x542a,0x546e,0x54b1,0x54f5,0x5538,0x557c,0x55bf,0x5603,0x5646,0x5689,0x56cc,0x570f,0x5753,0x5796,0x57d9,
|
|
0x581c,0x5860,0x58a3,0x58e5,0x5928,0x596b,0x59ae,0x59f1,0x5a34,0x5a77,0x5aba,0x5afd,0x5b40,0x5b82,0x5bc5,0x5c08,
|
|
0x5c4b,0x5c8e,0x5cd0,0x5d13,0x5d55,0x5d98,0x5dda,0x5e1d,0x5e5f,0x5ea2,0x5ee5,0x5f27,0x5f6a,0x5fac,0x5fee,0x6031,
|
|
0x6073,0x60b5,0x60f8,0x613b,0x617d,0x61c0,0x6202,0x6244,0x6286,0x62c8,0x630a,0x634c,0x638f,0x63d1,0x6414,0x6456,
|
|
0x6499,0x64db,0x651c,0x655d,0x659e,0x65df,0x661d,0x665c,0x669a,0x66d9,0x6716,0x6753,0x6790,0x67cd,0x680a,0x6847,
|
|
0x6884,0x68c0,0x68fd,0x693a,0x6978,0x69b5,0x69f2,0x6a30,0x6a6d,0x6aab,0x6ae8,0x6b26,0x6b64,0x6ba1,0x6bdf,0x6c1c,
|
|
0x6c5a,0x6c97,0x6cd5,0x6d12,0x6d4f,0x6d8d,0x6dca,0x6e08,0x6e45,0x6e83,0x6ec1,0x6eff,0x6f3d,0x6f7b,0x6fb9,0x6ff6,
|
|
0x7034,0x7072,0x70af,0x70ed,0x712b,0x7169,0x71a7,0x71e5,0x7223,0x7261,0x729f,0x72de,0x731d,0x735b,0x739a,0x73d8,
|
|
0x7416,0x7455,0x7493,0x74d2,0x7511,0x7550,0x758e,0x75cd,0x760c,0x764b,0x768a,0x76c9,0x7708,0x7747,0x7786,0x77c6,
|
|
0x7805,0x7844,0x7884,0x78c3,0x7902,0x7942,0x7981,0x79c1,0x7a01,0x7a41,0x7a81,0x7ac1,0x7b01,0x7b41,0x7b81,0x7bc1,
|
|
0x7c01,0x7c41,0x7c82,0x7cc2,0x7d03,0x7d43,0x7d84,0x7dc4,0x7e05,0x7e46,0x7e86,0x7ec7,0x7f09,0x7f4a,0x7f8b,0x7fcc,
|
|
0x800d,0x804f,0x8090,0x80d2,0x8113,0x8155,0x8197,0x81d8,0x821a,0x825c,0x829e,0x82e0,0x8321,0x8363,0x83a5,0x83e8,
|
|
0x842a,0x846c,0x84ae,0x84f0,0x8532,0x8574,0x85b6,0x85f9,0x863c,0x867f,0x86c1,0x8704,0x8746,0x8789,0x87cc,0x880e,
|
|
0x8851,0x8894,0x88d7,0x891a,0x895d,0x89a0,0x89e3,0x8a27,0x8a6a,0x8aad,0x8af1,0x8b34,0x8b78,0x8bbb,0x8bff,0x8c42,
|
|
0x8c85,0x8cc8,0x8d0b,0x8d4f,0x8d92,0x8dd6,0x8e19,0x8e5d,0x8ea1,0x8ee5,0x8f29,0x8f6c,0x8fb0,0x8ff4,0x9038,0x907b,
|
|
0x90bf,0x9102,0x9146,0x918a,0x91ce,0x9211,0x9255,0x9299,0x92dd,0x9321,0x9364,0x93a7,0x93eb,0x942e,0x9471,0x94b5,
|
|
0x94f9,0x953c,0x9580,0x95c3,0x9606,0x9649,0x968d,0x96d0,0x9713,0x9757,0x979a,0x97dd,0x9821,0x9864,0x98a7,0x98eb,
|
|
0x992e,0x9971,0x99b4,0x99f7,0x9a3a,0x9a7d,0x9ac0,0x9b03,0x9b46,0x9b89,0x9bcc,0x9c0e,0x9c51,0x9c94,0x9cd7,0x9d1a,
|
|
0x9d5c,0x9d9f,0x9de2,0x9e25,0x9e67,0x9eaa,0x9eec,0x9f2e,0x9f71,0x9fb3,0x9ff5,0xa038,0xa07b,0xa0bd,0xa0ff,0xa141,
|
|
0xa183,0xa1c5,0xa207,0xa249,0xa28b,0xa2ce,0xa310,0xa352,0xa393,0xa3d5,0xa417,0xa459,0xa49b,0xa4dd,0xa51e,0xa560,
|
|
0xa5a1,0xa5e3,0xa624,0xa666,0xa6a8,0xa6e9,0xa72b,0xa76c,0xa7ad,0xa7ef,0xa830,0xa871,0xa8b2,0xa8f3,0xa934,0xa975,
|
|
0xa9b6,0xa9f7,0xaa38,0xaa79,0xaaba,0xaafb,0xab3b,0xab7c,0xabbd,0xabfe,0xac3f,0xac7f,0xacc0,0xad00,0xad41,0xad81,
|
|
0xadc1,0xae02,0xae42,0xae82,0xaec3,0xaf03,0xaf43,0xaf84,0xafc4,0xb004,0xb045,0xb085,0xb0c5,0xb105,0xb145,0xb185,
|
|
0xb1c5,0xb205,0xb245,0xb285,0xb2c5,0xb304,0xb344,0xb384,0xb3c4,0xb404,0xb444,0xb484,0xb4c4,0xb503,0xb543,0xb582,
|
|
0xb5c2,0xb601,0xb641,0xb681,0xb6c0,0xb700,0xb73f,0xb77f,0xb7be,0xb7fe,0xb83d,0xb87d,0xb8bc,0xb8fb,0xb93b,0xb97a,
|
|
0xb9b9,0xb9f9,0xba38,0xba78,0xbab7,0xbaf7,0xbb36,0xbb76,0xbbb6,0xbbf6,0xbc36,0xbc77,0xbcb8,0xbcf9,0xbd3a,0xbd7b,
|
|
0xbdbd,0xbdfe,0xbe40,0xbe82,0xbec3,0xbf05,0xbf46,0xbf88,0xbfc9,0xc00a,0xc04b,0xc08d,0xc0cf,0xc111,0xc153,0xc194,
|
|
0xc1d6,0xc218,0xc25a,0xc29b,0xc2dd,0xc31f,0xc360,0xc3a2,0xc3e3,0xc425,0xc466,0xc4a8,0xc4e9,0xc52a,0xc56c,0xc5ad,
|
|
0xc5ef,0xc630,0xc672,0xc6b3,0xc6f4,0xc735,0xc776,0xc7b7,0xc7f8,0xc839,0xc87a,0xc8bb,0xc8fc,0xc93d,0xc97f,0xc9c0,
|
|
0xca01,0xca42,0xca83,0xcac3,0xcb04,0xcb45,0xcb85,0xcbc5,0xcc06,0xcc46,0xcc86,0xccc7,0xcd07,0xcd47,0xcd88,0xcdc8,
|
|
0xce07,0xce47,0xce87,0xcec7,0xcf06,0xcf46,0xcf85,0xcfc5,0xd004,0xd043,0xd083,0xd0c2,0xd100,0xd13f,0xd17e,0xd1bd,
|
|
0xd1fb,0xd23a,0xd278,0xd2b7,0xd2f5,0xd333,0xd372,0xd3b0,0xd3ed,0xd42b,0xd469,0xd4a7,0xd4e4,0xd521,0xd55e,0xd59c,
|
|
0xd5d9,0xd616,0xd653,0xd690,0xd6cc,0xd709,0xd745,0xd782,0xd7be,0xd7fa,0xd837,0xd873,0xd8ae,0xd8ea,0xd926,0xd962,
|
|
0xd99d,0xd9d9,0xda14,0xda50,0xda8b,0xdac7,0xdb02,0xdb3d,0xdb77,0xdbb2,0xdbec,0xdc27,0xdc62,0xdc9c,0xdcd7,0xdd11,
|
|
0xdd4b,0xdd85,0xddbe,0xddf8,0xde32,0xde6b,0xdea5,0xdede,0xdf18,0xdf52,0xdf8b,0xdfc4,0xdffd,0xe037,0xe070,0xe0a9,
|
|
0xe0e2,0xe11b,0xe154,0xe18d,0xe1c5,0xe1fe,0xe237,0xe26f,0xe2a7,0xe2df,0xe317,0xe34f,0xe388,0xe3c0,0xe3f8,0xe430,
|
|
0xe468,0xe49f,0xe4d7,0xe50b,0xe53c,0xe56c,0xe59d,0xe5ce,0xe5fe,0xe62f,0xe65f,0xe690,0xe6c1,0xe6f1,0xe722,0xe752,
|
|
0xe783,0xe7b3,0xe7e3,0xe814,0xe844,0xe874,0xe8a5,0xe8d5,0xe905,0xe935,0xe965,0xe995,0xe9c6,0xe9f6,0xea26,0xea56,
|
|
0xea86,0xeab5,0xeae5,0xeb15,0xeb45,0xeb75,0xeba5,0xebd4,0xec04,0xec33,0xec63,0xec92,0xecc1,0xecf0,0xed1f,0xed4e,
|
|
0xed7d,0xedac,0xeddb,0xee0a,0xee38,0xee67,0xee95,0xeec4,0xeef2,0xef1f,0xef4d,0xef7b,0xefa9,0xefd7,0xf005,0xf032,
|
|
0xf060,0xf08d,0xf0bb,0xf0e8,0xf114,0xf140,0xf16d,0xf199,0xf1c5,0xf1f1,0xf21d,0xf249,0xf275,0xf2a1,0xf2cd,0xf2f9,
|
|
0xf323,0xf34e,0xf378,0xf3a3,0xf3cd,0xf3f7,0xf421,0xf44b,0xf475,0xf49f,0xf4c9,0xf4f3,0xf51b,0xf544,0xf56c,0xf595,
|
|
0xf5bd,0xf5e5,0xf60d,0xf635,0xf65d,0xf684,0xf6ab,0xf6d3,0xf6f9,0xf71f,0xf746,0xf76c,0xf792,0xf7b8,0xf7df,0xf804,
|
|
0xf829,0xf84e,0xf872,0xf897,0xf8bb,0xf8e0,0xf904,0xf928,0xf94c,0xf96f,0xf993,0xf9b6,0xf9d8,0xf9fb,0xfa1e,0xfa40,
|
|
0xfa62,0xfa85,0xfaa7,0xfac9,0xfaea,0xfb0c,0xfb2d,0xfb4e,0xfb6f,0xfb90,0xfbb0,0xfbd1,0xfbf1,0xfc11,0xfc31,0xfc50,
|
|
0xfc70,0xfc8f,0xfcaf,0xfcce,0xfced,0xfd0b,0xfd2a,0xfd49,0xfd67,0xfd85,0xfda3,0xfdc1,0xfddf,0xfdfd,0xfe1a,0xfe38,
|
|
0xfe55,0xfe72,0xfe8f,0xfeac,0xfec8,0xfee5,0xff02,0xff1f,0xff3b,0xff57,0xff73,0xff8f,0xffab,0xffc7,0xffe3,0xffff,
|
|
},{
|
|
0x0000,0x0052,0x00a5,0x00f7,0x014a,0x0188,0x01c7,0x0205,0x0244,0x028a,0x02d1,0x0317,0x035e,0x03b1,0x0405,0x0459,
|
|
0x04ad,0x0507,0x0563,0x05be,0x0619,0x0663,0x06ab,0x06f4,0x073c,0x078e,0x07e0,0x0832,0x0884,0x08d4,0x0923,0x0973,
|
|
0x09c3,0x0a11,0x0a60,0x0aae,0x0afc,0x0b51,0x0ba6,0x0bfb,0x0c50,0x0ca0,0x0cf0,0x0d3f,0x0d8f,0x0de4,0x0e39,0x0e8e,
|
|
0x0ee3,0x0f35,0x0f86,0x0fd8,0x1029,0x107b,0x10cd,0x111f,0x1171,0x11c6,0x121b,0x1271,0x12c6,0x131b,0x1370,0x13c4,
|
|
0x1419,0x146d,0x14c2,0x1517,0x156c,0x15c1,0x1616,0x166b,0x16c0,0x1715,0x176c,0x17c2,0x1818,0x186f,0x18c6,0x191d,
|
|
0x1974,0x19cb,0x1a22,0x1a7a,0x1ad1,0x1b29,0x1b80,0x1bd8,0x1c30,0x1c87,0x1cde,0x1d35,0x1d8c,0x1de4,0x1e3d,0x1e96,
|
|
0x1eee,0x1f46,0x1f9e,0x1ff5,0x204d,0x20a5,0x20fd,0x2155,0x21ad,0x2205,0x225d,0x22b6,0x230e,0x2367,0x23bf,0x2418,
|
|
0x2470,0x24ca,0x2524,0x257e,0x25d8,0x2631,0x2689,0x26e1,0x2739,0x2792,0x27ea,0x2843,0x289b,0x28f4,0x294c,0x29a4,
|
|
0x29fc,0x2a55,0x2aae,0x2b06,0x2b5f,0x2bb7,0x2c0f,0x2c67,0x2cbf,0x2d17,0x2d6e,0x2dc6,0x2e1d,0x2e76,0x2ece,0x2f27,
|
|
0x2f7f,0x2fd7,0x302e,0x3086,0x30dd,0x3135,0x318d,0x31e5,0x323d,0x3295,0x32ec,0x3343,0x339a,0x33f1,0x3448,0x349f,
|
|
0x34f6,0x354d,0x35a3,0x35fa,0x3650,0x36a5,0x36f8,0x374c,0x379f,0x37ec,0x3833,0x387b,0x38c2,0x3907,0x394a,0x398d,
|
|
0x39d0,0x3a13,0x3a56,0x3a99,0x3adc,0x3b1f,0x3b62,0x3ba5,0x3be7,0x3c2a,0x3c6d,0x3caf,0x3cf2,0x3d34,0x3d78,0x3dbb,
|
|
0x3dfe,0x3e40,0x3e82,0x3ec4,0x3f06,0x3f49,0x3f8c,0x3fce,0x4011,0x4054,0x4096,0x40d9,0x411c,0x415e,0x41a0,0x41e3,
|
|
0x4225,0x4267,0x42a9,0x42ea,0x432c,0x436d,0x43af,0x43f1,0x4434,0x4476,0x44b8,0x44fb,0x453d,0x4580,0x45c1,0x4603,
|
|
0x4644,0x4686,0x46c7,0x4708,0x474a,0x478b,0x47cd,0x480e,0x4850,0x4891,0x48d3,0x4914,0x4956,0x4997,0x49d9,0x4a1a,
|
|
0x4a5b,0x4a9d,0x4add,0x4b1e,0x4b5f,0x4ba0,0x4be1,0x4c23,0x4c64,0x4ca5,0x4ce6,0x4d26,0x4d67,0x4da7,0x4de8,0x4e29,
|
|
0x4e6a,0x4eaa,0x4eeb,0x4f2c,0x4f6c,0x4fad,0x4fed,0x502e,0x506e,0x50af,0x50ef,0x512f,0x5170,0x51b0,0x51f0,0x5231,
|
|
0x5271,0x52b1,0x52f1,0x5331,0x5371,0x53b1,0x53f1,0x5431,0x5471,0x54b1,0x54f1,0x5531,0x5571,0x55b1,0x55f1,0x5630,
|
|
0x5670,0x56af,0x56ef,0x572f,0x576f,0x57af,0x57ee,0x582e,0x586e,0x58ae,0x58ee,0x592d,0x596d,0x59ad,0x59ed,0x5a2c,
|
|
0x5a6c,0x5aab,0x5aeb,0x5b2a,0x5b6a,0x5ba9,0x5be9,0x5c29,0x5c68,0x5ca8,0x5ce7,0x5d26,0x5d66,0x5da5,0x5de4,0x5e24,
|
|
0x5e63,0x5ea2,0x5ee2,0x5f21,0x5f60,0x5f9f,0x5fdf,0x601e,0x605d,0x609d,0x60dc,0x611c,0x615b,0x619b,0x61db,0x621a,
|
|
0x625a,0x6299,0x62d8,0x6317,0x6356,0x6396,0x63d4,0x6412,0x6450,0x648e,0x64cc,0x6509,0x6547,0x6585,0x65c3,0x6601,
|
|
0x663f,0x667c,0x66ba,0x66f7,0x6735,0x6773,0x67b1,0x67ef,0x682e,0x686c,0x68aa,0x68e8,0x6927,0x6965,0x69a3,0x69e1,
|
|
0x6a1f,0x6a5c,0x6a9a,0x6ad9,0x6b17,0x6b55,0x6b93,0x6bd1,0x6c10,0x6c4e,0x6c8c,0x6cca,0x6d08,0x6d46,0x6d84,0x6dc2,
|
|
0x6e00,0x6e3e,0x6e7d,0x6ebc,0x6efa,0x6f39,0x6f77,0x6fb6,0x6ff4,0x7033,0x7071,0x70b0,0x70ef,0x712d,0x716c,0x71aa,
|
|
0x71e9,0x7227,0x7266,0x72a5,0x72e4,0x7323,0x7361,0x73a0,0x73de,0x741d,0x745c,0x749b,0x74d9,0x7518,0x7557,0x7596,
|
|
0x75d5,0x7614,0x7653,0x7693,0x76d2,0x7711,0x7750,0x778e,0x77cd,0x780c,0x784b,0x788a,0x78ca,0x7909,0x7948,0x7987,
|
|
0x79c6,0x7a05,0x7a45,0x7a84,0x7ac4,0x7b04,0x7b43,0x7b82,0x7bc2,0x7c01,0x7c40,0x7c80,0x7cbf,0x7cff,0x7d3f,0x7d7e,
|
|
0x7dbe,0x7dfd,0x7e3d,0x7e7c,0x7ebc,0x7efc,0x7f3b,0x7f7b,0x7fbb,0x7ffb,0x803b,0x807a,0x80ba,0x80fa,0x813a,0x817a,
|
|
0x81ba,0x81fa,0x823a,0x827a,0x82ba,0x82f9,0x8339,0x8379,0x83b9,0x83f9,0x8439,0x8479,0x84b9,0x84f9,0x8539,0x8579,
|
|
0x85b9,0x85f9,0x8639,0x8679,0x86b9,0x86f8,0x8739,0x8779,0x87b9,0x87fa,0x883a,0x887a,0x88ba,0x88fb,0x893b,0x897b,
|
|
0x89ba,0x89fa,0x8a3a,0x8a7a,0x8aba,0x8afa,0x8b3b,0x8b7b,0x8bbb,0x8bfb,0x8c3c,0x8c7d,0x8cbe,0x8cff,0x8d41,0x8d83,
|
|
0x8dc5,0x8e07,0x8e4a,0x8e8c,0x8ecf,0x8f12,0x8f55,0x8f98,0x8fdb,0x901e,0x9061,0x90a4,0x90e7,0x9129,0x916c,0x91af,
|
|
0x91f2,0x9235,0x9278,0x92bc,0x92ff,0x9342,0x9385,0x93c8,0x940b,0x944e,0x9491,0x94d4,0x9517,0x955a,0x959d,0x95e0,
|
|
0x9623,0x9666,0x96a9,0x96ed,0x9730,0x9773,0x97b7,0x97fa,0x983d,0x9880,0x98c3,0x9906,0x9949,0x998d,0x99d0,0x9a14,
|
|
0x9a57,0x9a9b,0x9ade,0x9b22,0x9b65,0x9ba8,0x9beb,0x9c2f,0x9c72,0x9cb5,0x9cf9,0x9d3d,0x9d80,0x9dc4,0x9e08,0x9e4c,
|
|
0x9e8f,0x9ed3,0x9f16,0x9f5a,0x9f9e,0x9fe2,0xa025,0xa069,0xa0ad,0xa0f1,0xa135,0xa178,0xa1bc,0xa200,0xa244,0xa288,
|
|
0xa2cc,0xa310,0xa354,0xa398,0xa3dc,0xa420,0xa464,0xa4a8,0xa4ec,0xa530,0xa575,0xa5b9,0xa5fd,0xa641,0xa686,0xa6ca,
|
|
0xa70e,0xa753,0xa797,0xa7dc,0xa821,0xa865,0xa8aa,0xa8ee,0xa932,0xa976,0xa9ba,0xa9ff,0xaa44,0xaa88,0xaacd,0xab11,
|
|
0xab56,0xab9a,0xabdf,0xac24,0xac68,0xacad,0xacf2,0xad37,0xad7c,0xadc1,0xae06,0xae4b,0xae90,0xaed5,0xaf19,0xaf5e,
|
|
0xafa3,0xafe8,0xb02d,0xb072,0xb0b7,0xb0fc,0xb141,0xb186,0xb1cb,0xb211,0xb256,0xb29b,0xb2e0,0xb325,0xb36a,0xb3af,
|
|
0xb3f4,0xb439,0xb47e,0xb4c3,0xb508,0xb54e,0xb593,0xb5d8,0xb61e,0xb663,0xb6a9,0xb6ee,0xb732,0xb777,0xb7bc,0xb802,
|
|
0xb848,0xb88d,0xb8d3,0xb918,0xb95e,0xb9a3,0xb9e8,0xba2d,0xba72,0xbab7,0xbafc,0xbb3e,0xbb81,0xbbc3,0xbc06,0xbc48,
|
|
0xbc8a,0xbccc,0xbd0e,0xbd50,0xbd92,0xbdd3,0xbe15,0xbe57,0xbe99,0xbedb,0xbf1c,0xbf5f,0xbfa1,0xbfe3,0xc026,0xc068,
|
|
0xc0aa,0xc0ed,0xc12f,0xc171,0xc1b3,0xc1f6,0xc238,0xc27a,0xc2bc,0xc2fe,0xc340,0xc383,0xc3c5,0xc407,0xc449,0xc48c,
|
|
0xc4ce,0xc510,0xc552,0xc594,0xc5d6,0xc619,0xc65b,0xc69d,0xc6e0,0xc722,0xc764,0xc7a6,0xc7e9,0xc82b,0xc86d,0xc8b0,
|
|
0xc8f2,0xc935,0xc978,0xc9ba,0xc9fc,0xca3e,0xca81,0xcac3,0xcb05,0xcb48,0xcb8a,0xcbcc,0xcc0f,0xcc51,0xcc93,0xccd5,
|
|
0xcd17,0xcd59,0xcd9c,0xcdde,0xce20,0xce62,0xcea5,0xcee7,0xcf29,0xcf6b,0xcfad,0xcfef,0xd031,0xd073,0xd0b5,0xd0f7,
|
|
0xd139,0xd17b,0xd1bd,0xd1ff,0xd241,0xd283,0xd2c5,0xd307,0xd349,0xd38b,0xd3cd,0xd40f,0xd450,0xd492,0xd4d3,0xd515,
|
|
0xd556,0xd598,0xd5d9,0xd61b,0xd65c,0xd69d,0xd6df,0xd720,0xd762,0xd7a3,0xd7e5,0xd826,0xd868,0xd8aa,0xd8eb,0xd92c,
|
|
0xd96d,0xd9ae,0xd9f0,0xda31,0xda72,0xdab3,0xdaf4,0xdb35,0xdb75,0xdbb6,0xdbf7,0xdc38,0xdc79,0xdcba,0xdcfa,0xdd3b,
|
|
0xdd7c,0xddbc,0xddfd,0xde3d,0xde7e,0xdebe,0xdeff,0xdf3f,0xdf80,0xdfc0,0xe000,0xe041,0xe081,0xe0c2,0xe102,0xe143,
|
|
0xe184,0xe1c4,0xe205,0xe245,0xe285,0xe2c5,0xe305,0xe345,0xe385,0xe3c5,0xe404,0xe444,0xe484,0xe4c5,0xe505,0xe544,
|
|
0xe582,0xe5c0,0xe5ff,0xe63a,0xe672,0xe6aa,0xe6e2,0xe719,0xe750,0xe787,0xe7bd,0xe7f4,0xe82a,0xe860,0xe896,0xe8cc,
|
|
0xe901,0xe937,0xe96d,0xe9a2,0xe9d8,0xea0d,0xea43,0xea78,0xeaad,0xeae2,0xeb17,0xeb4b,0xeb80,0xebb5,0xebe9,0xec1e,
|
|
0xec52,0xec86,0xecba,0xecee,0xed21,0xed55,0xed89,0xedbc,0xedef,0xee22,0xee54,0xee87,0xeeb9,0xeeec,0xef1e,0xef50,
|
|
0xef82,0xefb3,0xefe5,0xf016,0xf047,0xf078,0xf0a9,0xf0d9,0xf109,0xf139,0xf168,0xf198,0xf1c7,0xf1f6,0xf225,0xf254,
|
|
0xf282,0xf2b1,0xf2df,0xf30d,0xf339,0xf366,0xf393,0xf3bf,0xf3eb,0xf417,0xf443,0xf46e,0xf499,0xf4c4,0xf4f0,0xf51a,
|
|
0xf544,0xf56e,0xf598,0xf5c1,0xf5ea,0xf612,0xf63b,0xf663,0xf68b,0xf6b3,0xf6da,0xf702,0xf727,0xf74d,0xf773,0xf798,
|
|
0xf7bd,0xf7e3,0xf808,0xf82c,0xf850,0xf874,0xf897,0xf8bb,0xf8dd,0xf900,0xf923,0xf945,0xf967,0xf988,0xf9a9,0xf9cb,
|
|
0xf9ea,0xfa0a,0xfa2a,0xfa4a,0xfa69,0xfa88,0xfaa7,0xfac5,0xfae3,0xfb01,0xfb1f,0xfb3d,0xfb5a,0xfb76,0xfb93,0xfbaf,
|
|
0xfbcb,0xfbe7,0xfc03,0xfc1f,0xfc39,0xfc53,0xfc6d,0xfc88,0xfca2,0xfcbc,0xfcd7,0xfcf1,0xfd09,0xfd21,0xfd3a,0xfd52,
|
|
0xfd6a,0xfd82,0xfd9a,0xfdb1,0xfdc9,0xfde1,0xfdf8,0xfe10,0xfe25,0xfe3b,0xfe50,0xfe66,0xfe7b,0xfe91,0xfea7,0xfebd,
|
|
0xfed2,0xfee7,0xfefd,0xff12,0xff26,0xff39,0xff4d,0xff60,0xff74,0xff88,0xff9c,0xffb0,0xffc3,0xffd7,0xffeb,0xffff,
|
|
},{
|
|
0x0000,0x0049,0x0092,0x00db,0x0124,0x014b,0x0173,0x019a,0x01c2,0x01f6,0x022a,0x025f,0x0294,0x02cf,0x030b,0x0346,
|
|
0x0382,0x03c1,0x0400,0x043f,0x047f,0x04bc,0x04f9,0x0536,0x0573,0x05af,0x05eb,0x0627,0x0663,0x069f,0x06dc,0x0718,
|
|
0x0755,0x0790,0x07cc,0x0808,0x0843,0x0880,0x08bd,0x08fa,0x0937,0x0973,0x09af,0x09eb,0x0a27,0x0a65,0x0aa3,0x0ae1,
|
|
0x0b20,0x0b5f,0x0b9f,0x0bdf,0x0c1f,0x0c5d,0x0c9c,0x0cda,0x0d18,0x0d58,0x0d98,0x0dd7,0x0e17,0x0e56,0x0e95,0x0ed4,
|
|
0x0f13,0x0f53,0x0f93,0x0fd3,0x1014,0x1055,0x1097,0x10d8,0x111a,0x115a,0x119b,0x11dc,0x121c,0x125d,0x129f,0x12e1,
|
|
0x1322,0x1363,0x13a4,0x13e5,0x1425,0x1467,0x14aa,0x14ec,0x152e,0x1571,0x15b4,0x15f7,0x1639,0x167c,0x16be,0x1700,
|
|
0x1743,0x1786,0x17c9,0x180c,0x184f,0x1891,0x18d4,0x1917,0x1959,0x199c,0x19e0,0x1a23,0x1a67,0x1aab,0x1aef,0x1b33,
|
|
0x1b77,0x1bba,0x1bfe,0x1c41,0x1c84,0x1cc7,0x1d0a,0x1d4d,0x1d90,0x1dd3,0x1e16,0x1e5a,0x1e9d,0x1ee0,0x1f24,0x1f68,
|
|
0x1fab,0x1fef,0x2032,0x2076,0x20b9,0x20fd,0x2141,0x2185,0x21c8,0x220b,0x224e,0x2291,0x22d3,0x2316,0x2359,0x239c,
|
|
0x23df,0x2422,0x2466,0x24aa,0x24ed,0x2531,0x2574,0x25b8,0x25fb,0x263e,0x2680,0x26c2,0x2703,0x2746,0x2788,0x27cb,
|
|
0x280e,0x2851,0x2894,0x28d8,0x291b,0x295d,0x299f,0x29e0,0x2a21,0x2a5c,0x2a91,0x2ac6,0x2afb,0x2b2f,0x2b63,0x2b97,
|
|
0x2bcb,0x2bfe,0x2c32,0x2c65,0x2c98,0x2ccc,0x2cff,0x2d33,0x2d67,0x2d9a,0x2dce,0x2e02,0x2e36,0x2e6a,0x2e9e,0x2ed1,
|
|
0x2f05,0x2f39,0x2f6c,0x2f9f,0x2fd2,0x3005,0x3038,0x306b,0x309e,0x30d2,0x3105,0x3139,0x316d,0x31a0,0x31d3,0x3207,
|
|
0x323a,0x326d,0x32a0,0x32d3,0x3306,0x3339,0x336b,0x339e,0x33d0,0x3403,0x3436,0x3469,0x349c,0x34d0,0x3503,0x3536,
|
|
0x3569,0x359c,0x35ce,0x3600,0x3633,0x3665,0x3698,0x36ca,0x36fd,0x372f,0x3762,0x3794,0x37c6,0x37f8,0x382a,0x385d,
|
|
0x388f,0x38c1,0x38f3,0x3925,0x3958,0x398a,0x39bc,0x39ee,0x3a20,0x3a52,0x3a84,0x3ab5,0x3ae7,0x3b18,0x3b4a,0x3b7c,
|
|
0x3bad,0x3bdf,0x3c10,0x3c41,0x3c73,0x3ca4,0x3cd6,0x3d08,0x3d3a,0x3d6c,0x3d9d,0x3dce,0x3e00,0x3e31,0x3e62,0x3e93,
|
|
0x3ec4,0x3ef5,0x3f26,0x3f58,0x3f89,0x3fba,0x3feb,0x401b,0x404c,0x407d,0x40ae,0x40df,0x4110,0x4141,0x4171,0x41a2,
|
|
0x41d2,0x4203,0x4234,0x4265,0x4296,0x42c6,0x42f7,0x4327,0x4357,0x4388,0x43b8,0x43e8,0x4419,0x4449,0x447a,0x44aa,
|
|
0x44db,0x450c,0x453c,0x456d,0x459d,0x45ce,0x45fe,0x462e,0x465e,0x468e,0x46bf,0x46ef,0x471f,0x474f,0x477f,0x47af,
|
|
0x47df,0x480f,0x483f,0x4870,0x48a0,0x48d0,0x4900,0x4930,0x4960,0x4990,0x49c0,0x49f0,0x4a21,0x4a51,0x4a81,0x4ab1,
|
|
0x4ae1,0x4b11,0x4b41,0x4b71,0x4ba1,0x4bd2,0x4c02,0x4c33,0x4c63,0x4c94,0x4cc5,0x4cf6,0x4d27,0x4d58,0x4d89,0x4dba,
|
|
0x4dea,0x4e1b,0x4e4b,0x4e7c,0x4ead,0x4edd,0x4f0e,0x4f3f,0x4f71,0x4fa2,0x4fd3,0x5004,0x5035,0x5066,0x5097,0x50c7,
|
|
0x50f8,0x5128,0x5159,0x518a,0x51bb,0x51ec,0x521d,0x524e,0x527e,0x52af,0x52e0,0x5311,0x5342,0x5373,0x53a3,0x53d4,
|
|
0x5405,0x5435,0x5466,0x5497,0x54c8,0x54f9,0x5529,0x555a,0x558b,0x55bc,0x55ed,0x561e,0x564f,0x567f,0x56b0,0x56e1,
|
|
0x5712,0x5743,0x5774,0x57a4,0x57d5,0x5805,0x5836,0x5867,0x5898,0x58c9,0x58f9,0x592a,0x595b,0x598b,0x59bc,0x59ed,
|
|
0x5a1e,0x5a4f,0x5a7f,0x5ab0,0x5ae0,0x5b11,0x5b42,0x5b72,0x5ba3,0x5bd3,0x5c04,0x5c34,0x5c65,0x5c95,0x5cc6,0x5cf6,
|
|
0x5d27,0x5d57,0x5d88,0x5db9,0x5de9,0x5e1a,0x5e4a,0x5e7b,0x5eac,0x5edc,0x5f0d,0x5f3d,0x5f6d,0x5f9e,0x5fce,0x5ffe,
|
|
0x602f,0x605f,0x608f,0x60c0,0x60f0,0x6121,0x6151,0x6181,0x61b2,0x61e2,0x6212,0x6243,0x6273,0x62a3,0x62d4,0x6304,
|
|
0x6335,0x6365,0x6395,0x63c5,0x63f5,0x6425,0x6455,0x6486,0x64b6,0x64e6,0x6516,0x6546,0x6576,0x65a6,0x65d6,0x6606,
|
|
0x6637,0x6667,0x6697,0x66c7,0x66f6,0x6726,0x6756,0x6786,0x67b6,0x67e7,0x6817,0x6847,0x6878,0x68a8,0x68d8,0x6908,
|
|
0x6938,0x6968,0x6997,0x69c7,0x69f7,0x6a27,0x6a57,0x6a87,0x6ab7,0x6ae6,0x6b17,0x6b47,0x6b77,0x6ba8,0x6bd8,0x6c08,
|
|
0x6c39,0x6c69,0x6c9a,0x6ccb,0x6cfc,0x6d2d,0x6d5e,0x6d8f,0x6dc0,0x6df1,0x6e22,0x6e53,0x6e84,0x6eb5,0x6ee6,0x6f18,
|
|
0x6f49,0x6f7b,0x6fad,0x6fde,0x700f,0x7041,0x7072,0x70a3,0x70d5,0x7106,0x7138,0x7169,0x719b,0x71cc,0x71fe,0x7230,
|
|
0x7262,0x7294,0x72c7,0x72f9,0x732b,0x735d,0x738f,0x73c1,0x73f3,0x7425,0x7457,0x748a,0x74bc,0x74ef,0x7521,0x7554,
|
|
0x7587,0x75ba,0x75ec,0x761f,0x7652,0x7685,0x76b8,0x76eb,0x771e,0x7750,0x7783,0x77b7,0x77ea,0x781d,0x7851,0x7884,
|
|
0x78b8,0x78eb,0x791e,0x7952,0x7986,0x79ba,0x79ee,0x7a22,0x7a56,0x7a8a,0x7abe,0x7af3,0x7b27,0x7b5b,0x7b90,0x7bc4,
|
|
0x7bf8,0x7c2d,0x7c61,0x7c96,0x7ccb,0x7d00,0x7d35,0x7d6a,0x7d9f,0x7dd4,0x7e09,0x7e3e,0x7e73,0x7ea8,0x7edd,0x7f13,
|
|
0x7f49,0x7f7e,0x7fb4,0x7fea,0x8020,0x8055,0x808b,0x80c1,0x80f7,0x812d,0x8163,0x8199,0x81cf,0x8205,0x823b,0x8271,
|
|
0x82a8,0x82de,0x8314,0x834b,0x8382,0x83b8,0x83ef,0x8426,0x845d,0x8493,0x84ca,0x8501,0x8538,0x856f,0x85a6,0x85dd,
|
|
0x8614,0x864b,0x8682,0x86b9,0x86f1,0x8728,0x875f,0x8797,0x87cf,0x8806,0x883e,0x8875,0x88ad,0x88e4,0x891c,0x8953,
|
|
0x898b,0x89c2,0x89f9,0x8a31,0x8a69,0x8aa1,0x8ad9,0x8b11,0x8b49,0x8b81,0x8bb9,0x8bf1,0x8c29,0x8c61,0x8c98,0x8cd1,
|
|
0x8d09,0x8d41,0x8d79,0x8db1,0x8de9,0x8e22,0x8e5a,0x8e93,0x8ecc,0x8f05,0x8f3e,0x8f77,0x8fb1,0x8feb,0x9025,0x905f,
|
|
0x909a,0x90d5,0x910f,0x914a,0x9184,0x91bf,0x91f9,0x9234,0x926e,0x92a8,0x92e3,0x931e,0x9358,0x9393,0x93ce,0x9409,
|
|
0x9444,0x947f,0x94ba,0x94f5,0x9530,0x956b,0x95a6,0x95e1,0x961c,0x9657,0x9692,0x96cd,0x9708,0x9742,0x977d,0x97b9,
|
|
0x97f4,0x9830,0x986b,0x98a7,0x98e2,0x991d,0x9959,0x9994,0x99d0,0x9a0c,0x9a47,0x9a83,0x9abf,0x9afb,0x9b37,0x9b73,
|
|
0x9baf,0x9bec,0x9c28,0x9c64,0x9ca1,0x9cdd,0x9d1a,0x9d56,0x9d93,0x9dd0,0x9e0c,0x9e49,0x9e86,0x9ec3,0x9eff,0x9f3c,
|
|
0x9f79,0x9fb6,0x9ff4,0xa031,0xa06f,0xa0ad,0xa0eb,0xa129,0xa166,0xa1a4,0xa1e2,0xa220,0xa25e,0xa29d,0xa2db,0xa319,
|
|
0xa358,0xa396,0xa3d4,0xa413,0xa452,0xa491,0xa4d0,0xa510,0xa54f,0xa58f,0xa5cf,0xa60e,0xa64e,0xa68d,0xa6cd,0xa70d,
|
|
0xa74d,0xa78d,0xa7cd,0xa80d,0xa84d,0xa88e,0xa8ce,0xa90f,0xa950,0xa991,0xa9d2,0xaa13,0xaa55,0xaa96,0xaad7,0xab19,
|
|
0xab5a,0xab9c,0xabdd,0xac1f,0xac61,0xaca3,0xace5,0xad26,0xad69,0xadab,0xaded,0xae2f,0xae71,0xaeb3,0xaef6,0xaf38,
|
|
0xaf7b,0xafbe,0xb001,0xb044,0xb086,0xb0c9,0xb10c,0xb14f,0xb192,0xb1d6,0xb219,0xb25d,0xb2a0,0xb2e4,0xb328,0xb36c,
|
|
0xb3b0,0xb3f3,0xb437,0xb47b,0xb4bf,0xb503,0xb546,0xb58a,0xb5ce,0xb612,0xb656,0xb69a,0xb6de,0xb722,0xb767,0xb7ab,
|
|
0xb7f1,0xb836,0xb87b,0xb8c2,0xb90a,0xb953,0xb99b,0xb9e4,0xba2e,0xba78,0xbac2,0xbb0c,0xbb57,0xbba1,0xbbeb,0xbc36,
|
|
0xbc80,0xbccb,0xbd15,0xbd60,0xbdab,0xbdf7,0xbe42,0xbe8d,0xbed9,0xbf24,0xbf70,0xbfbc,0xc008,0xc055,0xc0a1,0xc0ee,
|
|
0xc13c,0xc189,0xc1d7,0xc225,0xc273,0xc2c2,0xc310,0xc35f,0xc3af,0xc3fe,0xc44e,0xc49e,0xc4ee,0xc53f,0xc58f,0xc5e0,
|
|
0xc633,0xc685,0xc6d7,0xc72a,0xc77e,0xc7d2,0xc825,0xc87a,0xc8cf,0xc924,0xc979,0xc9ce,0xca25,0xca7c,0xcad3,0xcb2b,
|
|
0xcb83,0xcbdc,0xcc35,0xcc8e,0xcce8,0xcd43,0xcd9d,0xcdf8,0xce56,0xceb3,0xcf11,0xcf6e,0xcfcd,0xd02c,0xd08b,0xd0ea,
|
|
0xd14c,0xd1ae,0xd210,0xd272,0xd2d6,0xd33a,0xd39e,0xd402,0xd469,0xd4cf,0xd536,0xd59d,0xd606,0xd66f,0xd6d8,0xd742,
|
|
0xd7ad,0xd819,0xd884,0xd8f0,0xd95f,0xd9cd,0xda3b,0xdaab,0xdb1c,0xdb8d,0xdbff,0xdc71,0xdce4,0xdd57,0xddca,0xde3e,
|
|
0xdeb4,0xdf2a,0xdfa0,0xe017,0xe08f,0xe108,0xe180,0xe1f9,0xe274,0xe2f0,0xe36b,0xe3e7,0xe465,0xe4e3,0xe561,0xe5e0,
|
|
0xe660,0xe6e0,0xe760,0xe7e0,0xe862,0xe8e5,0xe967,0xe9e9,0xea6e,0xeaf3,0xeb78,0xebfe,0xec85,0xed0c,0xed93,0xee1a,
|
|
0xeea3,0xef2c,0xefb5,0xf03e,0xf0c9,0xf154,0xf1de,0xf269,0xf2f6,0xf383,0xf40f,0xf49c,0xf52b,0xf5ba,0xf648,0xf6d7,
|
|
0xf767,0xf7f6,0xf886,0xf916,0xf9a8,0xfa3a,0xfacc,0xfb5e,0xfbf2,0xfc85,0xfd19,0xfdac,0xfe41,0xfed5,0xff6a,0xffff,
|
|
#endif
|
|
}};
|
|
|
|
#if 0
|
|
function DouglasPeucker(PointList[], epsilon)
|
|
//Find the point with the maximum distance
|
|
dmax = 0
|
|
index = 0
|
|
for i = 2 to (length(PointList) - 1)
|
|
d = PerpendicularDistance(PointList[i], Line(PointList[1], PointList[end]))
|
|
if d > dmax
|
|
index = i
|
|
dmax = d
|
|
end
|
|
end
|
|
|
|
//If max distance is greater than epsilon, recursively simplify
|
|
if dmax >= epsilon
|
|
//Recursive call
|
|
recResults1[] = DouglasPeucker(PointList[1...index], epsilon)
|
|
recResults2[] = DouglasPeucker(PointList[index...end], epsilon)
|
|
|
|
// Build the result list
|
|
ResultList[] = {recResults1[1...end-1] recResults2[1...end]}
|
|
else
|
|
ResultList[] = {PointList[1], PointList[end]}
|
|
end
|
|
|
|
//Return the result
|
|
return ResultList[]
|
|
end
|
|
#endif
|
|
|
|
|
|
enum { kIOFBGammaPointCountMax = 256 };
|
|
enum { kIOFBGammaDesiredError = 127 };
|
|
|
|
struct IOFBLineSeg
|
|
{
|
|
// [start end]
|
|
uint16_t start;
|
|
uint16_t end;
|
|
uint16_t dist;
|
|
uint16_t split;
|
|
};
|
|
typedef struct IOFBLineSeg IOFBLineSeg;
|
|
|
|
static void IOFBSegDist(const uint16_t data[], IOFBLineSeg * seg)
|
|
{
|
|
uint16_t start;
|
|
uint16_t end;
|
|
uint16_t idx;
|
|
uint16_t interp;
|
|
int16_t dist;
|
|
|
|
seg->dist = 0;
|
|
start = seg->start;
|
|
end = seg->end;
|
|
for (idx = start + 1; idx < end; idx++)
|
|
{
|
|
interp = data[start] + ((data[end] - data[start]) * (idx - start)) / (end - start);
|
|
dist = data[idx] - interp;
|
|
if (dist < 0) dist = -dist;
|
|
if (dist > seg->dist)
|
|
{
|
|
seg->dist = dist;
|
|
seg->split = idx;
|
|
}
|
|
}
|
|
}
|
|
|
|
static void IOFBSegInit(const uint16_t data[],
|
|
IOFBLineSeg * seg, uint16_t start, uint16_t end)
|
|
{
|
|
seg->start = start;
|
|
seg->end = end;
|
|
IOFBSegDist(data, seg);
|
|
}
|
|
|
|
static void
|
|
IOFBSimplifySegs(const uint16_t data[], uint16_t srcDataCount,
|
|
uint16_t desiredError, uint16_t * maxError,
|
|
IOFBLineSeg * segs, uint16_t count, uint16_t maxCount,
|
|
IOFBBootGamma * bootGamma)
|
|
{
|
|
IOFBGamma * channelGamma;
|
|
uint16_t idx;
|
|
uint16_t furthest;
|
|
uint16_t start;
|
|
|
|
while (count < maxCount)
|
|
{
|
|
furthest = 0;
|
|
for (idx = 1; idx < count; idx++)
|
|
{
|
|
if (segs[idx].dist > segs[furthest].dist) furthest = idx;
|
|
}
|
|
if (segs[furthest].dist <= desiredError) break;
|
|
bcopy(&segs[furthest+1], &segs[furthest+2], (count - furthest - 1) * sizeof(IOFBLineSeg));
|
|
count++;
|
|
assert ((furthest+1) < maxCount);
|
|
IOFBSegInit(data, &segs[furthest+1], segs[furthest].split, segs[furthest].end);
|
|
segs[furthest].end = segs[furthest].split;
|
|
IOFBSegDist(data, &segs[furthest]);
|
|
}
|
|
|
|
*maxError = 0;
|
|
channelGamma = &bootGamma->gamma.red;
|
|
for (idx = 0; idx < count; idx++)
|
|
{
|
|
if (segs[idx].dist > *maxError)
|
|
{
|
|
*maxError = segs[idx].dist;
|
|
//printf("max error seg 0x%x, 0x%x count %d, target %d\n", segs[idx].start, segs[idx].end, count, maxCount);
|
|
}
|
|
start = segs[idx].start % srcDataCount;
|
|
if (!start)
|
|
{
|
|
if (segs[idx].start)
|
|
{
|
|
channelGamma = (typeof(channelGamma)) &channelGamma->points[channelGamma->pointCount];
|
|
}
|
|
channelGamma->pointCount = 0;
|
|
continue;
|
|
}
|
|
channelGamma->points[channelGamma->pointCount].in =
|
|
(start * 65536 / srcDataCount)
|
|
| (start * 65536 / srcDataCount / srcDataCount);
|
|
channelGamma->points[channelGamma->pointCount].out = data[segs[idx].start];
|
|
channelGamma->pointCount++;
|
|
}
|
|
}
|
|
|
|
static bool
|
|
IOFBCompressGamma(
|
|
IOFBBootGamma * bootGamma,
|
|
uint16_t channelCount, uint16_t srcDataCount,
|
|
uint16_t dataWidth, const void * _data,
|
|
uint16_t desiredError, uint16_t maxCount,
|
|
uint16_t * maxError)
|
|
{
|
|
IOFBGamma * channelGamma;
|
|
const uint16_t * data = (typeof(data)) _data;
|
|
uint16_t idx;
|
|
|
|
if ((3 != channelCount) || (16 != dataWidth)) return (false);
|
|
|
|
data = (typeof(data)) _data;
|
|
|
|
IOFBLineSeg * segs;
|
|
maxCount += 3;
|
|
segs = malloc(maxCount * sizeof(IOFBLineSeg));
|
|
memset(segs, 0xee, maxCount * sizeof(IOFBLineSeg));
|
|
|
|
for (idx = 0; idx < 3; idx++) IOFBSegInit(data, &segs[idx], idx * srcDataCount, ((idx + 1) * srcDataCount) - 1);
|
|
|
|
IOFBSimplifySegs(data, srcDataCount, desiredError, maxError,
|
|
segs, 3, maxCount,
|
|
bootGamma);
|
|
free(segs);
|
|
|
|
channelGamma = &bootGamma->gamma.red;
|
|
for (idx = 0; idx < channelCount; idx++)
|
|
{
|
|
channelGamma = (typeof(channelGamma)) &channelGamma->points[channelGamma->pointCount];
|
|
}
|
|
bootGamma->length = ((uintptr_t) channelGamma) - ((uintptr_t) bootGamma);
|
|
return (true);
|
|
}
|
|
|
|
void IOFBDecompressGamma(const IOFBBootGamma * bootGamma, uint16_t * data, uint16_t count)
|
|
{
|
|
const IOFBGamma * channelGamma;
|
|
uint16_t channel, idx, maxIdx, seg;
|
|
uint16_t startIn, startOut;
|
|
uint16_t endIn, endOut;
|
|
|
|
maxIdx = count - 1;
|
|
channelGamma = &bootGamma->gamma.red;
|
|
for (channel = 0; channel < 3; channel++)
|
|
{
|
|
seg = 0;
|
|
startIn = 0;
|
|
startOut = 0x0000;
|
|
endIn = 0;
|
|
endOut = 0;
|
|
for (idx = 0; idx <= maxIdx; idx++)
|
|
{
|
|
if ((idx == endIn) && (idx != maxIdx))
|
|
{
|
|
startIn = endIn;
|
|
startOut = endOut;
|
|
if (seg < channelGamma->pointCount)
|
|
{
|
|
endIn = (channelGamma->points[seg].in * count) >> 16;
|
|
endOut = channelGamma->points[seg].out;
|
|
seg++;
|
|
}
|
|
else
|
|
{
|
|
endIn = maxIdx;
|
|
endOut = 0xFFFF;
|
|
}
|
|
}
|
|
data[channel * count + idx] = startOut + ((endOut - startOut) * (idx - startIn)) / (endIn - startIn);
|
|
}
|
|
channelGamma = (typeof(channelGamma)) &channelGamma->points[channelGamma->pointCount];
|
|
}
|
|
}
|
|
|
|
|
|
int main(int argc, char * argv[])
|
|
{
|
|
IOFBBootGamma * bootGamma;
|
|
uint16_t desiredError = kIOFBGammaDesiredError;
|
|
uint16_t maxCount = kIOFBGammaPointCountMax;
|
|
uint16_t maxError;
|
|
uint32_t srcDataCount = SRCDATACOUNT;
|
|
|
|
if (argc > 2)
|
|
{
|
|
desiredError = strtol(argv[1], 0, 0);
|
|
maxCount = strtol(argv[2], 0, 0);
|
|
}
|
|
|
|
bootGamma = (typeof(bootGamma)) malloc(sizeof(IOFBBootGamma)
|
|
+ (maxCount * sizeof(IOFBGammaPoint)));
|
|
memset(bootGamma, 0xee, sizeof(IOFBBootGamma) + (maxCount * sizeof(IOFBGammaPoint)));
|
|
|
|
bootGamma->vendor = 0;
|
|
bootGamma->product = 0;
|
|
bootGamma->serial = 0;
|
|
if (IOFBCompressGamma(bootGamma, 3, srcDataCount, 16, &data[0][0], desiredError, maxCount, &maxError))
|
|
{
|
|
fprintf(stderr, "compressed gamma to 0x%x bytes, maxError 0x%04x\n", bootGamma->length, maxError);
|
|
|
|
IOFBGamma * channelGamma;
|
|
uint16_t idx, j, channel;
|
|
|
|
channelGamma = &bootGamma->gamma.red;
|
|
for (idx = 0; idx < 3; idx++)
|
|
{
|
|
for (j = 0; j < channelGamma->pointCount; j++) fprintf(stderr, "[%d,%02d] 0x%04x 0x%04x\n", idx, j, channelGamma->points[j].in, channelGamma->points[j].out);
|
|
channelGamma = (typeof(channelGamma)) &channelGamma->points[channelGamma->pointCount];
|
|
}
|
|
|
|
uint16_t * deco;
|
|
uint16_t count = 1024;
|
|
deco = (typeof(deco)) malloc(sizeof(uint16_t) * 3 * count);
|
|
IOFBDecompressGamma(bootGamma, deco, count);
|
|
|
|
uint16_t maxError = 0;
|
|
uint16_t maxErrorIdx;
|
|
for (channel = 0; channel < 3; channel++)
|
|
{
|
|
for (idx = 0; idx < count; idx++)
|
|
{
|
|
printf("0x%04x 0x%04x\n",
|
|
deco[channel * count + idx], data[channel][idx * srcDataCount / 1024]);
|
|
|
|
if (idx & 3) continue;
|
|
|
|
int16_t error = (deco[channel * count + idx] - data[channel][idx * srcDataCount / 1024]);
|
|
if (error < 0) error = -error;
|
|
if (error > maxError)
|
|
{
|
|
maxErrorIdx = idx;
|
|
maxError = error;
|
|
}
|
|
}
|
|
}
|
|
free(deco);
|
|
fprintf(stderr, "maxError 0x%04x @ 0x%x\n", maxError, maxErrorIdx);
|
|
|
|
}
|
|
free(bootGamma);
|
|
|
|
return (0);
|
|
}
|
|
|
|
|