LMMS
Loading...
Searching...
No Matches
jdhuff.c
Go to the documentation of this file.
1/*
2 * jdhuff.c
3 *
4 * Copyright (C) 1991-1997, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains Huffman entropy decoding routines.
9 *
10 * Much of the complexity here has to do with supporting input suspension.
11 * If the data source module demands suspension, we want to be able to back
12 * up to the start of the current MCU. To do this, we copy state variables
13 * into local working storage, and update them back to the permanent
14 * storage only upon successful completion of an MCU.
15 */
16
17#define JPEG_INTERNALS
18#include "jinclude.h"
19#include "jpeglib.h"
20#include "jdhuff.h" /* Declarations shared with jdphuff.c */
21
22
23/*
24 * Expanded entropy decoder object for Huffman decoding.
25 *
26 * The savable_state subrecord contains fields that change within an MCU,
27 * but must not be updated permanently until we complete the MCU.
28 */
29
30typedef struct {
31 int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
33
34/* This macro is to work around compilers with missing or broken
35 * structure assignment. You'll need to fix this code if you have
36 * such a compiler and you change MAX_COMPS_IN_SCAN.
37 */
38
39#ifndef NO_STRUCT_ASSIGN
40#define ASSIGN_STATE(dest,src) ((dest) = (src))
41#else
42#if MAX_COMPS_IN_SCAN == 4
43#define ASSIGN_STATE(dest,src) \
44 ((dest).last_dc_val[0] = (src).last_dc_val[0], \
45 (dest).last_dc_val[1] = (src).last_dc_val[1], \
46 (dest).last_dc_val[2] = (src).last_dc_val[2], \
47 (dest).last_dc_val[3] = (src).last_dc_val[3])
48#endif
49#endif
50
51
52typedef struct {
53 struct jpeg_entropy_decoder pub; /* public fields */
54
55 /* These fields are loaded into local variables at start of each MCU.
56 * In case of suspension, we exit WITHOUT updating them.
57 */
58 bitread_perm_state bitstate; /* Bit buffer at start of MCU */
59 savable_state2 saved; /* Other state at start of MCU */
60
61 /* These fields are NOT loaded into local working state. */
62 unsigned int restarts_to_go; /* MCUs left in this restart interval */
63
64 /* Pointers to derived tables (these workspaces have image lifespan) */
67
68 /* Precalculated info set up by start_pass for use in decode_mcu: */
69
70 /* Pointers to derived tables to be used for each block within an MCU */
73 /* Whether we care about the DC and AC coefficient values for each block */
77
79
80
81/*
82 * Initialize for a Huffman-compressed scan.
83 */
84
85METHODDEF(void)
87{
88 huff_entropy_ptr2 entropy = (huff_entropy_ptr2) cinfo->entropy;
89 int ci, blkn, dctbl, actbl;
91
92 /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG.
93 * This ought to be an error condition, but we make it a warning because
94 * there are some baseline files out there with all zeroes in these bytes.
95 */
96 if (cinfo->Ss != 0 || cinfo->Se != DCTSIZE2-1 ||
97 cinfo->Ah != 0 || cinfo->Al != 0)
98 WARNMS(cinfo, JWRN_NOT_SEQUENTIAL);
99
100 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
101 compptr = cinfo->cur_comp_info[ci];
102 dctbl = compptr->dc_tbl_no;
103 actbl = compptr->ac_tbl_no;
104 /* Compute derived values for Huffman tables */
105 /* We may do this more than once for a table, but it's not expensive */
106 jpeg_make_d_derived_tbl(cinfo, TRUE, dctbl,
107 & entropy->dc_derived_tbls[dctbl]);
108 jpeg_make_d_derived_tbl(cinfo, FALSE, actbl,
109 & entropy->ac_derived_tbls[actbl]);
110 /* Initialize DC predictions to 0 */
111 entropy->saved.last_dc_val[ci] = 0;
112 }
113
114 /* Precalculate decoding info for each block in an MCU of this scan */
115 for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
116 ci = cinfo->MCU_membership[blkn];
117 compptr = cinfo->cur_comp_info[ci];
118 /* Precalculate which table to use for each block */
119 entropy->dc_cur_tbls[blkn] = entropy->dc_derived_tbls[compptr->dc_tbl_no];
120 entropy->ac_cur_tbls[blkn] = entropy->ac_derived_tbls[compptr->ac_tbl_no];
121 /* Decide whether we really care about the coefficient values */
122 if (compptr->component_needed) {
123 entropy->dc_needed[blkn] = TRUE;
124 /* we don't need the ACs if producing a 1/8th-size image */
125 entropy->ac_needed[blkn] = (compptr->DCT_scaled_size > 1);
126 } else {
127 entropy->dc_needed[blkn] = entropy->ac_needed[blkn] = FALSE;
128 }
129 }
130
131 /* Initialize bitread state variables */
132 entropy->bitstate.bits_left = 0;
133 entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */
134 entropy->pub.insufficient_data = FALSE;
135
136 /* Initialize restart counter */
137 entropy->restarts_to_go = cinfo->restart_interval;
138}
139
140
141/*
142 * Compute the derived values for a Huffman table.
143 * This routine also performs some validation checks on the table.
144 *
145 * Note this is also used by jdphuff.c.
146 */
147
148GLOBAL(void)
151{
153 d_derived_tbl *dtbl;
154 int p, i, l, si, numsymbols;
155 int lookbits, ctr;
156 char huffsize[257];
157 unsigned int huffcode[257];
158 unsigned int code;
159
160 /* Note that huffsize[] and huffcode[] are filled in code-length order,
161 * paralleling the order of the symbols themselves in htbl->huffval[].
162 */
163
164 /* Find the input Huffman table */
166 ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
167 htbl =
168 isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];
169 if (htbl == NULL)
170 ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
171
172 /* Allocate a workspace if we haven't already done so. */
173 if (*pdtbl == NULL)
174 *pdtbl = (d_derived_tbl *)
175 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
177 dtbl = *pdtbl;
178 dtbl->pub = htbl; /* fill in back link */
179
180 /* Figure C.1: make table of Huffman code length for each symbol */
181
182 p = 0;
183 for (l = 1; l <= 16; l++) {
184 i = (int) htbl->bits[l];
185 if (i < 0 || p + i > 256) /* protect against table overrun */
186 ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
187 while (i--)
188 huffsize[p++] = (char) l;
189 }
190 huffsize[p] = 0;
191 numsymbols = p;
192
193 /* Figure C.2: generate the codes themselves */
194 /* We also validate that the counts represent a legal Huffman code tree. */
195
196 code = 0;
197 si = huffsize[0];
198 p = 0;
199 while (huffsize[p]) {
200 while (((int) huffsize[p]) == si) {
201 huffcode[p++] = code;
202 code++;
203 }
204 /* code is now 1 more than the last code used for codelength si; but
205 * it must still fit in si bits, since no code is allowed to be all ones.
206 */
207 if (((INT32) code) >= (((INT32) 1) << si))
208 ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
209 code <<= 1;
210 si++;
211 }
212
213 /* Figure F.15: generate decoding tables for bit-sequential decoding */
214
215 p = 0;
216 for (l = 1; l <= 16; l++) {
217 if (htbl->bits[l]) {
218 /* valoffset[l] = huffval[] index of 1st symbol of code length l,
219 * minus the minimum code of length l
220 */
221 dtbl->valoffset[l] = (INT32) p - (INT32) huffcode[p];
222 p += htbl->bits[l];
223 dtbl->maxcode[l] = huffcode[p-1]; /* maximum code of length l */
224 } else {
225 dtbl->maxcode[l] = -1; /* -1 if no codes of this length */
226 }
227 }
228 dtbl->maxcode[17] = 0xFFFFFL; /* ensures jpeg_huff_decode terminates */
229
230 /* Compute lookahead tables to speed up decoding.
231 * First we set all the table entries to 0, indicating "too long";
232 * then we iterate through the Huffman codes that are short enough and
233 * fill in all the entries that correspond to bit sequences starting
234 * with that code.
235 */
236
237 MEMZERO(dtbl->look_nbits, SIZEOF(dtbl->look_nbits));
238
239 p = 0;
240 for (l = 1; l <= HUFF_LOOKAHEAD; l++) {
241 for (i = 1; i <= (int) htbl->bits[l]; i++, p++) {
242 /* l = current code's length, p = its index in huffcode[] & huffval[]. */
243 /* Generate left-justified code followed by all possible bit sequences */
244 lookbits = huffcode[p] << (HUFF_LOOKAHEAD-l);
245 for (ctr = 1 << (HUFF_LOOKAHEAD-l); ctr > 0; ctr--) {
246 dtbl->look_nbits[lookbits] = l;
247 dtbl->look_sym[lookbits] = htbl->huffval[p];
248 lookbits++;
249 }
250 }
251 }
252
253 /* Validate symbols as being reasonable.
254 * For AC tables, we make no check, but accept all byte values 0..255.
255 * For DC tables, we require the symbols to be in range 0..15.
256 * (Tighter bounds could be applied depending on the data depth and mode,
257 * but this is sufficient to ensure safe decoding.)
258 */
259 if (isDC) {
260 for (i = 0; i < numsymbols; i++) {
261 int sym = htbl->huffval[i];
262 if (sym < 0 || sym > 15)
263 ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
264 }
265 }
266}
267
268
269/*
270 * Out-of-line code for bit fetching (shared with jdphuff.c).
271 * See jdhuff.h for info about usage.
272 * Note: current values of get_buffer and bits_left are passed as parameters,
273 * but are returned in the corresponding fields of the state struct.
274 *
275 * On most machines MIN_GET_BITS should be 25 to allow the full 32-bit width
276 * of get_buffer to be used. (On machines with wider words, an even larger
277 * buffer could be used.) However, on some machines 32-bit shifts are
278 * quite slow and take time proportional to the number of places shifted.
279 * (This is true with most PC compilers, for instance.) In this case it may
280 * be a win to set MIN_GET_BITS to the minimum value of 15. This reduces the
281 * average shift distance at the cost of more calls to jpeg_fill_bit_buffer.
282 */
283
284#ifdef SLOW_SHIFT_32
285#define MIN_GET_BITS 15 /* minimum allowable value */
286#else
287#define MIN_GET_BITS (BIT_BUF_SIZE-7)
288#endif
289
290
291GLOBAL(boolean)
294 int nbits)
295/* Load up the bit buffer to a depth of at least nbits */
296{
297 /* Copy heavily used state fields into locals (hopefully registers) */
298 const JOCTET * next_input_byte = state->next_input_byte;
299 size_t bytes_in_buffer = state->bytes_in_buffer;
300 j_decompress_ptr cinfo = state->cinfo;
301
302 /* Attempt to load at least MIN_GET_BITS bits into get_buffer. */
303 /* (It is assumed that no request will be for more than that many bits.) */
304 /* We fail to do so only if we hit a marker or are forced to suspend. */
305
306 if (cinfo->unread_marker == 0) { /* cannot advance past a marker */
307 while (bits_left < MIN_GET_BITS) {
308 int c;
309
310 /* Attempt to read a byte */
311 if (bytes_in_buffer == 0) {
312 if (! (*cinfo->src->fill_input_buffer) (cinfo))
313 return FALSE;
314 next_input_byte = cinfo->src->next_input_byte;
315 bytes_in_buffer = cinfo->src->bytes_in_buffer;
316 }
317 bytes_in_buffer--;
318 c = GETJOCTET(*next_input_byte++);
319
320 /* If it's 0xFF, check and discard stuffed zero byte */
321 if (c == 0xFF) {
322 /* Loop here to discard any padding FF's on terminating marker,
323 * so that we can save a valid unread_marker value. NOTE: we will
324 * accept multiple FF's followed by a 0 as meaning a single FF data
325 * byte. This data pattern is not valid according to the standard.
326 */
327 do {
328 if (bytes_in_buffer == 0) {
329 if (! (*cinfo->src->fill_input_buffer) (cinfo))
330 return FALSE;
331 next_input_byte = cinfo->src->next_input_byte;
332 bytes_in_buffer = cinfo->src->bytes_in_buffer;
333 }
334 bytes_in_buffer--;
335 c = GETJOCTET(*next_input_byte++);
336 } while (c == 0xFF);
337
338 if (c == 0) {
339 /* Found FF/00, which represents an FF data byte */
340 c = 0xFF;
341 } else {
342 /* Oops, it's actually a marker indicating end of compressed data.
343 * Save the marker code for later use.
344 * Fine point: it might appear that we should save the marker into
345 * bitread working state, not straight into permanent state. But
346 * once we have hit a marker, we cannot need to suspend within the
347 * current MCU, because we will read no more bytes from the data
348 * source. So it is OK to update permanent state right away.
349 */
350 cinfo->unread_marker = c;
351 /* See if we need to insert some fake zero bits. */
352 goto no_more_bytes;
353 }
354 }
355
356 /* OK, load c into get_buffer */
357 get_buffer = (get_buffer << 8) | c;
358 bits_left += 8;
359 } /* end while */
360 } else {
361 no_more_bytes:
362 /* We get here if we've read the marker that terminates the compressed
363 * data segment. There should be enough bits in the buffer register
364 * to satisfy the request; if so, no problem.
365 */
366 if (nbits > bits_left) {
367 /* Uh-oh. Report corrupted data to user and stuff zeroes into
368 * the data stream, so that we can produce some kind of image.
369 * We use a nonvolatile flag to ensure that only one warning message
370 * appears per data segment.
371 */
372 if (! cinfo->entropy->insufficient_data) {
373 WARNMS(cinfo, JWRN_HIT_MARKER);
374 cinfo->entropy->insufficient_data = TRUE;
375 }
376 /* Fill the buffer with zero bits */
379 }
380 }
381
382 /* Unload the local registers */
383 state->next_input_byte = next_input_byte;
384 state->bytes_in_buffer = bytes_in_buffer;
385 state->get_buffer = get_buffer;
386 state->bits_left = bits_left;
387
388 return TRUE;
389}
390
391
392/*
393 * Out-of-line code for Huffman code decoding.
394 * See jdhuff.h for info about usage.
395 */
396
397GLOBAL(int)
401{
402 int l = min_bits;
403 INT32 code;
404
405 /* HUFF_DECODE has determined that the code is at least min_bits */
406 /* bits long, so fetch that many bits in one swoop. */
407
408 CHECK_BIT_BUFFER(*state, l, return -1);
409 code = GET_BITS(l);
410
411 /* Collect the rest of the Huffman code one bit at a time. */
412 /* This is per Figure F.16 in the JPEG spec. */
413
414 while (code > htbl->maxcode[l]) {
415 code <<= 1;
416 CHECK_BIT_BUFFER(*state, 1, return -1);
417 code |= GET_BITS(1);
418 l++;
419 }
420
421 /* Unload the local registers */
422 state->get_buffer = get_buffer;
423 state->bits_left = bits_left;
424
425 /* With garbage input we may reach the sentinel value l = 17. */
426
427 if (l > 16) {
428 WARNMS(state->cinfo, JWRN_HUFF_BAD_CODE);
429 return 0; /* fake a zero as the safest result */
430 }
431
432 return htbl->pub->huffval[ (int) (code + htbl->valoffset[l]) ];
433}
434
435
436/*
437 * Check for a restart marker & resynchronize decoder.
438 * Returns FALSE if must suspend.
439 */
440
441LOCAL(boolean)
443{
444 huff_entropy_ptr2 entropy = (huff_entropy_ptr2) cinfo->entropy;
445 int ci;
446
447 /* Throw away any unused bits remaining in bit buffer; */
448 /* include any full bytes in next_marker's count of discarded bytes */
449 cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;
450 entropy->bitstate.bits_left = 0;
451
452 /* Advance past the RSTn marker */
453 if (! (*cinfo->marker->read_restart_marker) (cinfo))
454 return FALSE;
455
456 /* Re-initialize DC predictions to 0 */
457 for (ci = 0; ci < cinfo->comps_in_scan; ci++)
458 entropy->saved.last_dc_val[ci] = 0;
459
460 /* Reset restart counter */
461 entropy->restarts_to_go = cinfo->restart_interval;
462
463 /* Reset out-of-data flag, unless read_restart_marker left us smack up
464 * against a marker. In that case we will end up treating the next data
465 * segment as empty, and we can avoid producing bogus output pixels by
466 * leaving the flag set.
467 */
468 if (cinfo->unread_marker == 0)
469 entropy->pub.insufficient_data = FALSE;
470
471 return TRUE;
472}
473
474
475/*
476 * Decode and return one MCU's worth of Huffman-compressed coefficients.
477 * The coefficients are reordered from zigzag order into natural array order,
478 * but are not dequantized.
479 *
480 * The i'th block of the MCU is stored into the block pointed to by
481 * MCU_data[i]. WE ASSUME THIS AREA HAS BEEN ZEROED BY THE CALLER.
482 * (Wholesale zeroing is usually a little faster than retail...)
483 *
484 * Returns FALSE if data source requested suspension. In that case no
485 * changes have been made to permanent state. (Exception: some output
486 * coefficients may already have been assigned. This is harmless for
487 * this module, since we'll just re-assign them on the next call.)
488 */
489
490METHODDEF(boolean)
492{
493 huff_entropy_ptr2 entropy = (huff_entropy_ptr2) cinfo->entropy;
494 int blkn;
496 savable_state2 state;
497
498 /* Process restart marker if needed; may have to suspend */
499 if (cinfo->restart_interval) {
500 if (entropy->restarts_to_go == 0)
501 if (! process_restart(cinfo))
502 return FALSE;
503 }
504
505 /* If we've run out of data, just leave the MCU set to zeroes.
506 * This way, we return uniform gray for the remainder of the segment.
507 */
508 if (! entropy->pub.insufficient_data) {
509
510 /* Load up working state */
511 BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
512 ASSIGN_STATE(state, entropy->saved);
513
514 /* Outer loop handles each block in the MCU */
515
516 for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
517 JBLOCKROW block = MCU_data[blkn];
518 d_derived_tbl * dctbl = entropy->dc_cur_tbls[blkn];
519 d_derived_tbl * actbl = entropy->ac_cur_tbls[blkn];
520 int s, k, r;
521
522 /* Decode a single block's worth of coefficients */
523
524 /* Section F.2.2.1: decode the DC coefficient difference */
525 HUFF_DECODE(s, br_state, dctbl, return FALSE, label1);
526 if (s) {
527 CHECK_BIT_BUFFER(br_state, s, return FALSE);
528 r = GET_BITS(s);
529 s = HUFF_EXTEND(r, s);
530 }
531
532 if (entropy->dc_needed[blkn]) {
533 /* Convert DC difference to actual value, update last_dc_val */
534 int ci = cinfo->MCU_membership[blkn];
535 s += state.last_dc_val[ci];
536 state.last_dc_val[ci] = s;
537 /* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */
538 (*block)[0] = (JCOEF) s;
539 }
540
541 if (entropy->ac_needed[blkn]) {
542
543 /* Section F.2.2.2: decode the AC coefficients */
544 /* Since zeroes are skipped, output area must be cleared beforehand */
545 for (k = 1; k < DCTSIZE2; k++) {
546 HUFF_DECODE(s, br_state, actbl, return FALSE, label2);
547
548 r = s >> 4;
549 s &= 15;
550
551 if (s) {
552 k += r;
553 CHECK_BIT_BUFFER(br_state, s, return FALSE);
554 r = GET_BITS(s);
555 s = HUFF_EXTEND(r, s);
556 /* Output coefficient in natural (dezigzagged) order.
557 * Note: the extra entries in jpeg_natural_order[] will save us
558 * if k >= DCTSIZE2, which could happen if the data is corrupted.
559 */
560 (*block)[jpeg_natural_order[k]] = (JCOEF) s;
561 } else {
562 if (r != 15)
563 break;
564 k += 15;
565 }
566 }
567
568 } else {
569
570 /* Section F.2.2.2: decode the AC coefficients */
571 /* In this path we just discard the values */
572 for (k = 1; k < DCTSIZE2; k++) {
573 HUFF_DECODE(s, br_state, actbl, return FALSE, label3);
574
575 r = s >> 4;
576 s &= 15;
577
578 if (s) {
579 k += r;
580 CHECK_BIT_BUFFER(br_state, s, return FALSE);
581 DROP_BITS(s);
582 } else {
583 if (r != 15)
584 break;
585 k += 15;
586 }
587 }
588
589 }
590 }
591
592 /* Completed MCU, so update state */
593 BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
594 ASSIGN_STATE(entropy->saved, state);
595 }
596
597 /* Account for restart interval (no-op if not using restarts) */
598 entropy->restarts_to_go--;
599
600 return TRUE;
601}
602
603
604/*
605 * Module initialization routine for Huffman entropy decoding.
606 */
607
608GLOBAL(void)
610{
611 huff_entropy_ptr2 entropy;
612 int i;
613
614 entropy = (huff_entropy_ptr2)
615 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
617 cinfo->entropy = (struct jpeg_entropy_decoder *) entropy;
618 entropy->pub.start_pass = start_pass_huff_decoder;
619 entropy->pub.decode_mcu = decode_mcu;
620
621 /* Mark tables unallocated */
622 for (i = 0; i < NUM_HUFF_TBLS; i++) {
623 entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;
624 }
625}
#define NULL
Definition CarlaBridgeFormat.cpp:30
int * l
Definition inflate.c:1579
register unsigned i
Definition inflate.c:1575
#define ASSIGN_STATE(dest, src)
Definition jchuff.c:41
boolean int c_derived_tbl ** pdtbl
Definition jchuff.h:46
boolean isDC
Definition jchuff.h:45
boolean int tblno
Definition jchuff.h:45
JHUFF_TBL * htbl
Definition jchuff.h:50
jpeg_component_info * compptr
Definition jdct.h:105
#define MIN_GET_BITS
Definition jdhuff.c:287
jpeg_huff_decode(bitread_working_state *state, bit_buf_type get_buffer, int bits_left, d_derived_tbl *htbl, int min_bits)
Definition jdhuff.c:398
decode_mcu(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
Definition jdhuff.c:491
jpeg_fill_bit_buffer(bitread_working_state *state, bit_buf_type get_buffer, int bits_left, int nbits)
Definition jdhuff.c:292
jinit_huff_decoder(j_decompress_ptr cinfo)
Definition jdhuff.c:609
process_restart(j_decompress_ptr cinfo)
Definition jdhuff.c:442
start_pass_huff_decoder(j_decompress_ptr cinfo)
Definition jdhuff.c:86
jpeg_make_d_derived_tbl(j_decompress_ptr cinfo, boolean isDC, int tblno, d_derived_tbl **pdtbl)
Definition jdhuff.c:149
huff_entropy_decoder2 * huff_entropy_ptr2
Definition jdhuff.c:78
bit_buf_type int d_derived_tbl int min_bits
Definition jdhuff.h:204
#define GET_BITS(nbits)
Definition jdhuff.h:147
#define HUFF_LOOKAHEAD
Definition jdhuff.h:27
bit_buf_type int bits_left
Definition jdhuff.h:159
#define BITREAD_STATE_VARS
Definition jdhuff.h:105
bit_buf_type int int nbits
Definition jdhuff.h:159
bit_buf_type get_buffer
Definition jdhuff.h:158
INT32 bit_buf_type
Definition jdhuff.h:75
#define CHECK_BIT_BUFFER(state, nbits, action)
Definition jdhuff.h:141
#define BITREAD_SAVE_STATE(cinfop, permstate)
Definition jdhuff.h:117
#define ERREXIT(cinfo, code)
Definition jerror.h:205
#define ERREXIT1(cinfo, code, p1)
Definition jerror.h:208
#define WARNMS(cinfo, code)
Definition jerror.h:238
#define SIZEOF(object)
Definition jinclude.h:83
#define MEMZERO(target, size)
Definition jinclude.h:70
long INT32
Definition jmorecfg.h:161
char JOCTET
Definition jmorecfg.h:115
#define LOCAL(type)
Definition jmorecfg.h:186
#define METHODDEF(type)
Definition jmorecfg.h:184
struct jpeg_decompress_struct * j_decompress_ptr
Definition jpeglib.h:263
JBLOCK FAR * JBLOCKROW
Definition jpeglib.h:71
struct jpeg_common_struct * j_common_ptr
Definition jpeglib.h:261
#define NUM_HUFF_TBLS
Definition jpeglib.h:44
#define JPOOL_IMAGE
Definition jpeglib.h:749
#define MAX_COMPS_IN_SCAN
Definition jpeglib.h:46
#define DCTSIZE2
Definition jpeglib.h:42
#define D_MAX_BLOCKS_IN_MCU
Definition jpeglib.h:57
Definition jpeglib.h:100
Definition jdhuff.h:85
bit_buf_type get_buffer
Definition jdhuff.h:86
int bits_left
Definition jdhuff.h:87
Definition jdhuff.h:90
Definition inftrees.h:27
Definition jdhuff.h:29
INT32 maxcode[18]
Definition jdhuff.h:31
UINT8 look_sym[1<< HUFF_LOOKAHEAD]
Definition jdhuff.h:48
INT32 valoffset[17]
Definition jdhuff.h:33
int look_nbits[1<< HUFF_LOOKAHEAD]
Definition jdhuff.h:47
JHUFF_TBL * pub
Definition jdhuff.h:40
Definition jdhuff.c:52
struct jpeg_entropy_decoder pub
Definition jdhuff.c:53
boolean ac_needed[D_MAX_BLOCKS_IN_MCU]
Definition jdhuff.c:75
unsigned int restarts_to_go
Definition jdhuff.c:62
d_derived_tbl * dc_cur_tbls[D_MAX_BLOCKS_IN_MCU]
Definition jdhuff.c:71
savable_state2 saved
Definition jdhuff.c:59
d_derived_tbl * ac_cur_tbls[D_MAX_BLOCKS_IN_MCU]
Definition jdhuff.c:72
d_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS]
Definition jdhuff.c:66
d_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS]
Definition jdhuff.c:65
bitread_perm_state bitstate
Definition jdhuff.c:58
boolean dc_needed[D_MAX_BLOCKS_IN_MCU]
Definition jdhuff.c:74
Definition jpeglib.h:116
int unread_marker
Definition jpeglib.h:614
Definition jpegint.h:209
boolean insufficient_data
Definition jpegint.h:216
Definition jdhuff.c:30
int last_dc_val[MAX_COMPS_IN_SCAN]
Definition jdhuff.c:31
uch * p
Definition crypt.c:594
#define GLOBAL(g)
Definition crypt.c:87
for(n=0;n< RAND_HEAD_LEN;n++)
Definition crypt.c:467
if(GLOBAL(newzip))
Definition crypt.c:475
typedef int(UZ_EXP MsgFn)()
#define TRUE
Definition unzpriv.h:1295
#define FALSE
Definition unzpriv.h:1298