Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JEjXR-0004E5-On for mharc-grub-devel@gnu.org; Tue, 15 Jan 2008 06:01:01 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JEjXQ-0004Dp-HP for grub-devel@gnu.org; Tue, 15 Jan 2008 06:01:00 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JEjXO-0004Db-Sy for grub-devel@gnu.org; Tue, 15 Jan 2008 06:01:00 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JEjXO-0004DY-P3 for grub-devel@gnu.org; Tue, 15 Jan 2008 06:00:58 -0500 Received: from smtp-vbr15.xs4all.nl ([194.109.24.35]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JEjXO-0005B0-7A for grub-devel@gnu.org; Tue, 15 Jan 2008 06:00:58 -0500 Received: from localhost.localdomain (249-174.surfsnel.dsl.internl.net [145.99.174.249]) by smtp-vbr15.xs4all.nl (8.13.8/8.13.8) with ESMTP id m0FB0pEq054247 for ; Tue, 15 Jan 2008 12:00:52 +0100 (CET) (envelope-from mgerards@xs4all.nl) From: Marco Gerards To: The development of GRUB 2 References: <47852F7C.6030407@nic.fi> <874pdhh920.fsf@xs4all.nl> Mail-Copies-To: mgerards@xs4all.nl Date: Tue, 15 Jan 2008 12:01:47 +0100 In-Reply-To: (bean123ch@gmail.com's message of "Tue, 15 Jan 2008 00:36:26 +0800") Message-ID: <87abn74ajo.fsf@xs4all.nl> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by XS4ALL Virus Scanner X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 Subject: Re: [PATCH] jpeg image reader X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jan 2008 11:01:00 -0000 Bean writes: > On Jan 14, 2008 2:31 AM, Marco Gerards 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