2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: iljpgdecodeint.h /main/3 1995/10/23 15:54:54 rswiston $ */
24 /**---------------------------------------------------------------------
26 *** (c)Copyright 1992 Hewlett-Packard Co.
28 *** RESTRICTED RIGHTS LEGEND
29 *** Use, duplication, or disclosure by the U.S. Government is subject to
30 *** restrictions as set forth in sub-paragraph (c)(1)(ii) of the Rights in
31 *** Technical Data and Computer Software clause in DFARS 252.227-7013.
32 *** Hewlett-Packard Company
33 *** 3000 Hanover Street
34 *** Palo Alto, CA 94304 U.S.A.
35 *** Rights for non-DOD U.S. Government Departments and Agencies are as set
36 *** forth in FAR 52.227-19(c)(1,2).
38 ***-------------------------------------------------------------------*/
40 #ifndef ILJPGDECODEINT_H
41 #define ILJPGDECODEINT_H
44 #include "iljpgdecode.h"
51 /* Codes returned from _iljpgHuffmanDecode() indicating which coefficients
52 of the 8x8 block are non-zero.
54 #define HUFF_DC_ONLY 0 /* only DCT non-zero */
55 #define HUFF_FOURX4 1 /* only top-left 4x4 matrix non-zero */
56 #define HUFF_FULL 2 /* "whole" 8x8 non-zero */
59 /* Private data for decoding JPEG (not JIF), e.g.
60 _iljpgDecodeInit/Execute/Cleanup().
64 float *pRevScale; /* built from DCT Q table */
65 int horiFactor, vertFactor; /* copied from iljpgDataRec */
66 long width, height; /* size of output buffer */
67 int mcuXInc, mcuYInc; /* value to inc (x,y) by, each MCU */
68 long x, y; /* where to store next MCU */
69 int lastDC; /* DC from previous 8x8 block */
70 } iljpgCompRec, *iljpgCompPtr;
73 iljpgDataPtr pData; /* data passed to _iljpgDecodeInit() */
74 int mcuRestartCount; /* # of mcu's since last restart */
75 iljpgPtr pHuffPriv; /* owned by iljpgdehuff.c */
76 float *DCTRevScaleTables[4]; /* owned by iljpgdedct.c */
77 iljpgCompRec compData[ILJPG_MAX_COMPS]; /* owned by iljpgdecode.c */
78 } iljpgDecodePrivRec, *iljpgDecodePrivPtr;
81 /* Functions in iljpgdehuff.c */
83 iljpgError _iljpgDehuffInit (
84 iljpgDecodePrivPtr pPriv
88 iljpgError _iljpgDehuffCleanup (
89 iljpgDecodePrivPtr pPriv
93 iljpgError _iljpgDehuffReset (
94 iljpgDecodePrivPtr pPriv
98 iljpgError _iljpgDehuffExecute (
99 iljpgDecodePrivPtr pPriv,
100 ILJPG_DECODE_STREAM stream,
103 unsigned int *pBlockType
106 /* Functions in iljpgdedct.c */
108 iljpgError _iljpgDeDCTInit (
109 iljpgDecodePrivPtr pPriv
113 iljpgError _iljpgDeDCTCleanup (
114 iljpgDecodePrivPtr pPriv
118 void _iljpgDeDCTFull (
121 iljpgPtr ix, /* RETURNED */
126 void _iljpgDeDCT4x4 (
129 iljpgPtr ix, /* RETURNED */
134 void _iljpgDeDCTDCOnly (
137 iljpgPtr pDst, /* RETURNED */