[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] jpeg image reader
From: |
Marco Gerards |
Subject: |
Re: [PATCH] jpeg image reader |
Date: |
Tue, 15 Jan 2008 12:01:47 +0100 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) |
Bean <address@hidden> writes:
> On Jan 14, 2008 2:31 AM, Marco Gerards <address@hidden> 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
- [PATCH] jpeg image reader, Bean, 2008/01/09
- Re: [PATCH] jpeg image reader, Bean, 2008/01/09
- Re: [PATCH] jpeg image reader, Vesa Jääskeläinen, 2008/01/09
- Re: [PATCH] jpeg image reader, Bean, 2008/01/10
- Re: [PATCH] jpeg image reader, Bean, 2008/01/12
- Re: [PATCH] jpeg image reader, Bean, 2008/01/13
- Re: [PATCH] jpeg image reader, Marco Gerards, 2008/01/13
- Re: [PATCH] jpeg image reader, Bean, 2008/01/14
- Re: [PATCH] jpeg image reader,
Marco Gerards <=
- Re: [PATCH] jpeg image reader, Robert Millan, 2008/01/15
- Re: [PATCH] jpeg image reader, Marco Gerards, 2008/01/15
- Re: [PATCH] jpeg image reader, Robert Millan, 2008/01/15
- Re: [PATCH] jpeg image reader, Marco Gerards, 2008/01/15
- Re: [PATCH] jpeg image reader, Bean, 2008/01/15
- Re: [PATCH] jpeg image reader, Marco Gerards, 2008/01/15
- Re: [PATCH] jpeg image reader, Bean, 2008/01/15
- Re: [PATCH] jpeg image reader, Marco Gerards, 2008/01/15
- Re: [PATCH] jpeg image reader, Bean, 2008/01/15
- Re: [PATCH] jpeg image reader, Marco Gerards, 2008/01/15