Main MRPT website > C++ reference for MRPT 1.9.9
jdphuff.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #define JPEG_INTERNALS
11 #include "jinclude.h"
12 #include "mrpt_jpeglib.h"
13 #include "jdhuff.h" /* Declarations shared with jdhuff.c */
14 
15 #ifdef D_PROGRESSIVE_SUPPORTED
16 
17 /*
18  * Expanded entropy decoder object for progressive Huffman decoding.
19  *
20  * The savable_state subrecord contains fields that change within an MCU,
21  * but must not be updated permanently until we complete the MCU.
22  */
23 
24 typedef struct
25 {
26  unsigned int EOBRUN; /* remaining EOBs in EOBRUN */
27  int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
29 
30 /* This macro is to work around compilers with missing or broken
31  * structure assignment. You'll need to fix this code if you have
32  * such a compiler and you change MAX_COMPS_IN_SCAN.
33  */
34 
35 #ifndef NO_STRUCT_ASSIGN
36 #define ASSIGN_STATE(dest, src) ((dest) = (src))
37 #else
38 #if MAX_COMPS_IN_SCAN == 4
39 #define ASSIGN_STATE(dest, src) \
40  ((dest).EOBRUN = (src).EOBRUN, \
41  (dest).last_dc_val[0] = (src).last_dc_val[0], \
42  (dest).last_dc_val[1] = (src).last_dc_val[1], \
43  (dest).last_dc_val[2] = (src).last_dc_val[2], \
44  (dest).last_dc_val[3] = (src).last_dc_val[3])
45 #endif
46 #endif
47 
48 typedef struct
49 {
50  struct jpeg_entropy_decoder pub; /* public fields */
51 
52  /* These fields are loaded into local variables at start of each MCU.
53  * In case of suspension, we exit WITHOUT updating them.
54  */
55  bitread_perm_state bitstate; /* Bit buffer at start of MCU */
56  savable_state saved; /* Other state at start of MCU */
57 
58  /* These fields are NOT loaded into local working state. */
59  unsigned int restarts_to_go; /* MCUs left in this restart interval */
60 
61  /* Pointers to derived tables (these workspaces have image lifespan) */
62  d_derived_tbl* derived_tbls[NUM_HUFF_TBLS];
63 
64  d_derived_tbl* ac_derived_tbl; /* active table during an AC scan */
66 
68 
69 /* Forward declarations */
70 METHODDEF(boolean)
72 METHODDEF(boolean)
74 METHODDEF(boolean)
76 METHODDEF(boolean)
78 
79 /*
80  * Initialize for a Huffman-compressed scan.
81  */
82 
83 METHODDEF(void)
85 {
86  phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy;
87  boolean is_DC_band, bad;
88  int ci, coefi, tbl;
89  int* coef_bit_ptr;
91 
92  is_DC_band = (cinfo->Ss == 0);
93 
94  /* Validate scan parameters */
95  bad = FALSE;
96  if (is_DC_band)
97  {
98  if (cinfo->Se != 0) bad = TRUE;
99  }
100  else
101  {
102  /* need not check Ss/Se < 0 since they came from unsigned bytes */
103  if (cinfo->Ss > cinfo->Se || cinfo->Se >= DCTSIZE2) bad = TRUE;
104  /* AC scans may have only one component */
105  if (cinfo->comps_in_scan != 1) bad = TRUE;
106  }
107  if (cinfo->Ah != 0)
108  {
109  /* Successive approximation refinement scan: must have Al = Ah-1. */
110  if (cinfo->Al != cinfo->Ah - 1) bad = TRUE;
111  }
112  if (cinfo->Al > 13) /* need not check for < 0 */
113  bad = TRUE;
114  /* Arguably the maximum Al value should be less than 13 for 8-bit precision,
115  * but the spec doesn't say so, and we try to be liberal about what we
116  * accept. Note: large Al values could result in out-of-range DC
117  * coefficients during early scans, leading to bizarre displays due to
118  * overflows in the IDCT math. But we won't crash.
119  */
120  if (bad)
121  ERREXIT4(
122  cinfo, JERR_BAD_PROGRESSION, cinfo->Ss, cinfo->Se, cinfo->Ah,
123  cinfo->Al);
124  /* Update progression status, and verify that scan order is legal.
125  * Note that inter-scan inconsistencies are treated as warnings
126  * not fatal errors ... not clear if this is right way to behave.
127  */
128  for (ci = 0; ci < cinfo->comps_in_scan; ci++)
129  {
130  int cindex = cinfo->cur_comp_info[ci]->component_index;
131  coef_bit_ptr = &cinfo->coef_bits[cindex][0];
132  if (!is_DC_band && coef_bit_ptr[0] < 0) /* AC without prior DC scan */
133  WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0);
134  for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++)
135  {
136  int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi];
137  if (cinfo->Ah != expected)
138  WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi);
139  coef_bit_ptr[coefi] = cinfo->Al;
140  }
141  }
142 
143  /* Select MCU decoding routine */
144  if (cinfo->Ah == 0)
145  {
146  if (is_DC_band)
147  entropy->pub.decode_mcu = decode_mcu_DC_first;
148  else
149  entropy->pub.decode_mcu = decode_mcu_AC_first;
150  }
151  else
152  {
153  if (is_DC_band)
154  entropy->pub.decode_mcu = decode_mcu_DC_refine;
155  else
156  entropy->pub.decode_mcu = decode_mcu_AC_refine;
157  }
158 
159  for (ci = 0; ci < cinfo->comps_in_scan; ci++)
160  {
161  compptr = cinfo->cur_comp_info[ci];
162  /* Make sure requested tables are present, and compute derived tables.
163  * We may build same derived table more than once, but it's not
164  * expensive.
165  */
166  if (is_DC_band)
167  {
168  if (cinfo->Ah == 0)
169  { /* DC refinement needs no table */
170  tbl = compptr->dc_tbl_no;
172  cinfo, TRUE, tbl, &entropy->derived_tbls[tbl]);
173  }
174  }
175  else
176  {
177  tbl = compptr->ac_tbl_no;
179  cinfo, FALSE, tbl, &entropy->derived_tbls[tbl]);
180  /* remember the single active table */
181  entropy->ac_derived_tbl = entropy->derived_tbls[tbl];
182  }
183  /* Initialize DC predictions to 0 */
184  entropy->saved.last_dc_val[ci] = 0;
185  }
186 
187  /* Initialize bitread state variables */
188  entropy->bitstate.bits_left = 0;
189  entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */
190  entropy->pub.insufficient_data = FALSE;
191 
192  /* Initialize private state variables */
193  entropy->saved.EOBRUN = 0;
194 
195  /* Initialize restart counter */
196  entropy->restarts_to_go = cinfo->restart_interval;
197 }
198 
199 /*
200  * Figure F.12: extend sign bit.
201  * On some machines, a shift and add will be faster than a table lookup.
202  */
203 
204 #ifdef AVOID_TABLES
205 
206 #define HUFF_EXTEND(x, s) \
207  ((x) < (1 << ((s)-1)) ? (x) + (((-1) << (s)) + 1) : (x))
208 
209 #else
210 
211 #define HUFF_EXTEND(x, s) ((x) < extend_test[s] ? (x) + extend_offset[s] : (x))
212 
213 static const int extend_test[16] = /* entry n is 2**(n-1) */
214  {0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040,
215  0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000};
216 
217 static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */
218  {0, -1, -3, -7, -15, -31, -63, -127,
219  -255, -511, -1023, -2047, -4095, -8191, -16383, -32767};
220 
221 #endif /* AVOID_TABLES */
222 
223 /*
224  * Check for a restart marker & resynchronize decoder.
225  * Returns FALSE if must suspend.
226  */
227 
228 LOCAL(boolean)
230 {
231  phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy;
232  int ci;
233 
234  /* Throw away any unused bits remaining in bit buffer; */
235  /* include any full bytes in next_marker's count of discarded bytes */
236  cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;
237  entropy->bitstate.bits_left = 0;
238 
239  /* Advance past the RSTn marker */
240  if (!(*cinfo->marker->read_restart_marker)(cinfo)) return FALSE;
241 
242  /* Re-initialize DC predictions to 0 */
243  for (ci = 0; ci < cinfo->comps_in_scan; ci++)
244  entropy->saved.last_dc_val[ci] = 0;
245  /* Re-init EOB run count, too */
246  entropy->saved.EOBRUN = 0;
247 
248  /* Reset restart counter */
249  entropy->restarts_to_go = cinfo->restart_interval;
250 
251  /* Reset out-of-data flag, unless read_restart_marker left us smack up
252  * against a marker. In that case we will end up treating the next data
253  * segment as empty, and we can avoid producing bogus output pixels by
254  * leaving the flag set.
255  */
256  if (cinfo->unread_marker == 0) entropy->pub.insufficient_data = FALSE;
257 
258  return TRUE;
259 }
260 
261 /*
262  * Huffman MCU decoding.
263  * Each of these routines decodes and returns one MCU's worth of
264  * Huffman-compressed coefficients.
265  * The coefficients are reordered from zigzag order into natural array order,
266  * but are not dequantized.
267  *
268  * The i'th block of the MCU is stored into the block pointed to by
269  * MCU_data[i]. WE ASSUME THIS AREA IS INITIALLY ZEROED BY THE CALLER.
270  *
271  * We return FALSE if data source requested suspension. In that case no
272  * changes have been made to permanent state. (Exception: some output
273  * coefficients may already have been assigned. This is harmless for
274  * spectral selection, since we'll just re-assign them on the next call.
275  * Successive approximation AC refinement has to be more careful, however.)
276  */
277 
278 /*
279  * MCU decoding for DC initial scan (either spectral selection,
280  * or first pass of successive approximation).
281  */
282 
283 METHODDEF(boolean)
285 {
286  phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy;
287  int Al = cinfo->Al;
288  int s, r;
289  int blkn, ci;
290  JBLOCKROW block;
292  savable_state state;
293  d_derived_tbl* tbl;
295 
296  /* Process restart marker if needed; may have to suspend */
297  if (cinfo->restart_interval)
298  {
299  if (entropy->restarts_to_go == 0)
300  if (!process_restart(cinfo)) return FALSE;
301  }
302 
303  /* If we've run out of data, just leave the MCU set to zeroes.
304  * This way, we return uniform gray for the remainder of the segment.
305  */
306  if (!entropy->pub.insufficient_data)
307  {
308  /* Load up working state */
309  BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
310  ASSIGN_STATE(state, entropy->saved);
311 
312  /* Outer loop handles each block in the MCU */
313 
314  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++)
315  {
316  block = MCU_data[blkn];
317  ci = cinfo->MCU_membership[blkn];
318  compptr = cinfo->cur_comp_info[ci];
319  tbl = entropy->derived_tbls[compptr->dc_tbl_no];
320 
321  /* Decode a single block's worth of coefficients */
322 
323  /* Section F.2.2.1: decode the DC coefficient difference */
324  HUFF_DECODE(s, br_state, tbl, return FALSE, label1);
325  if (s)
326  {
327  CHECK_BIT_BUFFER(br_state, s, return FALSE);
328  r = GET_BITS(s);
329  s = HUFF_EXTEND(r, s);
330  }
331 
332  /* Convert DC difference to actual value, update last_dc_val */
333  s += state.last_dc_val[ci];
334  state.last_dc_val[ci] = s;
335  /* Scale and output the coefficient (assumes
336  * jpeg_natural_order[0]=0) */
337  (*block)[0] = (JCOEF)(s << Al);
338  }
339 
340  /* Completed MCU, so update state */
341  BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
342  ASSIGN_STATE(entropy->saved, state);
343  }
344 
345  /* Account for restart interval (no-op if not using restarts) */
346  entropy->restarts_to_go--;
347 
348  return TRUE;
349 }
350 
351 /*
352  * MCU decoding for AC initial scan (either spectral selection,
353  * or first pass of successive approximation).
354  */
355 
356 METHODDEF(boolean)
358 {
359  phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy;
360  int Se = cinfo->Se;
361  int Al = cinfo->Al;
362  int s, k, r;
363  unsigned int EOBRUN;
364  JBLOCKROW block;
366  d_derived_tbl* tbl;
367 
368  /* Process restart marker if needed; may have to suspend */
369  if (cinfo->restart_interval)
370  {
371  if (entropy->restarts_to_go == 0)
372  if (!process_restart(cinfo)) return FALSE;
373  }
374 
375  /* If we've run out of data, just leave the MCU set to zeroes.
376  * This way, we return uniform gray for the remainder of the segment.
377  */
378  if (!entropy->pub.insufficient_data)
379  {
380  /* Load up working state.
381  * We can avoid loading/saving bitread state if in an EOB run.
382  */
383  EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */
384 
385  /* There is always only one block per MCU */
386 
387  if (EOBRUN > 0) /* if it's a band of zeroes... */
388  EOBRUN--; /* ...process it now (we do nothing) */
389  else
390  {
391  BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
392  block = MCU_data[0];
393  tbl = entropy->ac_derived_tbl;
394 
395  for (k = cinfo->Ss; k <= Se; k++)
396  {
397  HUFF_DECODE(s, br_state, tbl, return FALSE, label2);
398  r = s >> 4;
399  s &= 15;
400  if (s)
401  {
402  k += r;
403  CHECK_BIT_BUFFER(br_state, s, return FALSE);
404  r = GET_BITS(s);
405  s = HUFF_EXTEND(r, s);
406  /* Scale and output coefficient in natural (dezigzagged)
407  * order */
408  (*block)[jpeg_natural_order[k]] = (JCOEF)(s << Al);
409  }
410  else
411  {
412  if (r == 15)
413  { /* ZRL */
414  k += 15; /* skip 15 zeroes in band */
415  }
416  else
417  { /* EOBr, run length is 2^r + appended bits */
418  EOBRUN = 1 << r;
419  if (r)
420  { /* EOBr, r > 0 */
421  CHECK_BIT_BUFFER(br_state, r, return FALSE);
422  r = GET_BITS(r);
423  EOBRUN += r;
424  }
425  EOBRUN--; /* this band is processed at this moment */
426  break; /* force end-of-band */
427  }
428  }
429  }
430 
431  BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
432  }
433 
434  /* Completed MCU, so update state */
435  entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */
436  }
437 
438  /* Account for restart interval (no-op if not using restarts) */
439  entropy->restarts_to_go--;
440 
441  return TRUE;
442 }
443 
444 /*
445  * MCU decoding for DC successive approximation refinement scan.
446  * Note: we assume such scans can be multi-component, although the spec
447  * is not very clear on the point.
448  */
449 
450 METHODDEF(boolean)
452 {
453  phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy;
454  int p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
455  int blkn;
456  JBLOCKROW block;
458 
459  /* Process restart marker if needed; may have to suspend */
460  if (cinfo->restart_interval)
461  {
462  if (entropy->restarts_to_go == 0)
463  if (!process_restart(cinfo)) return FALSE;
464  }
465 
466  /* Not worth the cycles to check insufficient_data here,
467  * since we will not change the data anyway if we read zeroes.
468  */
469 
470  /* Load up working state */
471  BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
472 
473  /* Outer loop handles each block in the MCU */
474 
475  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++)
476  {
477  block = MCU_data[blkn];
478 
479  /* Encoded data is simply the next bit of the two's-complement DC value
480  */
481  CHECK_BIT_BUFFER(br_state, 1, return FALSE);
482  if (GET_BITS(1)) (*block)[0] |= p1;
483  /* Note: since we use |=, repeating the assignment later is safe */
484  }
485 
486  /* Completed MCU, so update state */
487  BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
488 
489  /* Account for restart interval (no-op if not using restarts) */
490  entropy->restarts_to_go--;
491 
492  return TRUE;
493 }
494 
495 /*
496  * MCU decoding for AC successive approximation refinement scan.
497  */
498 
499 METHODDEF(boolean)
501 {
502  phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy;
503  int Se = cinfo->Se;
504  int p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
505  int m1 = (-1) << cinfo->Al; /* -1 in the bit position being coded */
506  int s, k, r;
507  unsigned int EOBRUN;
508  JBLOCKROW block;
509  JCOEFPTR thiscoef;
511  d_derived_tbl* tbl;
512  int num_newnz;
513  int newnz_pos[DCTSIZE2];
514 
515  /* Process restart marker if needed; may have to suspend */
516  if (cinfo->restart_interval)
517  {
518  if (entropy->restarts_to_go == 0)
519  if (!process_restart(cinfo)) return FALSE;
520  }
521 
522  /* If we've run out of data, don't modify the MCU.
523  */
524  if (!entropy->pub.insufficient_data)
525  {
526  /* Load up working state */
527  BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
528  EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */
529 
530  /* There is always only one block per MCU */
531  block = MCU_data[0];
532  tbl = entropy->ac_derived_tbl;
533 
534  /* If we are forced to suspend, we must undo the assignments to any
535  * newly
536  * nonzero coefficients in the block, because otherwise we'd get
537  * confused
538  * next time about which coefficients were already nonzero.
539  * But we need not undo addition of bits to already-nonzero
540  * coefficients;
541  * instead, we can test the current bit to see if we already did it.
542  */
543  num_newnz = 0;
544 
545  /* initialize coefficient loop counter to start of band */
546  k = cinfo->Ss;
547 
548  if (EOBRUN == 0)
549  {
550  for (; k <= Se; k++)
551  {
552  HUFF_DECODE(s, br_state, tbl, goto undoit, label3);
553  r = s >> 4;
554  s &= 15;
555  if (s)
556  {
557  if (s != 1) /* size of new coef should always be 1 */
558  WARNMS(cinfo, JWRN_HUFF_BAD_CODE);
559  CHECK_BIT_BUFFER(br_state, 1, goto undoit);
560  if (GET_BITS(1))
561  s = p1; /* newly nonzero coef is positive */
562  else
563  s = m1; /* newly nonzero coef is negative */
564  }
565  else
566  {
567  if (r != 15)
568  {
569  EOBRUN =
570  1
571  << r; /* EOBr, run length is 2^r + appended bits */
572  if (r)
573  {
574  CHECK_BIT_BUFFER(br_state, r, goto undoit);
575  r = GET_BITS(r);
576  EOBRUN += r;
577  }
578  break; /* rest of block is handled by EOB logic */
579  }
580  /* note s = 0 for processing ZRL */
581  }
582  /* Advance over already-nonzero coefs and r still-zero coefs,
583  * appending correction bits to the nonzeroes. A correction bit
584  * is 1
585  * if the absolute value of the coefficient must be increased.
586  */
587  do
588  {
589  thiscoef = *block + jpeg_natural_order[k];
590  if (*thiscoef != 0)
591  {
592  CHECK_BIT_BUFFER(br_state, 1, goto undoit);
593  if (GET_BITS(1))
594  {
595  if ((*thiscoef & p1) == 0)
596  { /* do nothing if already set it */
597  if (*thiscoef >= 0)
598  *thiscoef += p1;
599  else
600  *thiscoef += m1;
601  }
602  }
603  }
604  else
605  {
606  if (--r < 0)
607  break; /* reached target zero coefficient */
608  }
609  k++;
610  } while (k <= Se);
611  if (s)
612  {
613  int pos = jpeg_natural_order[k];
614  /* Output newly nonzero coefficient */
615  (*block)[pos] = (JCOEF)s;
616  /* Remember its position in case we have to suspend */
617  newnz_pos[num_newnz++] = pos;
618  }
619  }
620  }
621 
622  if (EOBRUN > 0)
623  {
624  /* Scan any remaining coefficient positions after the end-of-band
625  * (the last newly nonzero coefficient, if any). Append a
626  * correction
627  * bit to each already-nonzero coefficient. A correction bit is 1
628  * if the absolute value of the coefficient must be increased.
629  */
630  for (; k <= Se; k++)
631  {
632  thiscoef = *block + jpeg_natural_order[k];
633  if (*thiscoef != 0)
634  {
635  CHECK_BIT_BUFFER(br_state, 1, goto undoit);
636  if (GET_BITS(1))
637  {
638  if ((*thiscoef & p1) == 0)
639  { /* do nothing if already changed it */
640  if (*thiscoef >= 0)
641  *thiscoef += p1;
642  else
643  *thiscoef += m1;
644  }
645  }
646  }
647  }
648  /* Count one block completed in EOB run */
649  EOBRUN--;
650  }
651 
652  /* Completed MCU, so update state */
653  BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
654  entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */
655  }
656 
657  /* Account for restart interval (no-op if not using restarts) */
658  entropy->restarts_to_go--;
659 
660  return TRUE;
661 
662 undoit:
663  /* Re-zero any output coefficients that we made newly nonzero */
664  while (num_newnz > 0) (*block)[newnz_pos[--num_newnz]] = 0;
665 
666  return FALSE;
667 }
668 
669 /*
670  * Module initialization routine for progressive Huffman entropy decoding.
671  */
672 
673 GLOBAL(void)
675 {
676  phuff_entropy_ptr entropy;
677  int* coef_bit_ptr;
678  int ci, i;
679 
680  entropy = (phuff_entropy_ptr)(*cinfo->mem->alloc_small)(
682  cinfo->entropy = (struct jpeg_entropy_decoder*)entropy;
683  entropy->pub.start_pass = start_pass_phuff_decoder;
684 
685  /* Mark derived tables unallocated */
686  for (i = 0; i < NUM_HUFF_TBLS; i++)
687  {
688  entropy->derived_tbls[i] = nullptr;
689  }
690 
691  /* Create progression status table */
692  cinfo->coef_bits = (int(*)[DCTSIZE2])(*cinfo->mem->alloc_small)(
693  (j_common_ptr)cinfo, JPOOL_IMAGE,
694  cinfo->num_components * DCTSIZE2 * SIZEOF(int));
695  coef_bit_ptr = &cinfo->coef_bits[0][0];
696  for (ci = 0; ci < cinfo->num_components; ci++)
697  for (i = 0; i < DCTSIZE2; i++) *coef_bit_ptr++ = -1;
698 }
699 
700 #endif /* D_PROGRESSIVE_SUPPORTED */
#define BITREAD_STATE_VARS
Definition: jdhuff.h:101
unsigned int restarts_to_go
Definition: jcphuff.cpp:45
decode_mcu_DC_first(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
Definition: jdphuff.cpp:284
decode_mcu_DC_first JPP((j_decompress_ptr cinfo, JBLOCKROW *MCU_data))
#define MAX_COMPS_IN_SCAN
Definition: mrpt_jpeglib.h:41
const int jpeg_natural_order[]
Definition: jutils.cpp:48
struct jpeg_common_struct * j_common_ptr
Definition: mrpt_jpeglib.h:258
#define SIZEOF(object)
Definition: jinclude.h:74
c_derived_tbl * derived_tbls[NUM_HUFF_TBLS]
Definition: jcphuff.cpp:52
short JCOEF
Definition: jmorecfg.h:91
#define HUFF_DECODE(result, state, htbl, failaction, slowlabel)
Definition: jdhuff.h:181
GLdouble s
Definition: glext.h:3676
#define GET_BITS(nbits)
Definition: jdhuff.h:150
#define WARNMS2(cinfo, code, p1, p2)
Definition: jerror.h:488
phuff_entropy_decoder * phuff_entropy_ptr
Definition: jdphuff.cpp:67
#define ERREXIT4(cinfo, code, p1, p2, p3, p4)
Definition: jerror.h:465
#define FALSE
Definition: jmorecfg.h:216
#define JPOOL_IMAGE
Definition: mrpt_jpeglib.h:750
#define LOCAL(type)
Definition: jmorecfg.h:175
struct jpeg_entropy_encoder pub
Definition: jcphuff.cpp:21
JCOEF FAR * JCOEFPTR
Definition: mrpt_jpeglib.h:69
#define CHECK_BIT_BUFFER(state, nbits, action)
Definition: jdhuff.h:137
static const int extend_test[16]
Definition: jdphuff.cpp:213
#define DCTSIZE2
Definition: mrpt_jpeglib.h:37
decode_mcu_AC_refine(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
Definition: jdphuff.cpp:500
#define NUM_HUFF_TBLS
Definition: mrpt_jpeglib.h:39
bitread_perm_state bitstate
Definition: jdphuff.cpp:55
process_restart(j_decompress_ptr cinfo)
Definition: jdphuff.cpp:229
#define WARNMS(cinfo, code)
Definition: jerror.h:482
start_pass_phuff_decoder(j_decompress_ptr cinfo)
Definition: jdphuff.cpp:84
jinit_phuff_decoder(j_decompress_ptr cinfo)
Definition: jdphuff.cpp:674
decode_mcu_AC_first(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
Definition: jdphuff.cpp:357
#define TRUE
Definition: jmorecfg.h:219
unsigned int restarts_to_go
Definition: jdphuff.cpp:59
#define BITREAD_SAVE_STATE(cinfop, permstate)
Definition: jdhuff.h:113
GLdouble GLdouble GLdouble r
Definition: glext.h:3705
static const int extend_offset[16]
Definition: jdphuff.cpp:217
#define GLOBAL(type)
Definition: jmorecfg.h:177
#define METHODDEF(type)
Definition: jmorecfg.h:173
unsigned int EOBRUN
Definition: jcphuff.cpp:40
decode_mcu_DC_refine(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
Definition: jdphuff.cpp:451
jpeg_make_d_derived_tbl(j_decompress_ptr cinfo, boolean isDC, int tblno, d_derived_tbl **pdtbl)
Definition: jdhuff.cpp:147
unsigned int EOBRUN
Definition: jdphuff.cpp:26
JBLOCK FAR * JBLOCKROW
Definition: mrpt_jpeglib.h:65
#define ASSIGN_STATE(dest, src)
Definition: jdphuff.cpp:36
#define BITREAD_LOAD_STATE(cinfop, permstate)
Definition: jdhuff.h:106
int last_dc_val[MAX_COMPS_IN_SCAN]
Definition: jcphuff.cpp:36
#define HUFF_EXTEND(x, s)
Definition: jdphuff.cpp:211
jpeg_component_info * compptr
Definition: jidctflt.cpp:36
d_derived_tbl * ac_derived_tbl
Definition: jdphuff.cpp:64
savable_state saved
Definition: jdphuff.cpp:56



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019