Angel Pons | 118a9c7 | 2020-04-02 23:48:34 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* This file is part of the coreboot project. */ |
Stefan Reinauer | d650e99 | 2010-02-22 04:33:13 +0000 | [diff] [blame] | 3 | |
| 4 | /* |
| 5 | * a tiny jpeg decoder. |
| 6 | * |
| 7 | * written in August 2001 by Michael Schroeder <mls@suse.de> |
| 8 | */ |
| 9 | |
| 10 | #ifndef __JPEG_H |
| 11 | #define __JPEG_H |
| 12 | |
| 13 | #define ERR_NO_SOI 1 |
| 14 | #define ERR_NOT_8BIT 2 |
| 15 | #define ERR_HEIGHT_MISMATCH 3 |
| 16 | #define ERR_WIDTH_MISMATCH 4 |
| 17 | #define ERR_BAD_WIDTH_OR_HEIGHT 5 |
| 18 | #define ERR_TOO_MANY_COMPPS 6 |
| 19 | #define ERR_ILLEGAL_HV 7 |
| 20 | #define ERR_QUANT_TABLE_SELECTOR 8 |
| 21 | #define ERR_NOT_YCBCR_221111 9 |
| 22 | #define ERR_UNKNOWN_CID_IN_SCAN 10 |
| 23 | #define ERR_NOT_SEQUENTIAL_DCT 11 |
| 24 | #define ERR_WRONG_MARKER 12 |
| 25 | #define ERR_NO_EOI 13 |
| 26 | #define ERR_BAD_TABLES 14 |
| 27 | #define ERR_DEPTH_MISMATCH 15 |
| 28 | |
| 29 | struct jpeg_decdata { |
| 30 | int dcts[6 * 64 + 16]; |
| 31 | int out[64 * 6]; |
| 32 | int dquant[3][64]; |
| 33 | }; |
| 34 | |
Lee Leahy | 7340217 | 2017-03-10 15:23:24 -0800 | [diff] [blame] | 35 | int jpeg_decode(unsigned char *, unsigned char *, int, int, int, |
| 36 | struct jpeg_decdata *); |
Patrick Georgi | 246179a | 2015-08-09 18:23:10 +0200 | [diff] [blame] | 37 | void jpeg_fetch_size(unsigned char *buf, int *width, int *height); |
Stefan Reinauer | d650e99 | 2010-02-22 04:33:13 +0000 | [diff] [blame] | 38 | int jpeg_check_size(unsigned char *, int, int); |
| 39 | |
| 40 | #endif |