Bean <[EMAIL PROTECTED]> writes: > On Jan 14, 2008 2:31 AM, Marco Gerards <[EMAIL PROTECTED]> 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 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel