DEFLATE compression
How does GRUB support decompressing DEFLATE compressed data? Based on my reading of io/gzio.c, it looks like a gzip header is required to inflate deflated data.
I am implementing a new font format and will be embedding multiple blocks of compressed bitmaps in the font file for a good combination of space efficient on-disk storage and fast read performance during use. A block of character bitmaps will only be read from the file and decompressed at run time when a character within that block is needed. After that, when any character in the block is needed, it is already decompressed in memory for quick access.
I was going to use DEFLATE compression, it looks like I may have to add the gzip structure to it, which seems silly since it's just a block of data within my file.
Also, is it possible to tell the gzio module to decompress a block of data beginning at a specific offset in the file?
Regards,
Colin
Quoted 12 lines · Colin D Bennett
How does GRUB support decompressing DEFLATE compressed data? Based on my reading of
io/gzio.c, it looks like a gzip header is required to inflate deflated data.I am implementing a new font format and will be embedding multiple blocks of compressed bitmaps in the font file for a good combination of space efficient on-disk storage and fast read performance during use. A block of character bitmaps will only be read from the file and decompressed at run time when a character within that block is needed. After that, when any character in the block is needed, it is already decompressed in memory for quick access.
Quoted 6 lines
I was going to use DEFLATE compression, it looks like I may have to add the gzip structure to it, which seems silly since it's just a block of data within my file.
Also, is it possible to tell the gzio module to decompress a block of data beginning at a specific offset in the file?
Hi,
I think it's better to move the deflate decompression function into a separate module, instead of relying on gzio. I have written similar deflate function for pnp.c, but it uses callback mode, which call a function to retrieve the next character. It'd be nice to unify all deflate decompression in one module, but you need to be careful about the interface, so that it can be used in both situation (direct and callback mode).
Signature · 1 line
Bean
Quoted 22 lines · Bean
Quoted 12 lines · Colin D Bennett
How does GRUB support decompressing DEFLATE compressed data? Based on my reading of
io/gzio.c, it looks like a gzip header is required to inflate deflated data.I am implementing a new font format and will be embedding multiple blocks of compressed bitmaps in the font file for a good combination of space efficient on-disk storage and fast read performance during use. A block of character bitmaps will only be read from the file and decompressed at run time when a character within that block is needed. After that, when any character in the block is needed, it is already decompressed in memory for quick access.
Quoted 6 lines
I was going to use DEFLATE compression, it looks like I may have to add the gzip structure to it, which seems silly since it's just a block of data within my file.
Also, is it possible to tell the gzio module to decompress a block of data beginning at a specific offset in the file?
Hi,
Quoted 7 lines
I think it's better to move the deflate decompression function into a separate module, instead of relying on gzio. I have written similar deflate function for
pnp.c, but it uses callback mode, which call a function to retrieve the next character. It'd be nice to unify all deflate decompression in one module, but you need to be careful about the interface, so that it can be used in both situation (direct and callback mode).
Hi Bean,
Can you check the interface as you have previously worked with it? This would free Colin to work on more important aspects.
Thanks,
Vesa Jääskeläinen
Quoted 4 lines · Vesa Jääskeläinen
Hi Bean,
Can you check the interface as you have previously worked with it? This would free Colin to work on more important aspects.
Hi,
Ok. But I have other things to fix at the moment, is this urgent ?
Signature · 1 line
Bean
Quoted 10 lines · Bean
Quoted 4 lines · Vesa Jääskeläinen
Hi Bean,
Can you check the interface as you have previously worked with it? This would free Colin to work on more important aspects.
Hi,
Ok. But I have other things to fix at the moment, is this urgent ?
Nope. Take your time. Uncompressed format is Ok for now, but later it should be compressed.
Thanks,
Vesa Jääskeläinen
Quoted 10 lines · On Mon, 23 Jun 2008 23:25:13 +0800 Bean <[email protected]> wrote:
Quoted 4 lines · Vesa Jääskeläinen
Hi Bean,
Can you check the interface as you have previously worked with it? This would free Colin to work on more important aspects.
Hi,
Ok. But I have other things to fix at the moment, is this urgent ?
It is not urgent. I will defer implementing font compression until a later date, as it is not critical to the design or functionality: it is merely a nice optimization.
Thanks,
Colin