Stefan Reinauer | d650e99 | 2010-02-22 04:33:13 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2001 by Michael Schroeder |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License as |
| 8 | * published by the Free Software Foundation; version 2 of |
| 9 | * the License. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, |
| 19 | * MA 02110-1301 USA |
| 20 | */ |
| 21 | |
| 22 | /* |
| 23 | * a tiny jpeg decoder. |
| 24 | * |
| 25 | * written in August 2001 by Michael Schroeder <mls@suse.de> |
| 26 | */ |
| 27 | |
| 28 | #ifndef __JPEG_H |
| 29 | #define __JPEG_H |
| 30 | |
| 31 | #define ERR_NO_SOI 1 |
| 32 | #define ERR_NOT_8BIT 2 |
| 33 | #define ERR_HEIGHT_MISMATCH 3 |
| 34 | #define ERR_WIDTH_MISMATCH 4 |
| 35 | #define ERR_BAD_WIDTH_OR_HEIGHT 5 |
| 36 | #define ERR_TOO_MANY_COMPPS 6 |
| 37 | #define ERR_ILLEGAL_HV 7 |
| 38 | #define ERR_QUANT_TABLE_SELECTOR 8 |
| 39 | #define ERR_NOT_YCBCR_221111 9 |
| 40 | #define ERR_UNKNOWN_CID_IN_SCAN 10 |
| 41 | #define ERR_NOT_SEQUENTIAL_DCT 11 |
| 42 | #define ERR_WRONG_MARKER 12 |
| 43 | #define ERR_NO_EOI 13 |
| 44 | #define ERR_BAD_TABLES 14 |
| 45 | #define ERR_DEPTH_MISMATCH 15 |
| 46 | |
| 47 | struct jpeg_decdata { |
| 48 | int dcts[6 * 64 + 16]; |
| 49 | int out[64 * 6]; |
| 50 | int dquant[3][64]; |
| 51 | }; |
| 52 | |
| 53 | int jpeg_decode(unsigned char *, unsigned char *, int, int, int, struct jpeg_decdata *); |
| 54 | int jpeg_check_size(unsigned char *, int, int); |
| 55 | |
| 56 | #endif |