[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[1727] 2008-07-24 Bean <address@hidden>
From: |
Bean |
Subject: |
[1727] 2008-07-24 Bean <address@hidden> |
Date: |
Thu, 24 Jul 2008 15:02:37 +0000 |
Revision: 1727
http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=1727
Author: bean
Date: 2008-07-24 15:02:36 +0000 (Thu, 24 Jul 2008)
Log Message:
-----------
2008-07-24 Bean <address@hidden>
* video/reader/png.c (DELFATE_HLIT_MAX): Change value.
(grub_png_init_fixed_block): New function.
(grub_png_decode_image_data): Handle fixed huffman code compression.
Modified Paths:
--------------
trunk/grub2/ChangeLog
trunk/grub2/video/readers/png.c
Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog 2008-07-24 14:56:30 UTC (rev 1726)
+++ trunk/grub2/ChangeLog 2008-07-24 15:02:36 UTC (rev 1727)
@@ -1,5 +1,11 @@
2008-07-24 Bean <address@hidden>
+ * video/reader/png.c (DELFATE_HLIT_MAX): Change value.
+ (grub_png_init_fixed_block): New function.
+ (grub_png_decode_image_data): Handle fixed huffman code compression.
+
+2008-07-24 Bean <address@hidden>
+
* common.rmk (bin_UTILITIES): Add grub-pe2elf.
(grub_pe2elf_SOURCES): New macro.
(CLEANFILES): Add grub-pe2elf.
Modified: trunk/grub2/video/readers/png.c
===================================================================
--- trunk/grub2/video/readers/png.c 2008-07-24 14:56:30 UTC (rev 1726)
+++ trunk/grub2/video/readers/png.c 2008-07-24 15:02:36 UTC (rev 1727)
@@ -68,7 +68,7 @@
#define DEFLATE_HCLEN_BASE 4
#define DEFLATE_HCLEN_MAX 19
#define DEFLATE_HLIT_BASE 257
-#define DEFLATE_HLIT_MAX 286
+#define DEFLATE_HLIT_MAX 288
#define DEFLATE_HDIST_BASE 1
#define DEFLATE_HDIST_MAX 30
@@ -391,6 +391,41 @@
}
static grub_err_t
+grub_png_init_fixed_block (struct grub_png_data *data)
+{
+ int i;
+
+ grub_png_init_huff_table (&data->code_table, DEFLATE_HUFF_LEN,
+ data->code_values, data->code_maxval,
+ data->code_offset);
+
+ for (i = 0; i < 144; i++)
+ grub_png_insert_huff_item (&data->code_table, i, 8);
+
+ for (; i < 256; i++)
+ grub_png_insert_huff_item (&data->code_table, i, 9);
+
+ for (; i < 280; i++)
+ grub_png_insert_huff_item (&data->code_table, i, 7);
+
+ for (; i < DEFLATE_HLIT_MAX; i++)
+ grub_png_insert_huff_item (&data->code_table, i, 8);
+
+ grub_png_build_huff_table (&data->code_table);
+
+ grub_png_init_huff_table (&data->dist_table, DEFLATE_HUFF_LEN,
+ data->dist_values, data->dist_maxval,
+ data->dist_offset);
+
+ for (i = 0; i < DEFLATE_HDIST_MAX; i++)
+ grub_png_insert_huff_item (&data->dist_table, i, 5);
+
+ grub_png_build_huff_table (&data->dist_table);
+
+ return grub_errno;
+}
+
+static grub_err_t
grub_png_init_dynamic_block (struct grub_png_data *data)
{
int nl, nd, nb, i, prev;
@@ -699,8 +734,9 @@
}
case INFLATE_FIXED:
- return grub_error (GRUB_ERR_BAD_FILE_TYPE,
- "png: block type fixed not supported");
+ grub_png_init_fixed_block (data);
+ grub_png_read_dynamic_block (data);
+ break;
case INFLATE_DYNAMIC:
grub_png_init_dynamic_block (data);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [1727] 2008-07-24 Bean <address@hidden>,
Bean <=