/*************************************************************************** * __________ __ ___. * Open \______ \ ____ ____ | | _\_ |__ _______ ___ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ * \/ \/ \/ \/ \/ * $Id$ * * JPEG image viewer * (This is a real mess if it has to be coded in one single C file) * * File scrolling addition (C) 2005 Alexander Spyridakis * Copyright (C) 2004 Jörg Hohensohn aka [IDC]Dragon * Heavily borrowed from the IJG implementation (C) Thomas G. Lane * Small & fast downscaling IDCT (C) 2002 by Guido Vollbeding JPEGclub.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ****************************************************************************/ #ifndef _JPEG_JPEG_DECODER_H #define _JPEG_JPEG_DECODER_H #define HUFF_LOOKAHEAD 8 /* # of bits of lookahead */ struct derived_tbl { /* Basic tables: (element [0] of each array is unused) */ long mincode[17]; /* smallest code of length k */ long maxcode[18]; /* largest code of length k (-1 if none) */ /* (maxcode[17] is a sentinel to ensure huff_DECODE terminates) */ int valptr[17]; /* huffval[] index of 1st symbol of length k */ /* Back link to public Huffman table (needed only in slow_DECODE) */ int* pub; /* Lookahead tables: indexed by the next HUFF_LOOKAHEAD bits of the input data stream. If the next Huffman code is no more than HUFF_LOOKAHEAD bits long, we can obtain its length and the corresponding symbol directly from these tables. */ int look_nbits[1<