Stefan Reinauer | d650e99 | 2010-02-22 04:33:13 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
Uwe Hermann | 548dbe7 | 2010-02-22 16:41:49 +0000 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 2001 Michael Schroeder |
Stefan Reinauer | d650e99 | 2010-02-22 04:33:13 +0000 | [diff] [blame] | 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 |
Uwe Hermann | 548dbe7 | 2010-02-22 16:41:49 +0000 | [diff] [blame] | 8 | * published by the Free Software Foundation; version 2 of the License. |
Stefan Reinauer | d650e99 | 2010-02-22 04:33:13 +0000 | [diff] [blame] | 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
Stefan Reinauer | d650e99 | 2010-02-22 04:33:13 +0000 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | /* |
| 17 | * a tiny jpeg decoder. |
| 18 | * |
| 19 | * written in August 2001 by Michael Schroeder <mls@suse.de> |
| 20 | */ |
| 21 | |
| 22 | #ifndef __JPEG_H |
| 23 | #define __JPEG_H |
| 24 | |
| 25 | #define ERR_NO_SOI 1 |
| 26 | #define ERR_NOT_8BIT 2 |
| 27 | #define ERR_HEIGHT_MISMATCH 3 |
| 28 | #define ERR_WIDTH_MISMATCH 4 |
| 29 | #define ERR_BAD_WIDTH_OR_HEIGHT 5 |
| 30 | #define ERR_TOO_MANY_COMPPS 6 |
| 31 | #define ERR_ILLEGAL_HV 7 |
| 32 | #define ERR_QUANT_TABLE_SELECTOR 8 |
| 33 | #define ERR_NOT_YCBCR_221111 9 |
| 34 | #define ERR_UNKNOWN_CID_IN_SCAN 10 |
| 35 | #define ERR_NOT_SEQUENTIAL_DCT 11 |
| 36 | #define ERR_WRONG_MARKER 12 |
| 37 | #define ERR_NO_EOI 13 |
| 38 | #define ERR_BAD_TABLES 14 |
| 39 | #define ERR_DEPTH_MISMATCH 15 |
| 40 | |
| 41 | struct jpeg_decdata { |
| 42 | int dcts[6 * 64 + 16]; |
| 43 | int out[64 * 6]; |
| 44 | int dquant[3][64]; |
| 45 | }; |
| 46 | |
Lee Leahy | 7340217 | 2017-03-10 15:23:24 -0800 | [diff] [blame] | 47 | int jpeg_decode(unsigned char *, unsigned char *, int, int, int, |
| 48 | struct jpeg_decdata *); |
Patrick Georgi | 246179a | 2015-08-09 18:23:10 +0200 | [diff] [blame] | 49 | void jpeg_fetch_size(unsigned char *buf, int *width, int *height); |
Stefan Reinauer | d650e99 | 2010-02-22 04:33:13 +0000 | [diff] [blame] | 50 | int jpeg_check_size(unsigned char *, int, int); |
| 51 | |
| 52 | #endif |