From: Marco Gerards <mgerards@xs4all.nl>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] jpeg image reader
Date: Tue, 15 Jan 2008 12:01:47 +0100 [thread overview]
Message-ID: <87abn74ajo.fsf@xs4all.nl> (raw)
In-Reply-To: <ca0f59980801140836m429c1db6r9026b49dfb936a51@mail.gmail.com> (bean123ch@gmail.com's message of "Tue, 15 Jan 2008 00:36:26 +0800")
Bean <bean123ch@gmail.com> writes:
> On Jan 14, 2008 2:31 AM, Marco Gerards <mgerards@xs4all.nl> wrote:
>> > /*
>> > * GRUB -- GRand Unified Bootloader
>> > * Copyright (C) 2008 Free Software Foundation, Inc.
>>
>> Did you write all the code yourself?
>
> yes, but i take some code segment from Independent JPEG Group's
> implementation, such as idct transformation and ycrcb -> rgb
> conversion.
I do not think these algorithms can be copyrighted and are in the
public domain? Can you check this?
Colorspace convertion can be easily done. I might even have some self
written code for this. As for the IDCT, I could do that too, if it is
problematic?
> please remind me if something is left out.
I don't see anything you missed. Please see this last comment below.
> static grub_err_t
> grub_jpeg_decode_sof (struct grub_jpeg_data *data)
> {
> int i, cc;
> grub_uint32_t next_marker;
>
> next_marker = data->file->offset;
> next_marker += grub_jpeg_get_word (data);
>
> if (grub_jpeg_get_byte (data) != 8)
> return grub_error (GRUB_ERR_BAD_FILE_TYPE,
> "jpeg: only 8-bit precision is supported");
>
> data->image_height = grub_jpeg_get_word (data);
> data->image_width = grub_jpeg_get_word (data);
>
> if ((!data->image_height) || (!data->image_width))
> return grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: invalid image size");
>
> cc = grub_jpeg_get_byte (data);
> if (cc != 3)
> return grub_error (GRUB_ERR_BAD_FILE_TYPE,
> "jpeg: component count must be 3");
>
> for (i = 0; i < cc; i++)
> {
> int id, ss;
>
> id = grub_jpeg_get_byte (data) - 1;
> if ((id < 0) || (id >= 3))
> return grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: invalid index");
>
> ss = grub_jpeg_get_byte (data); /* sampling factor */
> if (!id)
> {
> data->vs = ss & 0xF; /* vertical sampling */
> data->hs = ss >> 4; /* horizontal sampling */
Please use correct interpunction.
--
Marco
next prev parent reply other threads:[~2008-01-15 11:01 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-09 17:21 [PATCH] jpeg image reader Bean
2008-01-09 17:56 ` Bean
2008-01-09 20:33 ` Vesa Jääskeläinen
2008-01-10 10:12 ` Bean
2008-01-12 8:51 ` Bean
2008-01-13 8:49 ` Bean
2008-01-13 18:31 ` Marco Gerards
2008-01-14 16:36 ` Bean
2008-01-15 11:01 ` Marco Gerards [this message]
2008-01-15 11:52 ` Robert Millan
2008-01-15 12:21 ` Marco Gerards
2008-01-15 12:29 ` Robert Millan
2008-01-15 12:46 ` Marco Gerards
2008-01-15 13:36 ` Bean
2008-01-15 14:25 ` Marco Gerards
2008-01-15 13:54 ` Bean
2008-01-15 14:27 ` Marco Gerards
2008-01-15 14:36 ` Bean
2008-01-15 16:01 ` Marco Gerards
2008-01-15 16:15 ` Bean
2008-01-15 20:48 ` Bean
2008-01-21 10:21 ` Marco Gerards
2008-01-22 14:04 ` Bean
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87abn74ajo.fsf@xs4all.nl \
--to=mgerards@xs4all.nl \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.