* this maps the error of the red/green/blue components
* in 1:1:1 to the sum
* the size of the array is -256 -> 255
* the operation is a simple abs(number)
*
* good for anything (standard match)
*/
static const GLshort error111[ERROR_RANGE][4] = { /* make it aligned, red = 0(error, result*8), green = 2(error, result*8), blue = 4(error, result*8) */
{0x0100,0x0100,0x0100},
{0x00ff,0x00ff,0x00ff},
{0x00fe,0x00fe,0x00fe},
{0x00fd,0x00fd,0x00fd},
{0x00fc,0x00fc,0x00fc},
{0x00fb,0x00fb,0x00fb},
{0x00fa,0x00fa,0x00fa},
{0x00f9,0x00f9,0x00f9},
{0x00f8,0x00f8,0x00f8},
{0x00f7,0x00f7,0x00f7},
{0x00f6,0x00f6,0x00f6},
{0x00f5,0x00f5,0x00f5},
{0x00f4,0x00f4,0x00f4},
{0x00f3,0x00f3,0x00f3},
{0x00f2,0x00f2,0x00f2},
{0x00f1,0x00f1,0x00f1},
{0x00f0,0x00f0,0x00f0},
{0x00ef,0x00ef,0x00ef},
{0x00ee,0x00ee,0x00ee},
{0x00ed,0x00ed,0x00ed},
{0x00ec,0x00ec,0x00ec},
{0x00eb,0x00eb,0x00eb},
{0x00ea,0x00ea,0x00ea},
{0x00e9,0x00e9,0x00e9},
{0x00e8,0x00e8,0x00e8},
{0x00e7,0x00e7,0x00e7},
{0x00e6,0x00e6,0x00e6},
{0x00e5,0x00e5,0x00e5},
{0x00e4,0x00e4,0x00e4},
{0x00e3,0x00e3,0x00e3},
{0x00e2,0x00e2,0x00e2},
{0x00e1,0x00e1,0x00e1},
{0x00e0,0x00e0,0x00e0},
{0x00df,0x00df,0x00df},
{0x00de,0x00de,0x00de},
{0x00dd,0x00dd,0x00dd},
{0x00dc,0x00dc,0x00dc},
{0x00db,0x00db,0x00db},
{0x00da,0x00da,0x00da},
{0x00d9,0x00d9,0x00d9},
{0x00d8,0x00d8,0x00d8},
{0x00d7,0x00d7,0x00d7},
{0x00d6,0x00d6,0x00d6},
{0x00d5,0x00d5,0x00d5},
{0x00d4,0x00d4,0x00d4},
{0x00d3,0x00d3,0x00d3},
{0x00d2,0x00d2,0x00d2},
{0x00d1,0x00d1,0x00d1},
{0x00d0,0x00d0,0x00d0},
{0x00cf,0x00cf,0x00cf},
{0x00ce,0x00ce,0x00ce},
{0x00cd,0x00cd,0x00cd},
{0x00cc,0x00cc,0x00cc},
{0x00cb,0x00cb,0x00cb},
{0x00ca,0x00ca,0x00ca},
{0x00c9,0x00c9,0x00c9},
{0x00c8,0x00c8,0x00c8},
{0x00c7,0x00c7,0x00c7},
{0x00c6,0x00c6,0x00c6},
{0x00c5,0x00c5,0x00c5},
{0x00c4,0x00c4,0x00c4},
{0x00c3,0x00c3,0x00c3},
{0x00c2,0x00c2,0x00c2},
{0x00c1,0x00c1,0x00c1},
{0x00c0,0x00c0,0x00c0},
{0x00bf,0x00bf,0x00bf},
{0x00be,0x00be,0x00be},
{0x00bd,0x00bd,0x00bd},
{0x00bc,0x00bc,0x00bc},
{0x00bb,0x00bb,0x00bb},
{0x00ba,0x00ba,0x00ba},
{0x00b9,0x00b9,0x00b9},
{0x00b8,0x00b8,0x00b8},
{0x00b7,0x00b7,0x00b7},
{0x00b6,0x00b6,0x00b6},
{0x00b5,0x00b5,0x00b5},
{0x00b4,0x00b4,0x00b4},
{0x00b3,0x00b3,0x00b3},
{0x00b2,0x00b2,0x00b2},
{0x00b1,0x00b1,0x00b1},
{0x00b0,0x00b0,0x00b0},
{0x00af,0x00af,0x00af},
{0x00ae,0x00ae,0x00ae},
{0x00ad,0x00ad,0x00ad},
{0x00ac,0x00ac,0x00ac},
{0x00ab,0x00ab,0x00ab},
{0x00aa,0x00aa,0x00aa},
{0x00a9,0x00a9,0x00a9},
{0x00a8,0x00a8,0x00a8},
{0x00a7,0x00a7,0x00a7},
{0x00a6,0x00a6,0x00a6},
{0x00a5,0x00a5,0x00a5},
{0x00a4,0x00a4,0x00a4},
{0x00a3,0x00a3,0x00a3},
{0x00a2,0x00a2,0x00a2},
{0x00a1,0x00a1,0x00a1},
{0x00a0,0x00a0,0x00a0},
{0x009f,0x009f,0x009f},
{0x009e,0x009e,0x009e},
{0x009d,0x009d,0x009d},
{0x009c,0x009c,0x009c},
{0x009b,0x009b,0x009b},
{0x009a,0x009a,0x009a},
{0x0099,0x0099,0x0099},
{0x0098,0x0098,0x0098},
{0x0097,0x0097,0x0097},
{0x0096,0x0096,0x0096},
{0x0095,0x0095,0x0095},
{0x0094,0x0094,0x0094},
{0x0093,0x0093,0x0093},
{0x0092,0x0092,0x0092},
{0x0091,0x0091,0x0091},
{0x0090,0x0090,0x0090},
{0x008f,0x008f,0x008f},
{0x008e,0x008e,0x008e},
{0x008d,0x008d,0x008d},
{0x008c,0x008c,0x008c},
{0x008b,0x008b,0x008b},
{0x008a,0x008a,0x008a},
{0x0089,0x0089,0x0089},
{0x0088,0x0088,0x0088},
{0x0087,0x0087,0x0087},
{0x0086,0x0086,0x0086},
{0x0085,0x0085,0x0085},
{0x0084,0x0084,0x0084},
{0x0083,0x0083,0x0083},
{0x0082,0x0082,0x0082},
{0x0081,0x0081,0x0081},
{0x0080,0x0080,0x0080},
{0x007f,0x007f,0x007f},
{0x007e,0x007e,0x007e},
{0x007d,0x007d,0x007d},
{0x007c,0x007c,0x007c},
{0x007b,0x007b,0x007b},
{0x007a,0x007a,0x007a},
{0x0079,0x0079,0x0079},
{0x0078,0x0078,0x0078},
{0x0077,0x0077,0x0077},
{0x0076,0x0076,0x0076},
{0x0075,0x0075,0x0075},
{0x0074,0x0074,0x0074},
{0x0073,0x0073,0x0073},
{0x0072,0x0072,0x0072},
{0x0071,0x0071,0x0071},
{0x0070,0x0070,0x0070},
{0x006f,0x006f,0x006f},
{0x006e,0x006e,0x006e},
{0x006d,0x006d,0x006d},
{0x006c,0x006c,0x006c},
{0x006b,0x006b,0x006b},
{0x006a,0x006a,0x006a},
{0x0069,0x0069,0x0069},
{0x0068,0x0068,0x0068},
{0x0067,0x0067,0x0067},
{0x0066,0x0066,0x0066},
{0x0065,0x0065,0x0065},
{0x0064,0x0064,0x0064},
{0x0063,0x0063,0x0063},
{0x0062,0x0062,0x0062},
{0x0061,0x0061,0x0061},
{0x0060,0x0060,0x0060},
{0x005f,0x005f,0x005f},
{0x005e,0x005e,0x005e},
{0x005d,0x005d,0x005d},
{0x005c,0x005c,0x005c},
{0x005b,0x005b,0x005b},
{0x005a,0x005a,0x005a},
{0x0059,0x0059,0x0059},
{0x0058,0x0058,0x0058},
{0x0057,0x0057,0x0057},
{0x0056,0x0056,0x0056},
{0x0055,0x0055,0x0055},
{0x0054,0x0054,0x0054},
{0x0053,0x0053,0x0053},
{0x0052,0x0052,0x0052},
{0x0051,0x0051,0x0051},
{0x0050,0x0050,0x0050},
{0x004f,0x004f,0x004f},
{0x004e,0x004e,0x004e},
{0x004d,0x004d,0x004d},
{0x004c,0x004c,0x004c},
{0x004b,0x004b,0x004b},
{0x004a,0x004a,0x004a},
{0x0049,0x0049,0x0049},
{0x0048,0x0048,0x0048},
{0x0047,0x0047,0x0047},
{0x0046,0x0046,0x0046},
{0x0045,0x0045,0x0045},
{0x0044,0x0044,0x0044},
{0x0043,0x0043,0x0043},
{0x0042,0x0042,0x0042},
{0x0041,0x0041,0x0041},
{0x0040,0x0040,0x0040},
{0x003f,0x003f,0x003f},
{0x003e,0x003e,0x003e},
{0x003d,0x003d,0x003d},
{0x003c,0x003c,0x003c},
{0x003b,0x003b,0x003b},
{0x003a,0x003a,0x003a},
{0x0039,0x0039,0x0039},
{0x0038,0x0038,0x0038},
{0x0037,0x0037,0x0037},
{0x0036,0x0036,0x0036},
{0x0035,0x0035,0x0035},
{0x0034,0x0034,0x0034},
{0x0033,0x0033,0x0033},
{0x0032,0x0032,0x0032},
{0x0031,0x0031,0x0031},
{0x0030,0x0030,0x0030},
{0x002f,0x002f,0x002f},
{0x002e,0x002e,0x002e},
{0x002d,0x002d,0x002d},
{0x002c,0x002c,0x002c},
{0x002b,0x002b,0x002b},
{0x002a,0x002a,0x002a},
{0x0029,0x0029,0x0029},
{0x0028,0x0028,0x0028},
{0x0027,0x0027,0x0027},
{0x0026,0x0026,0x0026},
{0x0025,0x0025,0x0025},
{0x0024,0x0024,0x0024},
{0x0023,0x0023,0x0023},
{0x0022,0x0022,0x0022},
{0x0021,0x0021,0x0021},
{0x0020,0x0020,0x0020},
{0x001f,0x001f,0x001f},
{0x001e,0x001e,0x001e},
{0x001d,0x001d,0x001d},
{0x001c,0x001c,0x001c},
{0x001b,0x001b,0x001b},
{0x001a,0x001a,0x001a},
{0x0019,0x0019,0x0019},
{0x0018,0x0018,0x0018},
{0x0017,0x0017,0x0017},
{0x0016,0x0016,0x0016},
{0x0015,0x0015,0x0015},
{0x0014,0x0014,0x0014},
{0x0013,0x0013,0x0013},
{0x0012,0x0012,0x0012},
{0x0011,0x0011,0x0011},
{0x0010,0x0010,0x0010},
{0x000f,0x000f,0x000f},
{0x000e,0x000e,0x000e},
{0x000d,0x000d,0x000d},
{0x000c,0x000c,0x000c},
{0x000b,0x000b,0x000b},
{0x000a,0x000a,0x000a},
{0x0009,0x0009,0x0009},
{0x0008,0x0008,0x0008},
{0x0007,0x0007,0x0007},
{0x0006,0x0006,0x0006},
{0x0005,0x0005,0x0005},
{0x0004,0x0004,0x0004},
{0x0003,0x0003,0x0003},
{0x0002,0x0002,0x0002},
{0x0001,0x0001,0x0001},
{0x0000,0x0000,0x0000},
{0x0001,0x0001,0x0001},
{0x0002,0x0002,0x0002},
{0x0003,0x0003,0x0003},
{0x0004,0x0004,0x0004},
{0x0005,0x0005,0x0005},
{0x0006,0x0006,0x0006},
{0x0007,0x0007,0x0007},
{0x0008,0x0008,0x0008},
{0x0009,0x0009,0x0009},
{0x000a,0x000a,0x000a},
{0x000b,0x000b,0x000b},
{0x000c,0x000c,0x000c},
{0x000d,0x000d,0x000d},
{0x000e,0x000e,0x000e},
{0x000f,0x000f,0x000f},
{0x0010,0x0010,0x0010},
{0x0011,0x0011,0x0011},
{0x0012,0x0012,0x0012},
{0x0013,0x0013,0x0013},
{0x0014,0x0014,0x0014},
{0x0015,0x0015,0x0015},
{0x0016,0x0016,0x0016},
{0x0017,0x0017,0x0017},
{0x0018,0x0018,0x0018},
{0x0019,0x0019,0x0019},
{0x001a,0x001a,0x001a},
{0x001b,0x001b,0x001b},
{0x001c,0x001c,0x001c},
{0x001d,0x001d,0x001d},
{0x001e,0x001e,0x001e},
{0x001f,0x001f,0x001f},
{0x0020,0x0020,0x0020},
{0x0021,0x0021,0x0021},
{0x0022,0x0022,0x0022},
{0x0023,0x0023,0x0023},
{0x0024,0x0024,0x0024},
{0x0025,0x0025,0x0025},
{0x0026,0x0026,0x0026},
{0x0027,0x0027,0x0027},
{0x0028,0x0028,0x0028},
{0x0029,0x0029,0x0029},
{0x002a,0x002a,0x002a},
{0x002b,0x002b,0x002b},
{0x002c,0x002c,0x002c},
{0x002d,0x002d,0x002d},
{0x002e,0x002e,0x002e},
{0x002f,0x002f,0x002f},
{0x0030,0x0030,0x0030},
{0x0031,0x0031,0x0031},
{0x0032,0x0032,0x0032},
{0x0033,0x0033,0x0033},
{0x0034,0x0034,0x0034},
{0x0035,0x0035,0x0035},
{0x0036,0x0036,0x0036},
{0x0037,0x0037,0x0037},
{0x0038,0x0038,0x0038},
{0x0039,0x0039,0x0039},
{0x003a,0x003a,0x003a},
{0x003b,0x003b,0x003b},
{0x003c,0x003c,0x003c},
{0x003d,0x003d,0x003d},
{0x003e,0x003e,0x003e},
{0x003f,0x003f,0x003f},
{0x0040,0x0040,0x0040},
{0x0041,0x0041,0x0041},
{0x0042,0x0042,0x0042},
{0x0043,0x0043,0x0043},
{0x0044,0x0044,0x0044},
{0x0045,0x0045,0x0045},
{0x0046,0x0046,0x0046},
{0x0047,0x0047,0x0047},
{0x0048,0x0048,0x0048},
{0x0049,0x0049,0x0049},
{0x004a,0x004a,0x004a},
{0x004b,0x004b,0x004b},
{0x004c,0x004c,0x004c},
{0x004d,0x004d,0x004d},
{0x004e,0x004e,0x004e},
{0x004f,0x004f,0x004f},
{0x0050,0x0050,0x0050},
{0x0051,0x0051,0x0051},
{0x0052,0x0052,0x0052},
{0x0053,0x0053,0x0053},
{0x0054,0x0054,0x0054},
{0x0055,0x0055,0x0055},
{0x0056,0x0056,0x0056},
{0x0057,0x0057,0x0057},
{0x0058,0x0058,0x0058},
{0x0059,0x0059,0x0059},
{0x005a,0x005a,0x005a},
{0x005b,0x005b,0x005b},
{0x005c,0x005c,0x005c},
{0x005d,0x005d,0x005d},
{0x005e,0x005e,0x005e},
{0x005f,0x005f,0x005f},
{0x0060,0x0060,0x0060},
{0x0061,0x0061,0x0061},
{0x0062,0x0062,0x0062},
{0x0063,0x0063,0x0063},
{0x0064,0x0064,0x0064},
{0x0065,0x0065,0x0065},
{0x0066,0x0066,0x0066},
{0x0067,0x0067,0x0067},
{0x0068,0x0068,0x0068},
{0x0069,0x0069,0x0069},
{0x006a,0x006a,0x006a},
{0x006b,0x006b,0x006b},
{0x006c,0x006c,0x006c},
{0x006d,0x006d,0x006d},
{0x006e,0x006e,0x006e},
{0x006f,0x006f,0x006f},
{0x0070,0x0070,0x0070},
{0x0071,0x0071,0x0071},
{0x0072,0x0072,0x0072},
{0x0073,0x0073,0x0073},
{0x0074,0x0074,0x0074},
{0x0075,0x0075,0x0075},
{0x0076,0x0076,0x0076},
{0x0077,0x0077,0x0077},
{0x0078,0x0078,0x0078},
{0x0079,0x0079,0x0079},
{0x007a,0x007a,0x007a},
{0x007b,0x007b,0x007b},
{0x007c,0x007c,0x007c},
{0x007d,0x007d,0x007d},
{0x007e,0x007e,0x007e},
{0x007f,0x007f,0x007f},
{0x0080,0x0080,0x0080},
{0x0081,0x0081,0x0081},
{0x0082,0x0082,0x0082},
{0x0083,0x0083,0x0083},
{0x0084,0x0084,0x0084},
{0x0085,0x0085,0x0085},
{0x0086,0x0086,0x0086},
{0x0087,0x0087,0x0087},
{0x0088,0x0088,0x0088},
{0x0089,0x0089,0x0089},
{0x008a,0x008a,0x008a},
{0x008b,0x008b,0x008b},
{0x008c,0x008c,0x008c},
{0x008d,0x008d,0x008d},
{0x008e,0x008e,0x008e},
{0x008f,0x008f,0x008f},
{0x0090,0x0090,0x0090},
{0x0091,0x0091,0x0091},
{0x0092,0x0092,0x0092},
{0x0093,0x0093,0x0093},
{0x0094,0x0094,0x0094},
{0x0095,0x0095,0x0095},
{0x0096,0x0096,0x0096},
{0x0097,0x0097,0x0097},
{0x0098,0x0098,0x0098},
{0x0099,0x0099,0x0099},
{0x009a,0x009a,0x009a},
{0x009b,0x009b,0x009b},
{0x009c,0x009c,0x009c},
{0x009d,0x009d,0x009d},
{0x009e,0x009e,0x009e},
{0x009f,0x009f,0x009f},
{0x00a0,0x00a0,0x00a0},
{0x00a1,0x00a1,0x00a1},
{0x00a2,0x00a2,0x00a2},
{0x00a3,0x00a3,0x00a3},
{0x00a4,0x00a4,0x00a4},
{0x00a5,0x00a5,0x00a5},
{0x00a6,0x00a6,0x00a6},
{0x00a7,0x00a7,0x00a7},
{0x00a8,0x00a8,0x00a8},
{0x00a9,0x00a9,0x00a9},
{0x00aa,0x00aa,0x00aa},
{0x00ab,0x00ab,0x00ab},
{0x00ac,0x00ac,0x00ac},
{0x00ad,0x00ad,0x00ad},
{0x00ae,0x00ae,0x00ae},
{0x00af,0x00af,0x00af},
{0x00b0,0x00b0,0x00b0},
{0x00b1,0x00b1,0x00b1},
{0x00b2,0x00b2,0x00b2},
{0x00b3,0x00b3,0x00b3},
{0x00b4,0x00b4,0x00b4},
{0x00b5,0x00b5,0x00b5},
{0x00b6,0x00b6,0x00b6},
{0x00b7,0x00b7,0x00b7},
{0x00b8,0x00b8,0x00b8},
{0x00b9,0x00b9,0x00b9},
{0x00ba,0x00ba,0x00ba},
{0x00bb,0x00bb,0x00bb},
{0x00bc,0x00bc,0x00bc},
{0x00bd,0x00bd,0x00bd},
{0x00be,0x00be,0x00be},
{0x00bf,0x00bf,0x00bf},
{0x00c0,0x00c0,0x00c0},
{0x00c1,0x00c1,0x00c1},
{0x00c2,0x00c2,0x00c2},
{0x00c3,0x00c3,0x00c3},
{0x00c4,0x00c4,0x00c4},
{0x00c5,0x00c5,0x00c5},
{0x00c6,0x00c6,0x00c6},
{0x00c7,0x00c7,0x00c7},
{0x00c8,0x00c8,0x00c8},
{0x00c9,0x00c9,0x00c9},
{0x00ca,0x00ca,0x00ca},
{0x00cb,0x00cb,0x00cb},
{0x00cc,0x00cc,0x00cc},
{0x00cd,0x00cd,0x00cd},
{0x00ce,0x00ce,0x00ce},
{0x00cf,0x00cf,0x00cf},
{0x00d0,0x00d0,0x00d0},
{0x00d1,0x00d1,0x00d1},
{0x00d2,0x00d2,0x00d2},
{0x00d3,0x00d3,0x00d3},
{0x00d4,0x00d4,0x00d4},
{0x00d5,0x00d5,0x00d5},
{0x00d6,0x00d6,0x00d6},
{0x00d7,0x00d7,0x00d7},
{0x00d8,0x00d8,0x00d8},
{0x00d9,0x00d9,0x00d9},
{0x00da,0x00da,0x00da},
{0x00db,0x00db,0x00db},
{0x00dc,0x00dc,0x00dc},
{0x00dd,0x00dd,0x00dd},
{0x00de,0x00de,0x00de},
{0x00df,0x00df,0x00df},
{0x00e0,0x00e0,0x00e0},
{0x00e1,0x00e1,0x00e1},
{0x00e2,0x00e2,0x00e2},
{0x00e3,0x00e3,0x00e3},
{0x00e4,0x00e4,0x00e4},
{0x00e5,0x00e5,0x00e5},
{0x00e6,0x00e6,0x00e6},
{0x00e7,0x00e7,0x00e7},
{0x00e8,0x00e8,0x00e8},
{0x00e9,0x00e9,0x00e9},
{0x00ea,0x00ea,0x00ea},
{0x00eb,0x00eb,0x00eb},
{0x00ec,0x00ec,0x00ec},
{0x00ed,0x00ed,0x00ed},
{0x00ee,0x00ee,0x00ee},
{0x00ef,0x00ef,0x00ef},
{0x00f0,0x00f0,0x00f0},
{0x00f1,0x00f1,0x00f1},
{0x00f2,0x00f2,0x00f2},
{0x00f3,0x00f3,0x00f3},
{0x00f4,0x00f4,0x00f4},
{0x00f5,0x00f5,0x00f5},
{0x00f6,0x00f6,0x00f6},
{0x00f7,0x00f7,0x00f7},
{0x00f8,0x00f8,0x00f8},
{0x00f9,0x00f9,0x00f9},
{0x00fa,0x00fa,0x00fa},
{0x00fb,0x00fb,0x00fb},
{0x00fc,0x00fc,0x00fc},
{0x00fd,0x00fd,0x00fd},
{0x00fe,0x00fe,0x00fe},
{0x00ff,0x00ff,0x00ff}
};
/*
* this maps the error of the red/green/blue components
* in 5:6:5 to the sum
* the size of the array is -256 -> 255
*
* good for rgb -> 332 matches
*/
static const GLshort error565[ERROR_RANGE][4] = { /* make it aligned, red = 0(error, result*8), green = 2(error, result*8), blue = 4(error, result*8) */
{0x0500,0x0600,0x0500},
{0x04fb,0x05fa,0x04fb},
{0x04f6,0x05f4,0x04f6},
{0x04f1,0x05ee,0x04f1},
{0x04ec,0x05e8,0x04ec},
{0x04e7,0x05e2,0x04e7},
{0x04e2,0x05dc,0x04e2},
{0x04dd,0x05d6,0x04dd},
{0x04d8,0x05d0,0x04d8},
{0x04d3,0x05ca,0x04d3},
{0x04ce,0x05c4,0x04ce},
{0x04c9,0x05be,0x04c9},
{0x04c4,0x05b8,0x04c4},
{0x04bf,0x05b2,0x04bf},
{0x04ba,0x05ac,0x04ba},
{0x04b5,0x05a6,0x04b5},
{0x04b0,0x05a0,0x04b0},
{0x04ab,0x059a,0x04ab},
{0x04a6,0x0594,0x04a6},
{0x04a1,0x058e,0x04a1},
{0x049c,0x0588,0x049c},
{0x0497,0x0582,0x0497},
{0x0492,0x057c,0x0492},
{0x048d,0x0576,0x048d},
{0x0488,0x0570,0x0488},
{0x0483,0x056a,0x0483},
{0x047e,0x0564,0x047e},
{0x0479,0x055e,0x0479},
{0x0474,0x0558,0x0474},
{0x046f,0x0552,0x046f},
{0x046a,0x054c,0x046a},
{0x0465,0x0546,0x0465},
{0x0460,0x0540,0x0460},
{0x045b,0x053a,0x045b},
{0x0456,0x0534,0x0456},
{0x0451,0x052e,0x0451},
{0x044c,0x0528,0x044c},
{0x0447,0x0522,0x0447},
{0x0442,0x051c,0x0442},
{0x043d,0x0516,0x043d},
{0x0438,0x0510,0x0438},
{0x0433,0x050a,0x0433},
{0x042e,0x0504,0x042e},
{0x0429,0x04fe,0x0429},
{0x0424,0x04f8,0x0424},
{0x041f,0x04f2,0x041f},
{0x041a,0x04ec,0x041a},
{0x0415,0x04e6,0x0415},
{0x0410,0x04e0,0x0410},
{0x040b,0x04da,0x040b},
{0x0406,0x04d4,0x0406},
{0x0401,0x04ce,0x0401},
{0x03fc,0x04c8,0x03fc},
{0x03f7,0x04c2,0x03f7},
{0x03f2,0x04bc,0x03f2},
{0x03ed,0x04b6,0x03ed},
{0x03e8,0x04b0,0x03e8},
{0x03e3,0x04aa,0x03e3},
{0x03de,0x04a4,0x03de},
{0x03d9,0x049e,0x03d9},
{0x03d4,0x0498,0x03d4},
{0x03cf,0x0492,0x03cf},
{0x03ca,0x048c,0x03ca},
{0x03c5,0x0486,0x03c5},
{0x03c0,0x0480,0x03c0},
{0x03bb,0x047a,0x03bb},
{0x03b6,0x0474,0x03b6},
{0x03b1,0x046e,0x03b1},
{0x03ac,0x0468,0x03ac},
{0x03a7,0x0462,0x03a7},
{0x03a2,0x045c,0x03a2},
{0x039d,0x0456,0x039d},
{0x0398,0x0450,0x0398},
{0x0393,0x044a,0x0393},
{0x038e,0x0444,0x038e},
{0x0389,0x043e,0x0389},
{0x0384,0x0438,0x0384},
{0x037f,0x0432,0x037f},
{0x037a,0x042c,0x037a},
{0x0375,0x0426,0x0375},
{0x0370,0x0420,0x0370},
{0x036b,0x041a,0x036b},
{0x0366,0x0414,0x0366},
{0x0361,0x040e,0x0361},
{0x035c,0x0408,0x035c},
{0x0357,0x0402,0x0357},
{0x0352,0x03fc,0x0352},
{0x034d,0x03f6,0x034d},
{0x0348,0x03f0,0x0348},
{0x0343,0x03ea,0x0343},
{0x033e,0x03e4,0x033e},
{0x0339,0x03de,0x0339},
{0x0334,0x03d8,0x0334},
{0x032f,0x03d2,0x032f},
{0x032a,0x03cc,0x032a},
{0x0325,0x03c6,0x0325},
{0x0320,0x03c0,0x0320},
{0x031b,0x03ba,0x031b},
{0x0316,0x03b4,0x0316},
{0x0311,0x03ae,0x0311},
{0x030c,0x03a8,0x030c},
{0x0307,0x03a2,0x0307},
{0x0302,0x039c,0x0302},
{0x02fd,0x0396,0x02fd},
{0x02f8,0x0390,0x02f8},
{0x02f3,0x038a,0x02f3},
{0x02ee,0x0384,0x02ee},
{0x02e9,0x037e,0x02e9},
{0x02e4,0x0378,0x02e4},
{0x02df,0x0372,0x02df},
{0x02da,0x036c,0x02da},
{0x02d5,0x0366,0x02d5},
{0x02d0,0x0360,0x02d0},
{0x02cb,0x035a,0x02cb},
{0x02c6,0x0354,0x02c6},
{0x02c1,0x034e,0x02c1},
{0x02bc,0x0348,0x02bc},
{0x02b7,0x0342,0x02b7},
{0x02b2,0x033c,0x02b2},
{0x02ad,0x0336,0x02ad},
{0x02a8,0x0330,0x02a8},
{0x02a3,0x032a,0x02a3},
{0x029e,0x0324,0x029e},
{0x0299,0x031e,0x0299},
{0x0294,0x0318,0x0294},
{0x028f,0x0312,0x028f},
{0x028a,0x030c,0x028a},
{0x0285,0x0306,0x0285},
{0x0280,0x0300,0x0280},
{0x027b,0x02fa,0x027b},
{0x0276,0x02f4,0x0276},
{0x0271,0x02ee,0x0271},
{0x026c,0x02e8,0x026c},
{0x0267,0x02e2,0x0267},
{0x0262,0x02dc,0x0262},
{0x025d,0x02d6,0x025d},
{0x0258,0x02d0,0x0258},
{0x0253,0x02ca,0x0253},
{0x024e,0x02c4,0x024e},
{0x0249,0x02be,0x0249},
{0x0244,0x02b8,0x0244},
{0x023f,0x02b2,0x023f},
{0x023a,0x02ac,0x023a},
{0x0235,0x02a6,0x0235},
{0x0230,0x02a0,0x0230},
{0x022b,0x029a,0x022b},
{0x0226,0x0294,0x0226},
{0x0221,0x028e,0x0221},
{0x021c,0x0288,0x021c},
{0x0217,0x0282,0x0217},
{0x0212,0x027c,0x0212},
{0x020d,0x0276,0x020d},
{0x0208,0x0270,0x0208},
{0x0203,0x026a,0x0203},
{0x01fe,0x0264,0x01fe},
{0x01f9,0x025e,0x01f9},
{0x01f4,0x0258,0x01f4},
{0x01ef,0x0252,0x01ef},
{0x01ea,0x024c,0x01ea},
{0x01e5,0x0246,0x01e5},
{0x01e0,0x0240,0x01e0},
{0x01db,0x023a,0x01db},
{0x01d6,0x0234,0x01d6},
{0x01d1,0x022e,0x01d1},
{0x01cc,0x0228,0x01cc},
{0x01c7,0x0222,0x01c7},
{0x01c2,0x021c,0x01c2},
{0x01bd,0x0216,0x01bd},
{0x01b8,0x0210,0x01b8},
{0x01b3,0x020a,0x01b3},
{0x01ae,0x0204,0x01ae},
{0x01a9,0x01fe,0x01a9},
{0x01a4,0x01f8,0x01a4},
{0x019f,0x01f2,0x019f},
{0x019a,0x01ec,0x019a},
{0x0195,0x01e6,0x0195},
{0x0190,0x01e0,0x0190},
{0x018b,0x01da,0x018b},
{0x0186,0x01d4,0x0186},
{0x0181,0x01ce,0x0181},
{0x017c,0x01c8,0x017c},
{0x0177,0x01c2,0x0177},
{0x0172,0x01bc,0x0172},
{0x016d,0x01b6,0x016d},
{0x0168,0x01b0,0x0168},
{0x0163,0x01aa,0x0163},
{0x015e,0x01a4,0x015e},
{0x0159,0x019e,0x0159},
{0x0154,0x0198,0x0154},
{0x014f,0x0192,0x014f},
{0x014a,0x018c,0x014a},
{0x0145,0x0186,0x0145},
{0x0140,0x0180,0x0140},
{0x013b,0x017a,0x013b},
{0x0136,0x0174,0x0136},
{0x0131,0x016e,0x0131},
{0x012c,0x0168,0x012c},
{0x0127,0x0162,0x0127},
{0x0122,0x015c,0x0122},
{0x011d,0x0156,0x011d},
{0x0118,0x0150,0x0118},
{0x0113,0x014a,0x0113},
{0x010e,0x0144,0x010e},
{0x0109,0x013e,0x0109},
{0x0104,0x0138,0x0104},
{0x00ff,0x0132,0x00ff},
{0x00fa,0x012c,0x00fa},
{0x00f5,0x0126,0x00f5},
{0x00f0,0x0120,0x00f0},
{0x00eb,0x011a,0x00eb},
{0x00e6,0x0114,0x00e6},
{0x00e1,0x010e,0x00e1},
{0x00dc,0x0108,0x00dc},
{0x00d7,0x0102,0x00d7},
{0x00d2,0x00fc,0x00d2},
{0x00cd,0x00f6,0x00cd},
{0x00c8,0x00f0,0x00c8},
{0x00c3,0x00ea,0x00c3},
{0x00be,0x00e4,0x00be},
{0x00b9,0x00de,0x00b9},
{0x00b4,0x00d8,0x00b4},
{0x00af,0x00d2,0x00af},
{0x00aa,0x00cc,0x00aa},
{0x00a5,0x00c6,0x00a5},
{0x00a0,0x00c0,0x00a0},
{0x009b,0x00ba,0x009b},
{0x0096,0x00b4,0x0096},
{0x0091,0x00ae,0x0091},
{0x008c,0x00a8,0x008c},
{0x0087,0x00a2,0x0087},
{0x0082,0x009c,0x0082},
{0x007d,0x0096,0x007d},
{0x0078,0x0090,0x0078},
{0x0073,0x008a,0x0073},
{0x006e,0x0084,0x006e},
{0x0069,0x007e,0x0069},
{0x0064,0x0078,0x0064},
{0x005f,0x0072,0x005f},
{0x005a,0x006c,0x005a},
{0x0055,0x0066,0x0055},
{0x0050,0x0060,0x0050},
{0x004b,0x005a,0x004b},
{0x0046,0x0054,0x0046},
{0x0041,0x004e,0x0041},
{0x003c,0x0048,0x003c},
{0x0037,0x0042,0x0037},
{0x0032,0x003c,0x0032},
{0x002d,0x0036,0x002d},
{0x0028,0x0030,0x0028},
{0x0023,0x002a,0x0023},
{0x001e,0x0024,0x001e},
{0x0019,0x001e,0x0019},
{0x0014,0x0018,0x0014},
{0x000f,0x0012,0x000f},
{0x000a,0x000c,0x000a},
{0x0005,0x0006,0x0005},
{0x0000,0x0000,0x0000},
{0x0005,0x0006,0x0005},
{0x000a,0x000c,0x000a},
{0x000f,0x0012,0x000f},
{0x0014,0x0018,0x0014},
{0x0019,0x001e,0x0019},
{0x001e,0x0024,0x001e},
{0x0023,0x002a,0x0023},
{0x0028,0x0030,0x0028},
{0x002d,0x0036,0x002d},
{0x0032,0x003c,0x0032},
{0x0037,0x0042,0x0037},
{0x003c,0x0048,0x003c},
{0x0041,0x004e,0x0041},
{0x0046,0x0054,0x0046},
{0x004b,0x005a,0x004b},
{0x0050,0x0060,0x0050},
{0x0055,0x0066,0x0055},
{0x005a,0x006c,0x005a},
{0x005f,0x0072,0x005f},
{0x0064,0x0078,0x0064},
{0x0069,0x007e,0x0069},
{0x006e,0x0084,0x006e},
{0x0073,0x008a,0x0073},
{0x0078,0x0090,0x0078},
{0x007d,0x0096,0x007d},
{0x0082,0x009c,0x0082},
{0x0087,0x00a2,0x0087},
{0x008c,0x00a8,0x008c},
{0x0091,0x00ae,0x0091},
{0x0096,0x00b4,0x0096},
{0x009b,0x00ba,0x009b},
{0x00a0,0x00c0,0x00a0},
{0x00a5,0x00c6,0x00a5},
{0x00aa,0x00cc,0x00aa},
{0x00af,0x00d2,0x00af},
{0x00b4,0x00d8,0x00b4},
{0x00b9,0x00de,0x00b9},
{0x00be,0x00e4,0x00be},
{0x00c3,0x00ea,0x00c3},
{0x00c8,0x00f0,0x00c8},
{0x00cd,0x00f6,0x00cd},
{0x00d2,0x00fc,0x00d2},
{0x00d7,0x0102,0x00d7},
{0x00dc,0x0108,0x00dc},
{0x00e1,0x010e,0x00e1},
{0x00e6,0x0114,0x00e6},
{0x00eb,0x011a,0x00eb},
{0x00f0,0x0120,0x00f0},
{0x00f5,0x0126,0x00f5},
{0x00fa,0x012c,0x00fa},
{0x00ff,0x0132,0x00ff},
{0x0104,0x0138,0x0104},
{0x0109,0x013e,0x0109},
{0x010e,0x0144,0x010e},
{0x0113,0x014a,0x0113},
{0x0118,0x0150,0x0118},
{0x011d,0x0156,0x011d},
{0x0122,0x015c,0x0122},
{0x0127,0x0162,0x0127},
{0x012c,0x0168,0x012c},
{0x0131,0x016e,0x0131},
{0x0136,0x0174,0x0136},
{0x013b,0x017a,0x013b},
{0x0140,0x0180,0x0140},
{0x0145,0x0186,0x0145},
{0x014a,0x018c,0x014a},
{0x014f,0x0192,0x014f},
{0x0154,0x0198,0x0154},
{0x0159,0x019e,0x0159},
{0x015e,0x01a4,0x015e},
{0x0163,0x01aa,0x0163},
{0x0168,0x01b0,0x0168},
{0x016d,0x01b6,0x016d},
{0x0172,0x01bc,0x0172},
{0x0177,0x01c2,0x0177},
{0x017c,0x01c8,0x017c},
{0x0181,0x01ce,0x0181},
{0x0186,0x01d4,0x0186},
{0x018b,0x01da,0x018b},
{0x0190,0x01e0,0x0190},
{0x0195,0x01e6,0x0195},
{0x019a,0x01ec,0x019a},
{0x019f,0x01f2,0x019f},
{0x01a4,0x01f8,0x01a4},
{0x01a9,0x01fe,0x01a9},
{0x01ae,0x0204,0x01ae},
{0x01b3,0x020a,0x01b3},
{0x01b8,0x0210,0x01b8},
{0x01bd,0x0216,0x01bd},
{0x01c2,0x021c,0x01c2},
{0x01c7,0x0222,0x01c7},
{0x01cc,0x0228,0x01cc},
{0x01d1,0x022e,0x01d1},
{0x01d6,0x0234,0x01d6},
{0x01db,0x023a,0x01db},
{0x01e0,0x0240,0x01e0},
{0x01e5,0x0246,0x01e5},
{0x01ea,0x024c,0x01ea},
{0x01ef,0x0252,0x01ef},
{0x01f4,0x0258,0x01f4},
{0x01f9,0x025e,0x01f9},
{0x01fe,0x0264,0x01fe},
{0x0203,0x026a,0x0203},
{0x0208,0x0270,0x0208},
{0x020d,0x0276,0x020d},
{0x0212,0x027c,0x0212},
{0x0217,0x0282,0x0217},
{0x021c,0x0288,0x021c},
{0x0221,0x028e,0x0221},
{0x0226,0x0294,0x0226},
{0x022b,0x029a,0x022b},
{0x0230,0x02a0,0x0230},
{0x0235,0x02a6,0x0235},
{0x023a,0x02ac,0x023a},
{0x023f,0x02b2,0x023f},
{0x0244,0x02b8,0x0244},
{0x0249,0x02be,0x0249},
{0x024e,0x02c4,0x024e},
{0x0253,0x02ca,0x0253},
{0x0258,0x02d0,0x0258},
{0x025d,0x02d6,0x025d},
{0x0262,0x02dc,0x0262},
{0x0267,0x02e2,0x0267},
{0x026c,0x02e8,0x026c},
{0x0271,0x02ee,0x0271},
{0x0276,0x02f4,0x0276},
{0x027b,0x02fa,0x027b},
{0x0280,0x0300,0x0280},
{0x0285,0x0306,0x0285},
{0x028a,0x030c,0x028a},
{0x028f,0x0312,0x028f},
{0x0294,0x0318,0x0294},
{0x0299,0x031e,0x0299},
{0x029e,0x0324,0x029e},
{0x02a3,0x032a,0x02a3},
{0x02a8,0x0330,0x02a8},
{0x02ad,0x0336,0x02ad},
{0x02b2,0x033c,0x02b2},
{0x02b7,0x0342,0x02b7},
{0x02bc,0x0348,0x02bc},
{0x02c1,0x034e,0x02c1},
{0x02c6,0x0354,0x02c6},
{0x02cb,0x035a,0x02cb},
{0x02d0,0x0360,0x02d0},
{0x02d5,0x0366,0x02d5},
{0x02da,0x036c,0x02da},
{0x02df,0x0372,0x02df},
{0x02e4,0x0378,0x02e4},
{0x02e9,0x037e,0x02e9},
{0x02ee,0x0384,0x02ee},
{0x02f3,0x038a,0x02f3},
{0x02f8,0x0390,0x02f8},
{0x02fd,0x0396,0x02fd},
{0x0302,0x039c,0x0302},
{0x0307,0x03a2,0x0307},
{0x030c,0x03a8,0x030c},
{0x0311,0x03ae,0x0311},
{0x0316,0x03b4,0x0316},
{0x031b,0x03ba,0x031b},
{0x0320,0x03c0,0x0320},
{0x0325,0x03c6,0x0325},
{0x032a,0x03cc,0x032a},
{0x032f,0x03d2,0x032f},
{0x0334,0x03d8,0x0334},
{0x0339,0x03de,0x0339},
{0x033e,0x03e4,0x033e},
{0x0343,0x03ea,0x0343},
{0x0348,0x03f0,0x0348},
{0x034d,0x03f6,0x034d},
{0x0352,0x03fc,0x0352},
{0x0357,0x0402,0x0357},
{0x035c,0x0408,0x035c},
{0x0361,0x040e,0x0361},
{0x0366,0x0414,0x0366},
{0x036b,0x041a,0x036b},
{0x0370,0x0420,0x0370},
{0x0375,0x0426,0x0375},
{0x037a,0x042c,0x037a},
{0x037f,0x0432,0x037f},
{0x0384,0x0438,0x0384},
{0x0389,0x043e,0x0389},
{0x038e,0x0444,0x038e},
{0x0393,0x044a,0x0393},
{0x0398,0x0450,0x0398},
{0x039d,0x0456,0x039d},
{0x03a2,0x045c,0x03a2},
{0x03a7,0x0462,0x03a7},
{0x03ac,0x0468,0x03ac},
{0x03b1,0x046e,0x03b1},
{0x03b6,0x0474,0x03b6},
{0x03bb,0x047a,0x03bb},
{0x03c0,0x0480,0x03c0},
{0x03c5,0x0486,0x03c5},
{0x03ca,0x048c,0x03ca},
{0x03cf,0x0492,0x03cf},
{0x03d4,0x0498,0x03d4},
{0x03d9,0x049e,0x03d9},
{0x03de,0x04a4,0x03de},
{0x03e3,0x04aa,0x03e3},
{0x03e8,0x04b0,0x03e8},
{0x03ed,0x04b6,0x03ed},
{0x03f2,0x04bc,0x03f2},
{0x03f7,0x04c2,0x03f7},
{0x03fc,0x04c8,0x03fc},
{0x0401,0x04ce,0x0401},
{0x0406,0x04d4,0x0406},
{0x040b,0x04da,0x040b},
{0x0410,0x04e0,0x0410},
{0x0415,0x04e6,0x0415},
{0x041a,0x04ec,0x041a},
{0x041f,0x04f2,0x041f},
{0x0424,0x04f8,0x0424},
{0x0429,0x04fe,0x0429},
{0x042e,0x0504,0x042e},
{0x0433,0x050a,0x0433},
{0x0438,0x0510,0x0438},
{0x043d,0x0516,0x043d},
{0x0442,0x051c,0x0442},
{0x0447,0x0522,0x0447},
{0x044c,0x0528,0x044c},
{0x0451,0x052e,0x0451},
{0x0456,0x0534,0x0456},
{0x045b,0x053a,0x045b},
{0x0460,0x0540,0x0460},
{0x0465,0x0546,0x0465},
{0x046a,0x054c,0x046a},
{0x046f,0x0552,0x046f},
{0x0474,0x0558,0x0474},
{0x0479,0x055e,0x0479},
{0x047e,0x0564,0x047e},
{0x0483,0x056a,0x0483},
{0x0488,0x0570,0x0488},
{0x048d,0x0576,0x048d},
{0x0492,0x057c,0x0492},
{0x0497,0x0582,0x0497},
{0x049c,0x0588,0x049c},
{0x04a1,0x058e,0x04a1},
{0x04a6,0x0594,0x04a6},
{0x04ab,0x059a,0x04ab},
{0x04b0,0x05a0,0x04b0},
{0x04b5,0x05a6,0x04b5},
{0x04ba,0x05ac,0x04ba},
{0x04bf,0x05b2,0x04bf},
{0x04c4,0x05b8,0x04c4},
{0x04c9,0x05be,0x04c9},
{0x04ce,0x05c4,0x04ce},
{0x04d3,0x05ca,0x04d3},
{0x04d8,0x05d0,0x04d8},
{0x04dd,0x05d6,0x04dd},
{0x04e2,0x05dc,0x04e2},
{0x04e7,0x05e2,0x04e7},
{0x04ec,0x05e8,0x04ec},
{0x04f1,0x05ee,0x04f1},
{0x04f6,0x05f4,0x04f6},
{0x04fb,0x05fa,0x04fb}
};
/*
* this maps the error of the red/green/blue components
* in 0.212671:0.715160:0.072169 to the sum
* the size of the array is -256 -> 255
*
* good for rgb -> grey matches
*/
static const GLshort errorRGB[ERROR_RANGE][4] = { /* make it aligned, red = 0(error, result*8), green = 2(error, result*8), blue = 4(error, result*8) */
{0x1500,0x4800,0x0700},
{0x14eb,0x47b8,0x06f9},
{0x14d6,0x4770,0x06f2},
{0x14c1,0x4728,0x06eb},
{0x14ac,0x46e0,0x06e4},
{0x1497,0x4698,0x06dd},
{0x1482,0x4650,0x06d6},
{0x146d,0x4608,0x06cf},
{0x1458,0x45c0,0x06c8},
{0x1443,0x4578,0x06c1},
{0x142e,0x4530,0x06ba},
{0x1419,0x44e8,0x06b3},
{0x1404,0x44a0,0x06ac},
{0x13ef,0x4458,0x06a5},
{0x13da,0x4410,0x069e},
{0x13c5,0x43c8,0x0697},
{0x13b0,0x4380,0x0690},
{0x139b,0x4338,0x0689},
{0x1386,0x42f0,0x0682},
{0x1371,0x42a8,0x067b},
{0x135c,0x4260,0x0674},
{0x1347,0x4218,0x066d},
{0x1332,0x41d0,0x0666},
{0x131d,0x4188,0x065f},
{0x1308,0x4140,0x0658},
{0x12f3,0x40f8,0x0651},
{0x12de,0x40b0,0x064a},
{0x12c9,0x4068,0x0643},
{0x12b4,0x4020,0x063c},
{0x129f,0x3fd8,0x0635},
{0x128a,0x3f90,0x062e},
{0x1275,0x3f48,0x0627},
{0x1260,0x3f00,0x0620},
{0x124b,0x3eb8,0x0619},
{0x1236,0x3e70,0x0612},
{0x1221,0x3e28,0x060b},
{0x120c,0x3de0,0x0604},
{0x11f7,0x3d98,0x05fd},
{0x11e2,0x3d50,0x05f6},
{0x11cd,0x3d08,0x05ef},
{0x11b8,0x3cc0,0x05e8},
{0x11a3,0x3c78,0x05e1},
{0x118e,0x3c30,0x05da},
{0x1179,0x3be8,0x05d3},
{0x1164,0x3ba0,0x05cc},
{0x114f,0x3b58,0x05c5},
{0x113a,0x3b10,0x05be},
{0x1125,0x3ac8,0x05b7},
{0x1110,0x3a80,0x05b0},
{0x10fb,0x3a38,0x05a9},
{0x10e6,0x39f0,0x05a2},
{0x10d1,0x39a8,0x059b},
{0x10bc,0x3960,0x0594},
{0x10a7,0x3918,0x058d},
{0x1092,0x38d0,0x0586},
{0x107d,0x3888,0x057f},
{0x1068,0x3840,0x0578},
{0x1053,0x37f8,0x0571},
{0x103e,0x37b0,0x056a},
{0x1029,0x3768,0x0563},
{0x1014,0x3720,0x055c},
{0x0fff,0x36d8,0x0555},
{0x0fea,0x3690,0x054e},
{0x0fd5,0x3648,0x0547},
{0x0fc0,0x3600,0x0540},
{0x0fab,0x35b8,0x0539},
{0x0f96,0x3570,0x0532},
{0x0f81,0x3528,0x052b},
{0x0f6c,0x34e0,0x0524},
{0x0f57,0x3498,0x051d},
{0x0f42,0x3450,0x0516},
{0x0f2d,0x3408,0x050f},
{0x0f18,0x33c0,0x0508},
{0x0f03,0x3378,0x0501},
{0x0eee,0x3330,0x04fa},
{0x0ed9,0x32e8,0x04f3},
{0x0ec4,0x32a0,0x04ec},
{0x0eaf,0x3258,0x04e5},
{0x0e9a,0x3210,0x04de},
{0x0e85,0x31c8,0x04d7},
{0x0e70,0x3180,0x04d0},
{0x0e5b,0x3138,0x04c9},
{0x0e46,0x30f0,0x04c2},
{0x0e31,0x30a8,0x04bb},
{0x0e1c,0x3060,0x04b4},
{0x0e07,0x3018,0x04ad},
{0x0df2,0x2fd0,0x04a6},
{0x0ddd,0x2f88,0x049f},
{0x0dc8,0x2f40,0x0498},
{0x0db3,0x2ef8,0x0491},
{0x0d9e,0x2eb0,0x048a},
{0x0d89,0x2e68,0x0483},
{0x0d74,0x2e20,0x047c},
{0x0d5f,0x2dd8,0x0475},
{0x0d4a,0x2d90,0x046e},
{0x0d35,0x2d48,0x0467},
{0x0d20,0x2d00,0x0460},
{0x0d0b,0x2cb8,0x0459},
{0x0cf6,0x2c70,0x0452},
{0x0ce1,0x2c28,0x044b},
{0x0ccc,0x2be0,0x0444},
{0x0cb7,0x2b98,0x043d},
{0x0ca2,0x2b50,0x0436},
{0x0c8d,0x2b08,0x042f},
{0x0c78,0x2ac0,0x0428},
{0x0c63,0x2a78,0x0421},
{0x0c4e,0x2a30,0x041a},
{0x0c39,0x29e8,0x0413},
{0x0c24,0x29a0,0x040c},
{0x0c0f,0x2958,0x0405},
{0x0bfa,0x2910,0x03fe},
{0x0be5,0x28c8,0x03f7},
{0x0bd0,0x2880,0x03f0},
{0x0bbb,0x2838,0x03e9},
{0x0ba6,0x27f0,0x03e2},
{0x0b91,0x27a8,0x03db},
{0x0b7c,0x2760,0x03d4},
{0x0b67,0x2718,0x03cd},
{0x0b52,0x26d0,0x03c6},
{0x0b3d,0x2688,0x03bf},
{0x0b28,0x2640,0x03b8},
{0x0b13,0x25f8,0x03b1},
{0x0afe,0x25b0,0x03aa},
{0x0ae9,0x2568,0x03a3},
{0x0ad4,0x2520,0x039c},
{0x0abf,0x24d8,0x0395},
{0x0aaa,0x2490,0x038e},
{0x0a95,0x2448,0x0387},
{0x0a80,0x2400,0x0380},
{0x0a6b,0x23b8,0x0379},
{0x0a56,0x2370,0x0372},
{0x0a41,0x2328,0x036b},
{0x0a2c,0x22e0,0x0364},
{0x0a17,0x2298,0x035d},
{0x0a02,0x2250,0x0356},
{0x09ed,0x2208,0x034f},
{0x09d8,0x21c0,0x0348},
{0x09c3,0x2178,0x0341},
{0x09ae,0x2130,0x033a},
{0x0999,0x20e8,0x0333},
{0x0984,0x20a0,0x032c},
{0x096f,0x2058,0x0325},
{0x095a,0x2010,0x031e},
{0x0945,0x1fc8,0x0317},
{0x0930,0x1f80,0x0310},
{0x091b,0x1f38,0x0309},
{0x0906,0x1ef0,0x0302},
{0x08f1,0x1ea8,0x02fb},
{0x08dc,0x1e60,0x02f4},
{0x08c7,0x1e18,0x02ed},
{0x08b2,0x1dd0,0x02e6},
{0x089d,0x1d88,0x02df},
{0x0888,0x1d40,0x02d8},
{0x0873,0x1cf8,0x02d1},
{0x085e,0x1cb0,0x02ca},
{0x0849,0x1c68,0x02c3},
{0x0834,0x1c20,0x02bc},
{0x081f,0x1bd8,0x02b5},
{0x080a,0x1b90,0x02ae},
{0x07f5,0x1b48,0x02a7},
{0x07e0,0x1b00,0x02a0},
{0x07cb,0x1ab8,0x0299},
{0x07b6,0x1a70,0x0292},
{0x07a1,0x1a28,0x028b},
{0x078c,0x19e0,0x0284},
{0x0777,0x1998,0x027d},
{0x0762,0x1950,0x0276},
{0x074d,0x1908,0x026f},
{0x0738,0x18c0,0x0268},
{0x0723,0x1878,0x0261},
{0x070e,0x1830,0x025a},
{0x06f9,0x17e8,0x0253},
{0x06e4,0x17a0,0x024c},
{0x06cf,0x1758,0x0245},
{0x06ba,0x1710,0x023e},
{0x06a5,0x16c8,0x0237},
{0x0690,0x1680,0x0230},
{0x067b,0x1638,0x0229},
{0x0666,0x15f0,0x0222},
{0x0651,0x15a8,0x021b},
{0x063c,0x1560,0x0214},
{0x0627,0x1518,0x020d},
{0x0612,0x14d0,0x0206},
{0x05fd,0x1488,0x01ff},
{0x05e8,0x1440,0x01f8},
{0x05d3,0x13f8,0x01f1},
{0x05be,0x13b0,0x01ea},
{0x05a9,0x1368,0x01e3},
{0x0594,0x1320,0x01dc},
{0x057f,0x12d8,0x01d5},
{0x056a,0x1290,0x01ce},
{0x0555,0x1248,0x01c7},
{0x0540,0x1200,0x01c0},
{0x052b,0x11b8,0x01b9},
{0x0516,0x1170,0x01b2},
{0x0501,0x1128,0x01ab},
{0x04ec,0x10e0,0x01a4},
{0x04d7,0x1098,0x019d},
{0x04c2,0x1050,0x0196},
{0x04ad,0x1008,0x018f},
{0x0498,0x0fc0,0x0188},
{0x0483,0x0f78,0x0181},
{0x046e,0x0f30,0x017a},
{0x0459,0x0ee8,0x0173},
{0x0444,0x0ea0,0x016c},
{0x042f,0x0e58,0x0165},
{0x041a,0x0e10,0x015e},
{0x0405,0x0dc8,0x0157},
{0x03f0,0x0d80,0x0150},
{0x03db,0x0d38,0x0149},
{0x03c6,0x0cf0,0x0142},
{0x03b1,0x0ca8,0x013b},
{0x039c,0x0c60,0x0134},
{0x0387,0x0c18,0x012d},
{0x0372,0x0bd0,0x0126},
{0x035d,0x0b88,0x011f},
{0x0348,0x0b40,0x0118},
{0x0333,0x0af8,0x0111},
{0x031e,0x0ab0,0x010a},
{0x0309,0x0a68,0x0103},
{0x02f4,0x0a20,0x00fc},
{0x02df,0x09d8,0x00f5},
{0x02ca,0x0990,0x00ee},
{0x02b5,0x0948,0x00e7},
{0x02a0,0x0900,0x00e0},
{0x028b,0x08b8,0x00d9},
{0x0276,0x0870,0x00d2},
{0x0261,0x0828,0x00cb},
{0x024c,0x07e0,0x00c4},
{0x0237,0x0798,0x00bd},
{0x0222,0x0750,0x00b6},
{0x020d,0x0708,0x00af},
{0x01f8,0x06c0,0x00a8},
{0x01e3,0x0678,0x00a1},
{0x01ce,0x0630,0x009a},
{0x01b9,0x05e8,0x0093},
{0x01a4,0x05a0,0x008c},
{0x018f,0x0558,0x0085},
{0x017a,0x0510,0x007e},
{0x0165,0x04c8,0x0077},
{0x0150,0x0480,0x0070},
{0x013b,0x0438,0x0069},
{0x0126,0x03f0,0x0062},
{0x0111,0x03a8,0x005b},
{0x00fc,0x0360,0x0054},
{0x00e7,0x0318,0x004d},
{0x00d2,0x02d0,0x0046},
{0x00bd,0x0288,0x003f},
{0x00a8,0x0240,0x0038},
{0x0093,0x01f8,0x0031},
{0x007e,0x01b0,0x002a},
{0x0069,0x0168,0x0023},
{0x0054,0x0120,0x001c},
{0x003f,0x00d8,0x0015},
{0x002a,0x0090,0x000e},
{0x0015,0x0048,0x0007},
{0x0000,0x0000,0x0000},
{0x0015,0x0048,0x0007},
{0x002a,0x0090,0x000e},
{0x003f,0x00d8,0x0015},
{0x0054,0x0120,0x001c},
{0x0069,0x0168,0x0023},
{0x007e,0x01b0,0x002a},
{0x0093,0x01f8,0x0031},
{0x00a8,0x0240,0x0038},
{0x00bd,0x0288,0x003f},
{0x00d2,0x02d0,0x0046},
{0x00e7,0x0318,0x004d},
{0x00fc,0x0360,0x0054},
{0x0111,0x03a8,0x005b},
{0x0126,0x03f0,0x0062},
{0x013b,0x0438,0x0069},
{0x0150,0x0480,0x0070},
{0x0165,0x04c8,0x0077},
{0x017a,0x0510,0x007e},
{0x018f,0x0558,0x0085},
{0x01a4,0x05a0,0x008c},
{0x01b9,0x05e8,0x0093},
{0x01ce,0x0630,0x009a},
{0x01e3,0x0678,0x00a1},
{0x01f8,0x06c0,0x00a8},
{0x020d,0x0708,0x00af},
{0x0222,0x0750,0x00b6},
{0x0237,0x0798,0x00bd},
{0x024c,0x07e0,0x00c4},
{0x0261,0x0828,0x00cb},
{0x0276,0x0870,0x00d2},
{0x028b,0x08b8,0x00d9},
{0x02a0,0x0900,0x00e0},
{0x02b5,0x0948,0x00e7},
{0x02ca,0x0990,0x00ee},
{0x02df,0x09d8,0x00f5},
{0x02f4,0x0a20,0x00fc},
{0x0309,0x0a68,0x0103},
{0x031e,0x0ab0,0x010a},
{0x0333,0x0af8,0x0111},
{0x0348,0x0b40,0x0118},
{0x035d,0x0b88,0x011f},
{0x0372,0x0bd0,0x0126},
{0x0387,0x0c18,0x012d},
{0x039c,0x0c60,0x0134},
{0x03b1,0x0ca8,0x013b},
{0x03c6,0x0cf0,0x0142},
{0x03db,0x0d38,0x0149},
{0x03f0,0x0d80,0x0150},
{0x0405,0x0dc8,0x0157},
{0x041a,0x0e10,0x015e},
{0x042f,0x0e58,0x0165},
{0x0444,0x0ea0,0x016c},
{0x0459,0x0ee8,0x0173},
{0x046e,0x0f30,0x017a},
{0x0483,0x0f78,0x0181},
{0x0498,0x0fc0,0x0188},
{0x04ad,0x1008,0x018f},
{0x04c2,0x1050,0x0196},
{0x04d7,0x1098,0x019d},
{0x04ec,0x10e0,0x01a4},
{0x0501,0x1128,0x01ab},
{0x0516,0x1170,0x01b2},
{0x052b,0x11b8,0x01b9},
{0x0540,0x1200,0x01c0},
{0x0555,0x1248,0x01c7},
{0x056a,0x1290,0x01ce},
{0x057f,0x12d8,0x01d5},
{0x0594,0x1320,0x01dc},
{0x05a9,0x1368,0x01e3},
{0x05be,0x13b0,0x01ea},
{0x05d3,0x13f8,0x01f1},
{0x05e8,0x1440,0x01f8},
{0x05fd,0x1488,0x01ff},
{0x0612,0x14d0,0x0206},
{0x0627,0x1518,0x020d},
{0x063c,0x1560,0x0214},
{0x0651,0x15a8,0x021b},
{0x0666,0x15f0,0x0222},
{0x067b,0x1638,0x0229},
{0x0690,0x1680,0x0230},
{0x06a5,0x16c8,0x0237},
{0x06ba,0x1710,0x023e},
{0x06cf,0x1758,0x0245},
{0x06e4,0x17a0,0x024c},
{0x06f9,0x17e8,0x0253},
{0x070e,0x1830,0x025a},
{0x0723,0x1878,0x0261},
{0x0738,0x18c0,0x0268},
{0x074d,0x1908,0x026f},
{0x0762,0x1950,0x0276},
{0x0777,0x1998,0x027d},
{0x078c,0x19e0,0x0284},
{0x07a1,0x1a28,0x028b},
{0x07b6,0x1a70,0x0292},
{0x07cb,0x1ab8,0x0299},
{0x07e0,0x1b00,0x02a0},
{0x07f5,0x1b48,0x02a7},
{0x080a,0x1b90,0x02ae},
{0x081f,0x1bd8,0x02b5},
{0x0834,0x1c20,0x02bc},
{0x0849,0x1c68,0x02c3},
{0x085e,0x1cb0,0x02ca},
{0x0873,0x1cf8,0x02d1},
{0x0888,0x1d40,0x02d8},
{0x089d,0x1d88,0x02df},
{0x08b2,0x1dd0,0x02e6},
{0x08c7,0x1e18,0x02ed},
{0x08dc,0x1e60,0x02f4},
{0x08f1,0x1ea8,0x02fb},
{0x0906,0x1ef0,0x0302},
{0x091b,0x1f38,0x0309},
{0x0930,0x1f80,0x0310},
{0x0945,0x1fc8,0x0317},
{0x095a,0x2010,0x031e},
{0x096f,0x2058,0x0325},
{0x0984,0x20a0,0x032c},
{0x0999,0x20e8,0x0333},
{0x09ae,0x2130,0x033a},
{0x09c3,0x2178,0x0341},
{0x09d8,0x21c0,0x0348},
{0x09ed,0x2208,0x034f},
{0x0a02,0x2250,0x0356},
{0x0a17,0x2298,0x035d},
{0x0a2c,0x22e0,0x0364},
{0x0a41,0x2328,0x036b},
{0x0a56,0x2370,0x0372},
{0x0a6b,0x23b8,0x0379},
{0x0a80,0x2400,0x0380},
{0x0a95,0x2448,0x0387},
{0x0aaa,0x2490,0x038e},
{0x0abf,0x24d8,0x0395},
{0x0ad4,0x2520,0x039c},
{0x0ae9,0x2568,0x03a3},
{0x0afe,0x25b0,0x03aa},
{0x0b13,0x25f8,0x03b1},
{0x0b28,0x2640,0x03b8},
{0x0b3d,0x2688,0x03bf},
{0x0b52,0x26d0,0x03c6},
{0x0b67,0x2718,0x03cd},
{0x0b7c,0x2760,0x03d4},
{0x0b91,0x27a8,0x03db},
{0x0ba6,0x27f0,0x03e2},
{0x0bbb,0x2838,0x03e9},
{0x0bd0,0x2880,0x03f0},
{0x0be5,0x28c8,0x03f7},
{0x0bfa,0x2910,0x03fe},
{0x0c0f,0x2958,0x0405},
{0x0c24,0x29a0,0x040c},
{0x0c39,0x29e8,0x0413},
{0x0c4e,0x2a30,0x041a},
{0x0c63,0x2a78,0x0421},
{0x0c78,0x2ac0,0x0428},
{0x0c8d,0x2b08,0x042f},
{0x0ca2,0x2b50,0x0436},
{0x0cb7,0x2b98,0x043d},
{0x0ccc,0x2be0,0x0444},
{0x0ce1,0x2c28,0x044b},
{0x0cf6,0x2c70,0x0452},
{0x0d0b,0x2cb8,0x0459},
{0x0d20,0x2d00,0x0460},
{0x0d35,0x2d48,0x0467},
{0x0d4a,0x2d90,0x046e},
{0x0d5f,0x2dd8,0x0475},
{0x0d74,0x2e20,0x047c},
{0x0d89,0x2e68,0x0483},
{0x0d9e,0x2eb0,0x048a},
{0x0db3,0x2ef8,0x0491},
{0x0dc8,0x2f40,0x0498},
{0x0ddd,0x2f88,0x049f},
{0x0df2,0x2fd0,0x04a6},
{0x0e07,0x3018,0x04ad},
{0x0e1c,0x3060,0x04b4},
{0x0e31,0x30a8,0x04bb},
{0x0e46,0x30f0,0x04c2},
{0x0e5b,0x3138,0x04c9},
{0x0e70,0x3180,0x04d0},
{0x0e85,0x31c8,0x04d7},
{0x0e9a,0x3210,0x04de},
{0x0eaf,0x3258,0x04e5},
{0x0ec4,0x32a0,0x04ec},
{0x0ed9,0x32e8,0x04f3},
{0x0eee,0x3330,0x04fa},
{0x0f03,0x3378,0x0501},
{0x0f18,0x33c0,0x0508},
{0x0f2d,0x3408,0x050f},
{0x0f42,0x3450,0x0516},
{0x0f57,0x3498,0x051d},
{0x0f6c,0x34e0,0x0524},
{0x0f81,0x3528,0x052b},
{0x0f96,0x3570,0x0532},
{0x0fab,0x35b8,0x0539},
{0x0fc0,0x3600,0x0540},
{0x0fd5,0x3648,0x0547},
{0x0fea,0x3690,0x054e},
{0x0fff,0x36d8,0x0555},
{0x1014,0x3720,0x055c},
{0x1029,0x3768,0x0563},
{0x103e,0x37b0,0x056a},
{0x1053,0x37f8,0x0571},
{0x1068,0x3840,0x0578},
{0x107d,0x3888,0x057f},
{0x1092,0x38d0,0x0586},
{0x10a7,0x3918,0x058d},
{0x10bc,0x3960,0x0594},
{0x10d1,0x39a8,0x059b},
{0x10e6,0x39f0,0x05a2},
{0x10fb,0x3a38,0x05a9},
{0x1110,0x3a80,0x05b0},
{0x1125,0x3ac8,0x05b7},
{0x113a,0x3b10,0x05be},
{0x114f,0x3b58,0x05c5},
{0x1164,0x3ba0,0x05cc},
{0x1179,0x3be8,0x05d3},
{0x118e,0x3c30,0x05da},
{0x11a3,0x3c78,0x05e1},
{0x11b8,0x3cc0,0x05e8},
{0x11cd,0x3d08,0x05ef},
{0x11e2,0x3d50,0x05f6},
{0x11f7,0x3d98,0x05fd},
{0x120c,0x3de0,0x0604},
{0x1221,0x3e28,0x060b},
{0x1236,0x3e70,0x0612},
{0x124b,0x3eb8,0x0619},
{0x1260,0x3f00,0x0620},
{0x1275,0x3f48,0x0627},
{0x128a,0x3f90,0x062e},
{0x129f,0x3fd8,0x0635},
{0x12b4,0x4020,0x063c},
{0x12c9,0x4068,0x0643},
{0x12de,0x40b0,0x064a},
{0x12f3,0x40f8,0x0651},
{0x1308,0x4140,0x0658},
{0x131d,0x4188,0x065f},
{0x1332,0x41d0,0x0666},
{0x1347,0x4218,0x066d},
{0x135c,0x4260,0x0674},
{0x1371,0x42a8,0x067b},
{0x1386,0x42f0,0x0682},
{0x139b,0x4338,0x0689},
{0x13b0,0x4380,0x0690},
{0x13c5,0x43c8,0x0697},
{0x13da,0x4410,0x069e},
{0x13ef,0x4458,0x06a5},
{0x1404,0x44a0,0x06ac},
{0x1419,0x44e8,0x06b3},
{0x142e,0x4530,0x06ba},
{0x1443,0x4578,0x06c1},
{0x1458,0x45c0,0x06c8},
{0x146d,0x4608,0x06cf},
{0x1482,0x4650,0x06d6},
{0x1497,0x4698,0x06dd},
{0x14ac,0x46e0,0x06e4},
{0x14c1,0x4728,0x06eb},
{0x14d6,0x4770,0x06f2},
{0x14eb,0x47b8,0x06f9}
};
/*
* this maps the absolute values of r/g/b to an r/g/b
*
* first 256 entries unused
* second 256 entries HPCR-values
*/
static const GLshort errorHPCR[ERROR_RANGE][4] = { /* make it aligned, red = 0(error, result*8), green = 2(error, result*8), blue = 4(error, result*8) */