From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VRAFg-00075D-Gw for mharc-grub-devel@gnu.org; Tue, 01 Oct 2013 20:25:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRAFS-0006w6-VQ for grub-devel@gnu.org; Tue, 01 Oct 2013 20:25:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VRAFK-00077q-CM for grub-devel@gnu.org; Tue, 01 Oct 2013 20:25:02 -0400 Received: from mail-ea0-x22a.google.com ([2a00:1450:4013:c01::22a]:62234) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRAFJ-00077e-Ot for grub-devel@gnu.org; Tue, 01 Oct 2013 20:24:54 -0400 Received: by mail-ea0-f170.google.com with SMTP id h14so36051eak.15 for ; Tue, 01 Oct 2013 17:24:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type; bh=9o6ZMJXli/5tmT+UPde0r8RrEucmAInc5fh3q3yBpZA=; b=eaC8rFcIMxX53sjJ7umG4rumkrilWCCFwcJlyVwd/dUVHkmsdlVuTephwJ43rSPBrh FpR9H4kSIt9zdYHRNw+si/aTGl6QHXMLOCm4FLxJRRiwOeHq5drkFgZ6YD4OPfJBkKvB lenAnnjDxcuvQLKasTUDcmns3XfjwC2k2mR9m5gVxoVHUBiSSC1j7xSoLUpRNvu62Nwm 24H+sNeyL4eqD6NEE29EwL0EBT5mNiBrdGr2oIWxAEIE8QGsxB2juh0JcBckA/6bsrnh JtUILWs84zQtIs49mfXJBEjSjkCoW1qLfhDVZAQjzuEs5UG+QQZDVvy3+Z2hEjpUN/Vn kPhQ== X-Received: by 10.14.198.197 with SMTP id v45mr134181een.52.1380673492438; Tue, 01 Oct 2013 17:24:52 -0700 (PDT) Received: from [192.168.1.113] (31-249.1-85.cust.bluewin.ch. [85.1.249.31]) by mx.google.com with ESMTPSA id a43sm18776269eep.9.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Oct 2013 17:24:51 -0700 (PDT) Message-ID: <524B67D2.20107@gmail.com> Date: Wed, 02 Oct 2013 02:24:50 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130821 Icedove/17.0.8 MIME-Version: 1.0 To: The development of GRUB 2 Subject: Adam7 and narrow PNG X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="----enig2LPKQIXGOSWNCMNNLIUQL" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::22a X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 00:25:15 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2LPKQIXGOSWNCMNNLIUQL Content-Type: multipart/mixed; boundary="------------080705010609090701040604" This is a multi-part message in MIME format. --------------080705010609090701040604 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable It was reported that GRUB doesn't support Adam7 and paletteed PNGs. Attached patch would implement both of them but combining them results in quite complex code since PNG works on bytes even if bpp <=3D 4 but adam7 works on pixels. Does anyone have thoughts on adam7 and narrow PNG usefulness? --------------080705010609090701040604 Content-Type: text/x-diff; name="png.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="png.diff" =3D=3D=3D modified file 'grub-core/video/readers/png.c' --- grub-core/video/readers/png.c 2013-09-28 01:04:34 +0000 +++ grub-core/video/readers/png.c 2013-09-28 21:51:16 +0000 @@ -31,7 +31,6 @@ =20 enum { - PNG_COLOR_TYPE_GRAY =3D 0, PNG_COLOR_MASK_PALETTE =3D 1, PNG_COLOR_MASK_COLOR =3D 2, PNG_COLOR_MASK_ALPHA =3D 4, @@ -40,8 +39,11 @@ =20 #define PNG_COMPRESSION_BASE 0 =20 -#define PNG_INTERLACE_NONE 0 -#define PNG_INTERLACE_ADAM7 1 +enum + { + PNG_INTERLACE_NONE =3D 0, + PNG_INTERLACE_ADAM7 =3D 1 + }; =20 #define PNG_FILTER_TYPE_BASE 0 =20 @@ -88,6 +90,28 @@ int num_values, max_length; }; =20 +struct interlace_stage +{ + int start_x, start_y; + int log_step_x, log_step_y; +}; + +static struct interlace_stage interleave_none[] =3D + { + { 0, 0, 0, 0 } + }; + +static struct interlace_stage interleave_adam7[] =3D + { + { 0, 0, 3, 3 }, + { 4, 0, 3, 3 }, + { 0, 4, 2, 3 }, + { 2, 0, 2, 2 }, + { 0, 2, 1, 2 }, + { 1, 0, 1, 1 }, + { 0, 1, 0, 1 } + }; + struct grub_png_data { grub_file_t file; @@ -99,6 +123,8 @@ =20 int image_width, image_height, bpp, is_16bit; int raw_bytes, is_gray, is_alpha, is_palette; + int row_bytes, row_bytes_i, row_bytes_i2, color_bits; + int skip; grub_uint8_t *image_data; =20 int inside_idat, idat_remain; @@ -119,9 +145,15 @@ grub_uint8_t slide[WSIZE]; int wp; =20 - grub_uint8_t *cur_rgb; + grub_uint8_t *cur_rgb, *rgb0; =20 int cur_column, cur_filter, first_line; + int cur_component; + + struct interlace_stage *cur_interleave; + int n_interleave; + + int is_adam7; }; =20 static grub_uint32_t @@ -245,6 +277,7 @@ int color_type; int color_bits; enum grub_video_blit_format blt; + grub_uint8_t interleave; =20 data->image_width =3D grub_png_get_dword (data); data->image_height =3D grub_png_get_dword (data); @@ -253,9 +286,6 @@ return grub_error (GRUB_ERR_BAD_FILE_TYPE, "png: invalid image size"= ); =20 color_bits =3D grub_png_get_byte (data); - if ((color_bits !=3D 8) && (color_bits !=3D 16)) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, - "png: bit depth must be 8 or 16"); data->is_16bit =3D (color_bits =3D=3D 16); =20 color_type =3D grub_png_get_byte (data); @@ -283,6 +313,13 @@ data->bpp =3D 1; } =20 + if ((color_bits !=3D 8) && (color_bits !=3D 16) + && ((color_bits !=3D 4 && color_bits !=3D 2 + && color_bits !=3D 1) + || !(data->is_gray || data->is_palette))) + return grub_error (GRUB_ERR_BAD_FILE_TYPE, + "png: bit depth must be 8 or 16"); + if (color_type & PNG_COLOR_MASK_ALPHA) data->bpp++; =20 @@ -294,30 +331,29 @@ if (data->is_16bit) data->bpp <<=3D 1; =20 + data->color_bits =3D color_bits; + data->row_bytes =3D data->image_width * data->bpp; + if (data->color_bits <=3D 4) + data->row_bytes =3D (data->image_width * data->color_bits + 7) / 8 += 16; + #ifndef GRUB_CPU_WORDS_BIGENDIAN if (data->is_16bit || data->is_gray || data->is_palette) #endif { - data->image_data =3D grub_malloc (data->image_height * - data->image_width * data->bpp); + data->image_data =3D grub_malloc (data->image_height * data->row_b= ytes); if (grub_errno) return grub_errno; =20 - data->cur_rgb =3D data->image_data; + data->rgb0 =3D data->image_data; } #ifndef GRUB_CPU_WORDS_BIGENDIAN else { data->image_data =3D 0; - data->cur_rgb =3D (*data->bitmap)->data; + data->rgb0 =3D (*data->bitmap)->data; } #endif =20 - data->raw_bytes =3D data->image_height * (data->image_width * data->bp= p + 1); - - data->cur_column =3D 0; - data->first_line =3D 1; - if (grub_png_get_byte (data) !=3D PNG_COMPRESSION_BASE) return grub_error (GRUB_ERR_BAD_FILE_TYPE, "png: compression method not supported"); @@ -326,9 +362,22 @@ return grub_error (GRUB_ERR_BAD_FILE_TYPE, "png: filter method not supported"); =20 - if (grub_png_get_byte (data) !=3D PNG_INTERLACE_NONE) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, - "png: interlace method not supported"); + interleave =3D grub_png_get_byte (data); + switch (interleave) + { + case PNG_INTERLACE_NONE: + data->cur_interleave =3D interleave_none - 1; + data->n_interleave =3D ARRAY_SIZE (interleave_none); + break; + case PNG_INTERLACE_ADAM7: + data->cur_interleave =3D interleave_adam7 - 1; + data->n_interleave =3D ARRAY_SIZE (interleave_adam7); + data->is_adam7 =3D 1; + break; + default: + return grub_error (GRUB_ERR_BAD_FILE_TYPE, + "png: interlace method not supported"); + } =20 /* Skip crc checksum. */ grub_png_get_dword (data); @@ -567,104 +616,189 @@ static grub_err_t grub_png_output_byte (struct grub_png_data *data, grub_uint8_t n) { - int row_bytes; - - if (--data->raw_bytes < 0) + while (data->raw_bytes =3D=3D 0 && data->n_interleave) + { + int rows_i; + data->cur_interleave++; + + data->cur_rgb =3D data->rgb0; + + rows_i =3D (data->image_width >> data->cur_interleave->log_step_x)= ; + if (data->color_bits <=3D 4) + { + data->row_bytes_i =3D (rows_i * data->color_bits + 7) / 8;=09 + data->skip =3D ((1 << data->cur_interleave->log_step_x) - 1); + data->cur_rgb +=3D data->cur_interleave->start_x; + } + else + { + data->row_bytes_i =3D rows_i * data->bpp; + + data->skip =3D ((1 << data->cur_interleave->log_step_x) - 1) * data->= bpp; + data->cur_rgb +=3D data->cur_interleave->start_x * data->bpp; + } + + data->row_bytes_i2 =3D data->row_bytes_i + + data->skip * (data->row_bytes_i / data->bpp); + + data->raw_bytes =3D (data->image_height >> data->cur_interleave->l= og_step_y) + * (data->row_bytes_i + 1); + + data->cur_column =3D 0; + data->cur_filter =3D 0; + data->first_line =3D 1; + data->cur_component =3D 0; + data->cur_rgb +=3D data->cur_interleave->start_y * data->row_bytes= ; + data->n_interleave--; + } + + data->raw_bytes--; + + if (data->raw_bytes < 0) return grub_error (GRUB_ERR_BAD_FILE_TYPE, "image size overflown"); =20 if (data->cur_column =3D=3D 0) { if (n >=3D PNG_FILTER_VALUE_LAST) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, "invalid filter value"); + return grub_error (GRUB_ERR_BAD_FILE_TYPE, "invalid filter value %d", n= ); =20 data->cur_filter =3D n; + if (!data->first_line) + data->cur_rgb +=3D (1 << data->cur_interleave->log_step_y) + * data->row_bytes - data->row_bytes_i2; } else - *data->cur_rgb++ =3D n; + { + *data->cur_rgb++ =3D n; + data->cur_component++; + if (data->cur_component =3D=3D data->bpp) + { + data->cur_component =3D 0; + data->cur_rgb +=3D data->skip; + } + } =20 data->cur_column++; - row_bytes =3D data->image_width * data->bpp; - if (data->cur_column =3D=3D row_bytes + 1) + + if (data->cur_column =3D=3D data->row_bytes_i + 1) { grub_uint8_t *blank_line =3D NULL; - grub_uint8_t *cur =3D data->cur_rgb - row_bytes; + grub_uint8_t *cur =3D data->cur_rgb - data->row_bytes_i2; grub_uint8_t *left =3D cur; grub_uint8_t *up; =20 if (data->first_line) { - blank_line =3D grub_zalloc (row_bytes); + blank_line =3D grub_zalloc (data->row_bytes); if (blank_line =3D=3D NULL) return grub_errno; =20 up =3D blank_line; } else - up =3D cur - row_bytes; + up =3D cur - (data->row_bytes << data->cur_interleave->log_step_y); =20 switch (data->cur_filter) { case PNG_FILTER_VALUE_SUB: { - int i; + int i, j; =20 - cur +=3D data->bpp; - for (i =3D data->bpp; i < row_bytes; i++, cur++, left++) - *cur +=3D *left; + cur +=3D data->bpp + data->skip; + for (i =3D data->bpp; i < data->row_bytes; ) + { + for (j =3D 0; j < data->bpp; j++) + { + *cur +=3D *left; + i++, cur++, left++; + } + i +=3D data->skip; + cur +=3D data->skip; + left +=3D data->skip; + } =20 break; } case PNG_FILTER_VALUE_UP: { - int i; - - for (i =3D 0; i < row_bytes; i++, cur++, up++) - *cur +=3D *up; - + int i, j; + + for (i =3D 0; i < data->row_bytes; ) + { + for (j =3D 0; j < data->bpp; j++) + { + *cur +=3D *up; + i++, cur++, up++; + } + i +=3D data->skip; + cur +=3D data->skip; + up +=3D data->skip; + } break; } case PNG_FILTER_VALUE_AVG: { - int i; + int i, j; =20 for (i =3D 0; i < data->bpp; i++, cur++, up++) *cur +=3D *up >> 1; =20 - for (; i < row_bytes; i++, cur++, up++, left++) - *cur +=3D ((int) *up + (int) *left) >> 1; + i +=3D data->skip; + cur +=3D data->skip; + up +=3D data->skip; + + for (; i < data->row_bytes; ) + { + for (j =3D 0; j < data->bpp; j++) + { + *cur +=3D ((int) *up + (int) *left) >> 1; + i++, cur++, up++, left++; + } + i+=3D data->skip, cur+=3D data->skip, up+=3D data->skip, left+=3D data= ->skip; + } =20 break; } case PNG_FILTER_VALUE_PAETH: { - int i; + int i, j; grub_uint8_t *upper_left =3D up; =20 for (i =3D 0; i < data->bpp; i++, cur++, up++) *cur +=3D *up; =20 - for (; i < row_bytes; i++, cur++, up++, left++, upper_left++) + i +=3D data->skip; + cur +=3D data->skip; + up +=3D data->skip; + + for (; i < data->row_bytes; ) { - int a, b, c, pa, pb, pc; - - a =3D *left; - b =3D *up; - c =3D *upper_left; - - pa =3D b - c; - pb =3D a - c; - pc =3D pa + pb; - - if (pa < 0) - pa =3D -pa; - - if (pb < 0) - pb =3D -pb; - - if (pc < 0) - pc =3D -pc; - - *cur +=3D ((pa <=3D pb) && (pa <=3D pc)) ? a : (pb <=3D = pc) ? b : c; + for (j =3D 0; j < data->bpp; j++) + { + int a, b, c, pa, pb, pc; + + a =3D *left; + b =3D *up; + c =3D *upper_left; + + pa =3D b - c; + pb =3D a - c; + pc =3D pa + pb; + + if (pa < 0) + pa =3D -pa; + + if (pb < 0) + pb =3D -pb; + + if (pc < 0) + pc =3D -pc; + + *cur +=3D ((pa <=3D pb) && (pa <=3D pc)) ? a : (pb <=3D pc) ? b : = c; + i++, cur++, up++, left++, upper_left++; + } + i+=3Ddata->skip, cur+=3Ddata->skip, up+=3Ddata->skip; + left+=3Ddata->skip, upper_left+=3Ddata->skip; } } } @@ -809,6 +943,8 @@ static const grub_uint8_t png_magic[8] =3D { 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0x0a }; =20 +#include "png_adam7.c" + static void grub_png_convert_image (struct grub_png_data *data) { @@ -836,6 +972,87 @@ #define B3 2 #endif =20 + if (data->color_bits <=3D 4) + { + grub_uint8_t palette[16][3]; + grub_uint8_t *dc; + int shift =3D 8 - data->color_bits; + int mask =3D (1 << data->color_bits) - 1; + int j; + if (data->is_gray) + for (i =3D 0; i < (1 << data->color_bits); i++) + { + grub_uint8_t col =3D (0xff * i) / ((1 << data->color_bits) - 1); + palette[i][0] =3D col; + palette[i][1] =3D col; + palette[i][2] =3D col; + } + else + grub_memcpy (palette, data->palette, 16 * 3); + dc =3D d2; + /* Our algorithms work on bytes in case of color depth <=3D 4. + Usually it's no problem as PNG specs does the same. However + Adam7 always works on pixels, so we need this additional shuffling. + */ + if (data->is_adam7) + { + int klen =3D 16; + if (data->color_bits =3D=3D 2) + klen =3D 32; + if (data->color_bits =3D=3D 1) + klen =3D 64; + for (j =3D 0; j < data->image_height; j++) + { + const grub_uint8_t (*remap)[2] =3D NULL; + int k; + + if (data->color_bits =3D=3D 4) + remap =3D adam7_remap_4bit[j%8]; + if (data->color_bits =3D=3D 2) + remap =3D adam7_remap_2bit[j%8]; + if (data->color_bits =3D=3D 1) + remap =3D adam7_remap_1bit[j%8]; + d2 =3D dc; + dc +=3D data->row_bytes; + for (i =3D 0, k =3D 0; i < data->image_width; + i++, d1 +=3D 3) + { + grub_uint8_t col =3D (d2[remap[k][0]] >> remap[k][1]) & mask; + d1[R3] =3D data->palette[col][2]; + d1[G3] =3D data->palette[col][1]; + d1[B3] =3D data->palette[col][0]; + k++; + if (k =3D=3D klen) + { + d2 +=3D 8; + k =3D 0; + } + } + } + } + else + for (j =3D 0; j < data->image_height; j++) + { + d2 =3D dc; + dc +=3D data->row_bytes; + for (i =3D 0; i < data->image_width; + i++, d1 +=3D 3) + { + grub_uint8_t col =3D (d2[0] >> shift) & mask; + d1[R3] =3D data->palette[col][2]; + d1[G3] =3D data->palette[col][1]; + d1[B3] =3D data->palette[col][0]; + shift -=3D data->color_bits; + if (shift < 0) + { + d2++; + shift +=3D 8; + } + } + } + return; + } + if (data->is_palette) { for (i =3D 0; i < (data->image_width * data->image_height); =3D=3D=3D added file 'grub-core/video/readers/png_adam7.c' --- grub-core/video/readers/png_adam7.c 1970-01-01 00:00:00 +0000 +++ grub-core/video/readers/png_adam7.c 2013-09-28 21:10:18 +0000 @@ -0,0 +1,171 @@ +static const grub_uint8_t adam7_remap_4bit[8][16][2] =3D=20 + { + { { 0, 4 }, { 1, 4 }, { 2, 4 }, { 1, 0 }, { 4, 4 }, { 3, 4 }, + { 2, 0 }, { 3, 0 }, { 0, 0 }, { 5, 4 }, { 6, 4 }, { 5, 0 }, + { 4, 0 }, { 7, 4 }, { 6, 0 }, { 7, 0 }, }, + { { 0, 4 }, { 0, 0 }, { 1, 4 }, { 1, 0 }, { 2, 4 }, { 2, 0 }, + { 3, 4 }, { 3, 0 }, { 4, 4 }, { 4, 0 }, { 5, 4 }, { 5, 0 }, + { 6, 4 }, { 6, 0 }, { 7, 4 }, { 7, 0 }, }, + { { 0, 4 }, { 1, 4 }, { 0, 0 }, { 1, 0 }, { 2, 4 }, { 3, 4 }, + { 2, 0 }, { 3, 0 }, { 4, 4 }, { 5, 4 }, { 4, 0 }, { 5, 0 }, + { 6, 4 }, { 7, 4 }, { 6, 0 }, { 7, 0 }, }, + { { 0, 4 }, { 0, 0 }, { 1, 4 }, { 1, 0 }, { 2, 4 }, { 2, 0 }, + { 3, 4 }, { 3, 0 }, { 4, 4 }, { 4, 0 }, { 5, 4 }, { 5, 0 }, + { 6, 4 }, { 6, 0 }, { 7, 4 }, { 7, 0 }, }, + { { 0, 4 }, { 1, 4 }, { 2, 4 }, { 1, 0 }, { 0, 0 }, { 3, 4 }, + { 2, 0 }, { 3, 0 }, { 4, 4 }, { 5, 4 }, { 6, 4 }, { 5, 0 }, + { 4, 0 }, { 7, 4 }, { 6, 0 }, { 7, 0 }, }, + { { 0, 4 }, { 0, 0 }, { 1, 4 }, { 1, 0 }, { 2, 4 }, { 2, 0 }, + { 3, 4 }, { 3, 0 }, { 4, 4 }, { 4, 0 }, { 5, 4 }, { 5, 0 }, + { 6, 4 }, { 6, 0 }, { 7, 4 }, { 7, 0 }, }, + { { 0, 4 }, { 1, 4 }, { 0, 0 }, { 1, 0 }, { 2, 4 }, { 3, 4 }, + { 2, 0 }, { 3, 0 }, { 4, 4 }, { 5, 4 }, { 4, 0 }, { 5, 0 }, + { 6, 4 }, { 7, 4 }, { 6, 0 }, { 7, 0 }, }, + { { 0, 4 }, { 0, 0 }, { 1, 4 }, { 1, 0 }, { 2, 4 }, { 2, 0 }, + { 3, 4 }, { 3, 0 }, { 4, 4 }, { 4, 0 }, { 5, 4 }, { 5, 0 }, + { 6, 4 }, { 6, 0 }, { 7, 4 }, { 7, 0 }, }, + }; + +static const grub_uint8_t adam7_remap_2bit[8][32][2] =3D=20 + { + { { 0, 6 }, { 1, 6 }, { 2, 6 }, { 1, 4 }, { 4, 6 }, { 1, 2 }, + { 2, 4 }, { 1, 0 }, { 0, 4 }, { 3, 6 }, { 2, 2 }, { 3, 4 }, + { 4, 4 }, { 3, 2 }, { 2, 0 }, { 3, 0 }, { 0, 2 }, { 5, 6 }, + { 6, 6 }, { 5, 4 }, { 4, 2 }, { 5, 2 }, { 6, 4 }, { 5, 0 }, + { 0, 0 }, { 7, 6 }, { 6, 2 }, { 7, 4 }, { 4, 0 }, { 7, 2 }, + { 6, 0 }, { 7, 0 }, }, + { { 0, 6 }, { 0, 4 }, { 0, 2 }, { 0, 0 }, { 1, 6 }, { 1, 4 }, + { 1, 2 }, { 1, 0 }, { 2, 6 }, { 2, 4 }, { 2, 2 }, { 2, 0 }, + { 3, 6 }, { 3, 4 }, { 3, 2 }, { 3, 0 }, { 4, 6 }, { 4, 4 }, + { 4, 2 }, { 4, 0 }, { 5, 6 }, { 5, 4 }, { 5, 2 }, { 5, 0 }, + { 6, 6 }, { 6, 4 }, { 6, 2 }, { 6, 0 }, { 7, 6 }, { 7, 4 }, + { 7, 2 }, { 7, 0 }, }, + { { 0, 6 }, { 1, 6 }, { 0, 4 }, { 1, 4 }, { 0, 2 }, { 1, 2 }, + { 0, 0 }, { 1, 0 }, { 2, 6 }, { 3, 6 }, { 2, 4 }, { 3, 4 }, + { 2, 2 }, { 3, 2 }, { 2, 0 }, { 3, 0 }, { 4, 6 }, { 5, 6 }, + { 4, 4 }, { 5, 4 }, { 4, 2 }, { 5, 2 }, { 4, 0 }, { 5, 0 }, + { 6, 6 }, { 7, 6 }, { 6, 4 }, { 7, 4 }, { 6, 2 }, { 7, 2 }, + { 6, 0 }, { 7, 0 }, }, + { { 0, 6 }, { 0, 4 }, { 0, 2 }, { 0, 0 }, { 1, 6 }, { 1, 4 }, + { 1, 2 }, { 1, 0 }, { 2, 6 }, { 2, 4 }, { 2, 2 }, { 2, 0 }, + { 3, 6 }, { 3, 4 }, { 3, 2 }, { 3, 0 }, { 4, 6 }, { 4, 4 }, + { 4, 2 }, { 4, 0 }, { 5, 6 }, { 5, 4 }, { 5, 2 }, { 5, 0 }, + { 6, 6 }, { 6, 4 }, { 6, 2 }, { 6, 0 }, { 7, 6 }, { 7, 4 }, + { 7, 2 }, { 7, 0 }, }, + { { 0, 6 }, { 1, 6 }, { 2, 6 }, { 1, 4 }, { 0, 4 }, { 1, 2 }, + { 2, 4 }, { 1, 0 }, { 0, 2 }, { 3, 6 }, { 2, 2 }, { 3, 4 }, + { 0, 0 }, { 3, 2 }, { 2, 0 }, { 3, 0 }, { 4, 6 }, { 5, 6 }, + { 6, 6 }, { 5, 4 }, { 4, 4 }, { 5, 2 }, { 6, 4 }, { 5, 0 }, + { 4, 2 }, { 7, 6 }, { 6, 2 }, { 7, 4 }, { 4, 0 }, { 7, 2 }, + { 6, 0 }, { 7, 0 }, }, + { { 0, 6 }, { 0, 4 }, { 0, 2 }, { 0, 0 }, { 1, 6 }, { 1, 4 }, + { 1, 2 }, { 1, 0 }, { 2, 6 }, { 2, 4 }, { 2, 2 }, { 2, 0 }, + { 3, 6 }, { 3, 4 }, { 3, 2 }, { 3, 0 }, { 4, 6 }, { 4, 4 }, + { 4, 2 }, { 4, 0 }, { 5, 6 }, { 5, 4 }, { 5, 2 }, { 5, 0 }, + { 6, 6 }, { 6, 4 }, { 6, 2 }, { 6, 0 }, { 7, 6 }, { 7, 4 }, + { 7, 2 }, { 7, 0 }, }, + { { 0, 6 }, { 1, 6 }, { 0, 4 }, { 1, 4 }, { 0, 2 }, { 1, 2 }, + { 0, 0 }, { 1, 0 }, { 2, 6 }, { 3, 6 }, { 2, 4 }, { 3, 4 }, + { 2, 2 }, { 3, 2 }, { 2, 0 }, { 3, 0 }, { 4, 6 }, { 5, 6 }, + { 4, 4 }, { 5, 4 }, { 4, 2 }, { 5, 2 }, { 4, 0 }, { 5, 0 }, + { 6, 6 }, { 7, 6 }, { 6, 4 }, { 7, 4 }, { 6, 2 }, { 7, 2 }, + { 6, 0 }, { 7, 0 }, }, + { { 0, 6 }, { 0, 4 }, { 0, 2 }, { 0, 0 }, { 1, 6 }, { 1, 4 }, + { 1, 2 }, { 1, 0 }, { 2, 6 }, { 2, 4 }, { 2, 2 }, { 2, 0 }, + { 3, 6 }, { 3, 4 }, { 3, 2 }, { 3, 0 }, { 4, 6 }, { 4, 4 }, + { 4, 2 }, { 4, 0 }, { 5, 6 }, { 5, 4 }, { 5, 2 }, { 5, 0 }, + { 6, 6 }, { 6, 4 }, { 6, 2 }, { 6, 0 }, { 7, 6 }, { 7, 4 }, + { 7, 2 }, { 7, 0 }, }, + }; + +static const grub_uint8_t adam7_remap_1bit[8][64][2] =3D=20 + { + { { 0, 7 }, { 1, 7 }, { 2, 7 }, { 1, 6 }, { 4, 7 }, { 1, 5 }, + { 2, 6 }, { 1, 4 }, { 0, 6 }, { 1, 3 }, { 2, 5 }, { 1, 2 }, + { 4, 6 }, { 1, 1 }, { 2, 4 }, { 1, 0 }, { 0, 5 }, { 3, 7 }, + { 2, 3 }, { 3, 6 }, { 4, 5 }, { 3, 5 }, { 2, 2 }, { 3, 4 }, + { 0, 4 }, { 3, 3 }, { 2, 1 }, { 3, 2 }, { 4, 4 }, { 3, 1 }, + { 2, 0 }, { 3, 0 }, { 0, 3 }, { 5, 7 }, { 6, 7 }, { 5, 6 }, + { 4, 3 }, { 5, 5 }, { 6, 6 }, { 5, 4 }, { 0, 2 }, { 5, 3 }, + { 6, 5 }, { 5, 2 }, { 4, 2 }, { 5, 1 }, { 6, 4 }, { 5, 0 }, + { 0, 1 }, { 7, 7 }, { 6, 3 }, { 7, 6 }, { 4, 1 }, { 7, 5 }, + { 6, 2 }, { 7, 4 }, { 0, 0 }, { 7, 3 }, { 6, 1 }, { 7, 2 }, + { 4, 0 }, { 7, 1 }, { 6, 0 }, { 7, 0 }, }, + { { 0, 7 }, { 0, 6 }, { 0, 5 }, { 0, 4 }, { 0, 3 }, { 0, 2 }, + { 0, 1 }, { 0, 0 }, { 1, 7 }, { 1, 6 }, { 1, 5 }, { 1, 4 }, + { 1, 3 }, { 1, 2 }, { 1, 1 }, { 1, 0 }, { 2, 7 }, { 2, 6 }, + { 2, 5 }, { 2, 4 }, { 2, 3 }, { 2, 2 }, { 2, 1 }, { 2, 0 }, + { 3, 7 }, { 3, 6 }, { 3, 5 }, { 3, 4 }, { 3, 3 }, { 3, 2 }, + { 3, 1 }, { 3, 0 }, { 4, 7 }, { 4, 6 }, { 4, 5 }, { 4, 4 }, + { 4, 3 }, { 4, 2 }, { 4, 1 }, { 4, 0 }, { 5, 7 }, { 5, 6 }, + { 5, 5 }, { 5, 4 }, { 5, 3 }, { 5, 2 }, { 5, 1 }, { 5, 0 }, + { 6, 7 }, { 6, 6 }, { 6, 5 }, { 6, 4 }, { 6, 3 }, { 6, 2 }, + { 6, 1 }, { 6, 0 }, { 7, 7 }, { 7, 6 }, { 7, 5 }, { 7, 4 }, + { 7, 3 }, { 7, 2 }, { 7, 1 }, { 7, 0 }, }, + { { 0, 7 }, { 1, 7 }, { 0, 6 }, { 1, 6 }, { 0, 5 }, { 1, 5 }, + { 0, 4 }, { 1, 4 }, { 0, 3 }, { 1, 3 }, { 0, 2 }, { 1, 2 }, + { 0, 1 }, { 1, 1 }, { 0, 0 }, { 1, 0 }, { 2, 7 }, { 3, 7 }, + { 2, 6 }, { 3, 6 }, { 2, 5 }, { 3, 5 }, { 2, 4 }, { 3, 4 }, + { 2, 3 }, { 3, 3 }, { 2, 2 }, { 3, 2 }, { 2, 1 }, { 3, 1 }, + { 2, 0 }, { 3, 0 }, { 4, 7 }, { 5, 7 }, { 4, 6 }, { 5, 6 }, + { 4, 5 }, { 5, 5 }, { 4, 4 }, { 5, 4 }, { 4, 3 }, { 5, 3 }, + { 4, 2 }, { 5, 2 }, { 4, 1 }, { 5, 1 }, { 4, 0 }, { 5, 0 }, + { 6, 7 }, { 7, 7 }, { 6, 6 }, { 7, 6 }, { 6, 5 }, { 7, 5 }, + { 6, 4 }, { 7, 4 }, { 6, 3 }, { 7, 3 }, { 6, 2 }, { 7, 2 }, + { 6, 1 }, { 7, 1 }, { 6, 0 }, { 7, 0 }, }, + { { 0, 7 }, { 0, 6 }, { 0, 5 }, { 0, 4 }, { 0, 3 }, { 0, 2 }, + { 0, 1 }, { 0, 0 }, { 1, 7 }, { 1, 6 }, { 1, 5 }, { 1, 4 }, + { 1, 3 }, { 1, 2 }, { 1, 1 }, { 1, 0 }, { 2, 7 }, { 2, 6 }, + { 2, 5 }, { 2, 4 }, { 2, 3 }, { 2, 2 }, { 2, 1 }, { 2, 0 }, + { 3, 7 }, { 3, 6 }, { 3, 5 }, { 3, 4 }, { 3, 3 }, { 3, 2 }, + { 3, 1 }, { 3, 0 }, { 4, 7 }, { 4, 6 }, { 4, 5 }, { 4, 4 }, + { 4, 3 }, { 4, 2 }, { 4, 1 }, { 4, 0 }, { 5, 7 }, { 5, 6 }, + { 5, 5 }, { 5, 4 }, { 5, 3 }, { 5, 2 }, { 5, 1 }, { 5, 0 }, + { 6, 7 }, { 6, 6 }, { 6, 5 }, { 6, 4 }, { 6, 3 }, { 6, 2 }, + { 6, 1 }, { 6, 0 }, { 7, 7 }, { 7, 6 }, { 7, 5 }, { 7, 4 }, + { 7, 3 }, { 7, 2 }, { 7, 1 }, { 7, 0 }, }, + { { 0, 7 }, { 1, 7 }, { 2, 7 }, { 1, 6 }, { 0, 6 }, { 1, 5 }, + { 2, 6 }, { 1, 4 }, { 0, 5 }, { 1, 3 }, { 2, 5 }, { 1, 2 }, + { 0, 4 }, { 1, 1 }, { 2, 4 }, { 1, 0 }, { 0, 3 }, { 3, 7 }, + { 2, 3 }, { 3, 6 }, { 0, 2 }, { 3, 5 }, { 2, 2 }, { 3, 4 }, + { 0, 1 }, { 3, 3 }, { 2, 1 }, { 3, 2 }, { 0, 0 }, { 3, 1 }, + { 2, 0 }, { 3, 0 }, { 4, 7 }, { 5, 7 }, { 6, 7 }, { 5, 6 }, + { 4, 6 }, { 5, 5 }, { 6, 6 }, { 5, 4 }, { 4, 5 }, { 5, 3 }, + { 6, 5 }, { 5, 2 }, { 4, 4 }, { 5, 1 }, { 6, 4 }, { 5, 0 }, + { 4, 3 }, { 7, 7 }, { 6, 3 }, { 7, 6 }, { 4, 2 }, { 7, 5 }, + { 6, 2 }, { 7, 4 }, { 4, 1 }, { 7, 3 }, { 6, 1 }, { 7, 2 }, + { 4, 0 }, { 7, 1 }, { 6, 0 }, { 7, 0 }, }, + { { 0, 7 }, { 0, 6 }, { 0, 5 }, { 0, 4 }, { 0, 3 }, { 0, 2 }, + { 0, 1 }, { 0, 0 }, { 1, 7 }, { 1, 6 }, { 1, 5 }, { 1, 4 }, + { 1, 3 }, { 1, 2 }, { 1, 1 }, { 1, 0 }, { 2, 7 }, { 2, 6 }, + { 2, 5 }, { 2, 4 }, { 2, 3 }, { 2, 2 }, { 2, 1 }, { 2, 0 }, + { 3, 7 }, { 3, 6 }, { 3, 5 }, { 3, 4 }, { 3, 3 }, { 3, 2 }, + { 3, 1 }, { 3, 0 }, { 4, 7 }, { 4, 6 }, { 4, 5 }, { 4, 4 }, + { 4, 3 }, { 4, 2 }, { 4, 1 }, { 4, 0 }, { 5, 7 }, { 5, 6 }, + { 5, 5 }, { 5, 4 }, { 5, 3 }, { 5, 2 }, { 5, 1 }, { 5, 0 }, + { 6, 7 }, { 6, 6 }, { 6, 5 }, { 6, 4 }, { 6, 3 }, { 6, 2 }, + { 6, 1 }, { 6, 0 }, { 7, 7 }, { 7, 6 }, { 7, 5 }, { 7, 4 }, + { 7, 3 }, { 7, 2 }, { 7, 1 }, { 7, 0 }, }, + { { 0, 7 }, { 1, 7 }, { 0, 6 }, { 1, 6 }, { 0, 5 }, { 1, 5 }, + { 0, 4 }, { 1, 4 }, { 0, 3 }, { 1, 3 }, { 0, 2 }, { 1, 2 }, + { 0, 1 }, { 1, 1 }, { 0, 0 }, { 1, 0 }, { 2, 7 }, { 3, 7 }, + { 2, 6 }, { 3, 6 }, { 2, 5 }, { 3, 5 }, { 2, 4 }, { 3, 4 }, + { 2, 3 }, { 3, 3 }, { 2, 2 }, { 3, 2 }, { 2, 1 }, { 3, 1 }, + { 2, 0 }, { 3, 0 }, { 4, 7 }, { 5, 7 }, { 4, 6 }, { 5, 6 }, + { 4, 5 }, { 5, 5 }, { 4, 4 }, { 5, 4 }, { 4, 3 }, { 5, 3 }, + { 4, 2 }, { 5, 2 }, { 4, 1 }, { 5, 1 }, { 4, 0 }, { 5, 0 }, + { 6, 7 }, { 7, 7 }, { 6, 6 }, { 7, 6 }, { 6, 5 }, { 7, 5 }, + { 6, 4 }, { 7, 4 }, { 6, 3 }, { 7, 3 }, { 6, 2 }, { 7, 2 }, + { 6, 1 }, { 7, 1 }, { 6, 0 }, { 7, 0 }, }, + { { 0, 7 }, { 0, 6 }, { 0, 5 }, { 0, 4 }, { 0, 3 }, { 0, 2 }, + { 0, 1 }, { 0, 0 }, { 1, 7 }, { 1, 6 }, { 1, 5 }, { 1, 4 }, + { 1, 3 }, { 1, 2 }, { 1, 1 }, { 1, 0 }, { 2, 7 }, { 2, 6 }, + { 2, 5 }, { 2, 4 }, { 2, 3 }, { 2, 2 }, { 2, 1 }, { 2, 0 }, + { 3, 7 }, { 3, 6 }, { 3, 5 }, { 3, 4 }, { 3, 3 }, { 3, 2 }, + { 3, 1 }, { 3, 0 }, { 4, 7 }, { 4, 6 }, { 4, 5 }, { 4, 4 }, + { 4, 3 }, { 4, 2 }, { 4, 1 }, { 4, 0 }, { 5, 7 }, { 5, 6 }, + { 5, 5 }, { 5, 4 }, { 5, 3 }, { 5, 2 }, { 5, 1 }, { 5, 0 }, + { 6, 7 }, { 6, 6 }, { 6, 5 }, { 6, 4 }, { 6, 3 }, { 6, 2 }, + { 6, 1 }, { 6, 0 }, { 7, 7 }, { 7, 6 }, { 7, 5 }, { 7, 4 }, + { 7, 3 }, { 7, 2 }, { 7, 1 }, { 7, 0 }, }, + }; --------------080705010609090701040604-- ------enig2LPKQIXGOSWNCMNNLIUQL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlJLZ9IACgkQNak7dOguQgnkqgEAvI3uGb9p9q5DpKFhLJ5A0fe5 itmRCc6CJ/ElmNByXhkBAIFNuc4aR7HmqVU5D1ypy0TmPQ4NwTcitDEO2etdl478 =CW5f -----END PGP SIGNATURE----- ------enig2LPKQIXGOSWNCMNNLIUQL--