source: golgotha/src/i4/loaders/jpg/jdmaster.cc @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 11 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 20.3 KB
Line 
1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9/*
10 * jdmaster.c
11 *
12 * Copyright (C) 1991-1996, Thomas G. Lane.
13 * This file is part of the Independent JPEG Group's software.
14 * For conditions of distribution and use, see the accompanying README file.
15 *
16 * This file contains master control logic for the JPEG decompressor.
17 * These routines are concerned with selecting the modules to be executed
18 * and with determining the number of passes and the work to be done in each
19 * pass.
20 */
21
22#define JPEG_INTERNALS
23#include "loaders/jpg/jinclude.h"
24#include "loaders/jpg/jpeglib.h"
25
26
27/* Private state */
28
29typedef struct {
30  struct jpeg_decomp_master pub; /* public fields */
31
32  int pass_number;              /* # of passes completed */
33
34  boolean using_merged_upsample; /* TRUE if using merged upsample/cconvert */
35
36  /* Saved references to initialized quantizer modules,
37   * in case we need to switch modes.
38   */
39  struct jpeg_color_quantizer * quantizer_1pass;
40  struct jpeg_color_quantizer * quantizer_2pass;
41} my_decomp_master;
42
43typedef my_decomp_master * my_master_ptr;
44
45
46/*
47 * Determine whether merged upsample/color conversion should be used.
48 * CRUCIAL: this must match the actual capabilities of jdmerge.c!
49 */
50
51LOCAL(boolean)
52use_merged_upsample (j_decompress_ptr cinfo)
53{
54#ifdef UPSAMPLE_MERGING_SUPPORTED
55  /* Merging is the equivalent of plain box-filter upsampling */
56  if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling)
57    return FALSE;
58  /* jdmerge.c only supports YCC=>RGB color conversion */
59  if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 ||
60      cinfo->out_color_space != JCS_RGB ||
61      cinfo->out_color_components != RGB_PIXELSIZE)
62    return FALSE;
63  /* and it only handles 2h1v or 2h2v sampling ratios */
64  if (cinfo->comp_info[0].h_samp_factor != 2 ||
65      cinfo->comp_info[1].h_samp_factor != 1 ||
66      cinfo->comp_info[2].h_samp_factor != 1 ||
67      cinfo->comp_info[0].v_samp_factor >  2 ||
68      cinfo->comp_info[1].v_samp_factor != 1 ||
69      cinfo->comp_info[2].v_samp_factor != 1)
70    return FALSE;
71  /* furthermore, it doesn't work if we've scaled the IDCTs differently */
72  if (cinfo->comp_info[0].DCT_scaled_size != cinfo->min_DCT_scaled_size ||
73      cinfo->comp_info[1].DCT_scaled_size != cinfo->min_DCT_scaled_size ||
74      cinfo->comp_info[2].DCT_scaled_size != cinfo->min_DCT_scaled_size)
75    return FALSE;
76  /* ??? also need to test for upsample-time rescaling, when & if supported */
77  return TRUE;                  /* by golly, it'll work... */
78#else
79  return FALSE;
80#endif
81}
82
83
84/*
85 * Compute output image dimensions and related values.
86 * NOTE: this is exported for possible use by application.
87 * Hence it mustn't do anything that can't be done twice.
88 * Also note that it may be called before the master module is initialized!
89 */
90
91GLOBAL(void)
92jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
93/* Do computations that are needed before master selection phase */
94{
95  int ci;
96  jpeg_component_info *compptr;
97
98  /* Prevent application from calling me at wrong times */
99  if (cinfo->global_state != DSTATE_READY)
100    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
101
102#if 0//#ifdef IDCT_SCALING_SUPPORTED
103
104  /* Compute actual output image dimensions and DCT scaling choices. */
105  if (cinfo->scale_num * 8 <= cinfo->scale_denom) {
106    /* Provide 1/8 scaling */
107    cinfo->output_width = (JDIMENSION)
108      jdiv_round_up((long) cinfo->image_width, 8L);
109    cinfo->output_height = (JDIMENSION)
110      jdiv_round_up((long) cinfo->image_height, 8L);
111    cinfo->min_DCT_scaled_size = 1;
112  } else if (cinfo->scale_num * 4 <= cinfo->scale_denom) {
113    /* Provide 1/4 scaling */
114    cinfo->output_width = (JDIMENSION)
115      jdiv_round_up((long) cinfo->image_width, 4L);
116    cinfo->output_height = (JDIMENSION)
117      jdiv_round_up((long) cinfo->image_height, 4L);
118    cinfo->min_DCT_scaled_size = 2;
119  } else if (cinfo->scale_num * 2 <= cinfo->scale_denom) {
120    /* Provide 1/2 scaling */
121    cinfo->output_width = (JDIMENSION)
122      jdiv_round_up((long) cinfo->image_width, 2L);
123    cinfo->output_height = (JDIMENSION)
124      jdiv_round_up((long) cinfo->image_height, 2L);
125    cinfo->min_DCT_scaled_size = 4;
126  } else {
127    /* Provide 1/1 scaling */
128    cinfo->output_width = cinfo->image_width;
129    cinfo->output_height = cinfo->image_height;
130    cinfo->min_DCT_scaled_size = DCTSIZE;
131  }
132  /* In selecting the actual DCT scaling for each component, we try to
133   * scale up the chroma components via IDCT scaling rather than upsampling.
134   * This saves time if the upsampler gets to use 1:1 scaling.
135   * Note this code assumes that the supported DCT scalings are powers of 2.
136   */
137  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
138       ci++, compptr++) {
139    int ssize = cinfo->min_DCT_scaled_size;
140    while (ssize < DCTSIZE &&
141           (compptr->h_samp_factor * ssize * 2 <=
142            cinfo->max_h_samp_factor * cinfo->min_DCT_scaled_size) &&
143           (compptr->v_samp_factor * ssize * 2 <=
144            cinfo->max_v_samp_factor * cinfo->min_DCT_scaled_size)) {
145      ssize = ssize * 2;
146    }
147    compptr->DCT_scaled_size = ssize;
148  }
149
150  /* Recompute downsampled dimensions of components;
151   * application needs to know these if using raw downsampled data.
152   */
153  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
154       ci++, compptr++) {
155    /* Size in samples, after IDCT scaling */
156    compptr->downsampled_width = (JDIMENSION)
157      jdiv_round_up((long) cinfo->image_width *
158                    (long) (compptr->h_samp_factor * compptr->DCT_scaled_size),
159                    (long) (cinfo->max_h_samp_factor * DCTSIZE));
160    compptr->downsampled_height = (JDIMENSION)
161      jdiv_round_up((long) cinfo->image_height *
162                    (long) (compptr->v_samp_factor * compptr->DCT_scaled_size),
163                    (long) (cinfo->max_v_samp_factor * DCTSIZE));
164  }
165
166#else /* !IDCT_SCALING_SUPPORTED */
167
168  /* Hardwire it to "no scaling" */
169  cinfo->output_width = cinfo->image_width;
170  cinfo->output_height = cinfo->image_height;
171  /* jdinput.c has already initialized DCT_scaled_size to DCTSIZE,
172   * and has computed unscaled downsampled_width and downsampled_height.
173   */
174
175#endif /* IDCT_SCALING_SUPPORTED */
176
177  /* Report number of components in selected colorspace. */
178  /* Probably this should be in the color conversion module... */
179  switch (cinfo->out_color_space) {
180  case JCS_GRAYSCALE:
181    cinfo->out_color_components = 1;
182    break;
183  case JCS_RGB:
184#if RGB_PIXELSIZE != 3
185    cinfo->out_color_components = RGB_PIXELSIZE;
186    break;
187#endif /* else share code with YCbCr */
188  case JCS_YCbCr:
189    cinfo->out_color_components = 3;
190    break;
191  case JCS_CMYK:
192  case JCS_YCCK:
193    cinfo->out_color_components = 4;
194    break;
195  default:                      /* else must be same colorspace as in file */
196    cinfo->out_color_components = cinfo->num_components;
197    break;
198  }
199  cinfo->output_components = (cinfo->quantize_colors ? 1 :
200                              cinfo->out_color_components);
201
202  /* See if upsampler will want to emit more than one row at a time */
203  if (use_merged_upsample(cinfo))
204    cinfo->rec_outbuf_height = cinfo->max_v_samp_factor;
205  else
206    cinfo->rec_outbuf_height = 1;
207}
208
209
210/*
211 * Several decompression processes need to range-limit values to the range
212 * 0..MAXJSAMPLE; the input value may fall somewhat outside this range
213 * due to noise introduced by quantization, roundoff error, etc.  These
214 * processes are inner loops and need to be as fast as possible.  On most
215 * machines, particularly CPUs with pipelines or instruction prefetch,
216 * a (subscript-check-less) C table lookup
217 *              x = sample_range_limit[x];
218 * is faster than explicit tests
219 *              if (x < 0)  x = 0;
220 *              else if (x > MAXJSAMPLE)  x = MAXJSAMPLE;
221 * These processes all use a common table prepared by the routine below.
222 *
223 * For most steps we can mathematically guarantee that the initial value
224 * of x is within MAXJSAMPLE+1 of the legal range, so a table running from
225 * -(MAXJSAMPLE+1) to 2*MAXJSAMPLE+1 is sufficient.  But for the initial
226 * limiting step (just after the IDCT), a wildly out-of-range value is
227 * possible if the input data is corrupt.  To avoid any chance of indexing
228 * off the end of memory and getting a bad-pointer trap, we perform the
229 * post-IDCT limiting thus:
230 *              x = range_limit[x & MASK];
231 * where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit
232 * samples.  Under normal circumstances this is more than enough range and
233 * a correct output will be generated; with bogus input data the mask will
234 * cause wraparound, and we will safely generate a bogus-but-in-range output.
235 * For the post-IDCT step, we want to convert the data from signed to unsigned
236 * representation by adding CENTERJSAMPLE at the same time that we limit it.
237 * So the post-IDCT limiting table ends up looking like this:
238 *   CENTERJSAMPLE,CENTERJSAMPLE+1,...,MAXJSAMPLE,
239 *   MAXJSAMPLE (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),
240 *   0          (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),
241 *   0,1,...,CENTERJSAMPLE-1
242 * Negative inputs select values from the upper half of the table after
243 * masking.
244 *
245 * We can save some space by overlapping the start of the post-IDCT table
246 * with the simpler range limiting table.  The post-IDCT table begins at
247 * sample_range_limit + CENTERJSAMPLE.
248 *
249 * Note that the table is allocated in near data space on PCs; it's small
250 * enough and used often enough to justify this.
251 */
252
253LOCAL(void)
254prepare_range_limit_table (j_decompress_ptr cinfo)
255/* Allocate and fill in the sample_range_limit table */
256{
257  JSAMPLE * table;
258  int i;
259
260  table = (JSAMPLE *)
261    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
262                (5 * (MAXJSAMPLE+1) + CENTERJSAMPLE) * SIZEOF(JSAMPLE));
263  table += (MAXJSAMPLE+1);      /* allow negative subscripts of simple table */
264  cinfo->sample_range_limit = table;
265  /* First segment of "simple" table: limit[x] = 0 for x < 0 */
266  MEMZERO(table - (MAXJSAMPLE+1), (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
267  /* Main part of "simple" table: limit[x] = x */
268  for (i = 0; i <= MAXJSAMPLE; i++)
269    table[i] = (JSAMPLE) i;
270  table += CENTERJSAMPLE;       /* Point to where post-IDCT table starts */
271  /* End of simple table, rest of first half of post-IDCT table */
272  for (i = CENTERJSAMPLE; i < 2*(MAXJSAMPLE+1); i++)
273    table[i] = MAXJSAMPLE;
274  /* Second half of post-IDCT table */
275  MEMZERO(table + (2 * (MAXJSAMPLE+1)),
276          (2 * (MAXJSAMPLE+1) - CENTERJSAMPLE) * SIZEOF(JSAMPLE));
277  MEMCOPY(table + (4 * (MAXJSAMPLE+1) - CENTERJSAMPLE),
278          cinfo->sample_range_limit, CENTERJSAMPLE * SIZEOF(JSAMPLE));
279}
280
281
282/*
283 * Master selection of decompression modules.
284 * This is done once at jpeg_start_decompress time.  We determine
285 * which modules will be used and give them appropriate initialization calls.
286 * We also initialize the decompressor input side to begin consuming data.
287 *
288 * Since jpeg_read_header has finished, we know what is in the SOF
289 * and (first) SOS markers.  We also have all the application parameter
290 * settings.
291 */
292
293LOCAL(void)
294master_selection (j_decompress_ptr cinfo)
295{
296  my_master_ptr master = (my_master_ptr) cinfo->master;
297  boolean use_c_buffer;
298  long samplesperrow;
299  JDIMENSION jd_samplesperrow;
300
301  /* Initialize dimensions and other stuff */
302  jpeg_calc_output_dimensions(cinfo);
303  prepare_range_limit_table(cinfo);
304
305  /* Width of an output scanline must be representable as JDIMENSION. */
306  samplesperrow = (long) cinfo->output_width * (long) cinfo->out_color_components;
307  jd_samplesperrow = (JDIMENSION) samplesperrow;
308  if ((long) jd_samplesperrow != samplesperrow)
309    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
310
311  /* Initialize my private state */
312  master->pass_number = 0;
313  master->using_merged_upsample = use_merged_upsample(cinfo);
314
315  /* Color quantizer selection */
316  master->quantizer_1pass = NULL;
317  master->quantizer_2pass = NULL;
318  /* No mode changes if not using buffered-image mode. */
319  if (! cinfo->quantize_colors || ! cinfo->buffered_image) {
320    cinfo->enable_1pass_quant = FALSE;
321    cinfo->enable_external_quant = FALSE;
322    cinfo->enable_2pass_quant = FALSE;
323  }
324  if (cinfo->quantize_colors) {
325    if (cinfo->raw_data_out)
326      ERREXIT(cinfo, JERR_NOTIMPL);
327    /* 2-pass quantizer only works in 3-component color space. */
328    if (cinfo->out_color_components != 3) {
329      cinfo->enable_1pass_quant = TRUE;
330      cinfo->enable_external_quant = FALSE;
331      cinfo->enable_2pass_quant = FALSE;
332      cinfo->colormap = NULL;
333    } else if (cinfo->colormap != NULL) {
334      cinfo->enable_external_quant = TRUE;
335    } else if (cinfo->two_pass_quantize) {
336      cinfo->enable_2pass_quant = TRUE;
337    } else {
338      cinfo->enable_1pass_quant = TRUE;
339    }
340
341    if (cinfo->enable_1pass_quant) {
342#ifdef QUANT_1PASS_SUPPORTED
343      jinit_1pass_quantizer(cinfo);
344      master->quantizer_1pass = cinfo->cquantize;
345#else
346      ERREXIT(cinfo, JERR_NOT_COMPILED);
347#endif
348    }
349
350    /* We use the 2-pass code to map to external colormaps. */
351    if (cinfo->enable_2pass_quant || cinfo->enable_external_quant) {
352#ifdef QUANT_2PASS_SUPPORTED
353      jinit_2pass_quantizer(cinfo);
354      master->quantizer_2pass = cinfo->cquantize;
355#else
356      ERREXIT(cinfo, JERR_NOT_COMPILED);
357#endif
358    }
359    /* If both quantizers are initialized, the 2-pass one is left active;
360     * this is necessary for starting with quantization to an external map.
361     */
362  }
363
364  /* Post-processing: in particular, color conversion first */
365  if (! cinfo->raw_data_out) {
366    if (master->using_merged_upsample) {
367#ifdef UPSAMPLE_MERGING_SUPPORTED
368      jinit_merged_upsampler(cinfo); /* does color conversion too */
369#else
370      ERREXIT(cinfo, JERR_NOT_COMPILED);
371#endif
372    } else {
373      jinit_color_deconverter(cinfo);
374      jinit_upsampler(cinfo);
375    }
376    jinit_d_post_controller(cinfo, cinfo->enable_2pass_quant);
377  }
378  /* Inverse DCT */
379  jinit_inverse_dct(cinfo);
380  /* Entropy decoding: either Huffman or arithmetic coding. */
381  if (cinfo->arith_code) {
382    ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
383  } else {
384    if (cinfo->progressive_mode) {
385#ifdef D_PROGRESSIVE_SUPPORTED
386      jinit_phuff_decoder(cinfo);
387#else
388      ERREXIT(cinfo, JERR_NOT_COMPILED);
389#endif
390    } else
391      jinit_huff_decoder(cinfo);
392  }
393
394  /* Initialize principal buffer controllers. */
395  use_c_buffer = cinfo->inputctl->has_multiple_scans || cinfo->buffered_image;
396  jinit_d_coef_controller(cinfo, use_c_buffer);
397
398  if (! cinfo->raw_data_out)
399    jinit_d_main_controller(cinfo, FALSE /* never need full buffer here */);
400
401  /* We can now tell the memory manager to allocate virtual arrays. */
402  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);
403
404  /* Initialize input side of decompressor to consume first scan. */
405  (*cinfo->inputctl->start_input_pass) (cinfo);
406
407#ifdef D_MULTISCAN_FILES_SUPPORTED
408  /* If jpeg_start_decompress will read the whole file, initialize
409   * progress monitoring appropriately.  The input step is counted
410   * as one pass.
411   */
412  if (cinfo->progress != NULL && ! cinfo->buffered_image &&
413      cinfo->inputctl->has_multiple_scans) {
414    int nscans;
415    /* Estimate number of scans to set pass_limit. */
416    if (cinfo->progressive_mode) {
417      /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */
418      nscans = 2 + 3 * cinfo->num_components;
419    } else {
420      /* For a nonprogressive multiscan file, estimate 1 scan per component. */
421      nscans = cinfo->num_components;
422    }
423    cinfo->progress->pass_counter = 0L;
424    cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans;
425    cinfo->progress->completed_passes = 0;
426    cinfo->progress->total_passes = (cinfo->enable_2pass_quant ? 3 : 2);
427    /* Count the input pass as done */
428    master->pass_number++;
429  }
430#endif /* D_MULTISCAN_FILES_SUPPORTED */
431}
432
433
434/*
435 * Per-pass setup.
436 * This is called at the beginning of each output pass.  We determine which
437 * modules will be active during this pass and give them appropriate
438 * start_pass calls.  We also set is_dummy_pass to indicate whether this
439 * is a "real" output pass or a dummy pass for color quantization.
440 * (In the latter case, jdapi.c will crank the pass to completion.)
441 */
442
443METHODDEF(void)
444prepare_for_output_pass (j_decompress_ptr cinfo)
445{
446  my_master_ptr master = (my_master_ptr) cinfo->master;
447
448  if (master->pub.is_dummy_pass) {
449#ifdef QUANT_2PASS_SUPPORTED
450    /* Final pass of 2-pass quantization */
451    master->pub.is_dummy_pass = FALSE;
452    (*cinfo->cquantize->start_pass) (cinfo, FALSE);
453    (*cinfo->post->start_pass) (cinfo, JBUF_CRANK_DEST);
454    (*cinfo->main->start_pass) (cinfo, JBUF_CRANK_DEST);
455#else
456    ERREXIT(cinfo, JERR_NOT_COMPILED);
457#endif /* QUANT_2PASS_SUPPORTED */
458  } else {
459    if (cinfo->quantize_colors && cinfo->colormap == NULL) {
460      /* Select new quantization method */
461      if (cinfo->two_pass_quantize && cinfo->enable_2pass_quant) {
462        cinfo->cquantize = master->quantizer_2pass;
463        master->pub.is_dummy_pass = TRUE;
464      } else if (cinfo->enable_1pass_quant) {
465        cinfo->cquantize = master->quantizer_1pass;
466      } else {
467        ERREXIT(cinfo, JERR_MODE_CHANGE);
468      }
469    }
470    (*cinfo->idct->start_pass) (cinfo);
471    (*cinfo->coef->start_output_pass) (cinfo);
472    if (! cinfo->raw_data_out) {
473      if (! master->using_merged_upsample)
474        (*cinfo->cconvert->start_pass) (cinfo);
475      (*cinfo->upsample->start_pass) (cinfo);
476      if (cinfo->quantize_colors)
477        (*cinfo->cquantize->start_pass) (cinfo, master->pub.is_dummy_pass);
478      (*cinfo->post->start_pass) (cinfo,
479            (master->pub.is_dummy_pass ? JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));
480      (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU);
481    }
482  }
483
484  /* Set up progress monitor's pass info if present */
485  if (cinfo->progress != NULL) {
486    cinfo->progress->completed_passes = master->pass_number;
487    cinfo->progress->total_passes = master->pass_number +
488                                    (master->pub.is_dummy_pass ? 2 : 1);
489    /* In buffered-image mode, we assume one more output pass if EOI not
490     * yet reached, but no more passes if EOI has been reached.
491     */
492    if (cinfo->buffered_image && ! cinfo->inputctl->eoi_reached) {
493      cinfo->progress->total_passes += (cinfo->enable_2pass_quant ? 2 : 1);
494    }
495  }
496}
497
498
499/*
500 * Finish up at end of an output pass.
501 */
502
503METHODDEF(void)
504finish_output_pass (j_decompress_ptr cinfo)
505{
506  my_master_ptr master = (my_master_ptr) cinfo->master;
507
508  if (cinfo->quantize_colors)
509    (*cinfo->cquantize->finish_pass) (cinfo);
510  master->pass_number++;
511}
512
513
514#ifdef D_MULTISCAN_FILES_SUPPORTED
515
516/*
517 * Switch to a new external colormap between output passes.
518 */
519
520GLOBAL(void)
521jpeg_new_colormap (j_decompress_ptr cinfo)
522{
523  my_master_ptr master = (my_master_ptr) cinfo->master;
524
525  /* Prevent application from calling me at wrong times */
526  if (cinfo->global_state != DSTATE_BUFIMAGE)
527    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
528
529  if (cinfo->quantize_colors && cinfo->enable_external_quant &&
530      cinfo->colormap != NULL) {
531    /* Select 2-pass quantizer for external colormap use */
532    cinfo->cquantize = master->quantizer_2pass;
533    /* Notify quantizer of colormap change */
534    (*cinfo->cquantize->new_color_map) (cinfo);
535    master->pub.is_dummy_pass = FALSE; /* just in case */
536  } else
537    ERREXIT(cinfo, JERR_MODE_CHANGE);
538}
539
540#endif /* D_MULTISCAN_FILES_SUPPORTED */
541
542
543/*
544 * Initialize master decompression control and select active modules.
545 * This is performed at the start of jpeg_start_decompress.
546 */
547
548GLOBAL(void)
549jinit_master_decompress (j_decompress_ptr cinfo)
550{
551  my_master_ptr master;
552
553  master = (my_master_ptr)
554      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
555                                  SIZEOF(my_decomp_master));
556  cinfo->master = (struct jpeg_decomp_master *) master;
557  master->pub.prepare_for_output_pass = prepare_for_output_pass;
558  master->pub.finish_output_pass = finish_output_pass;
559
560  master->pub.is_dummy_pass = FALSE;
561
562  master_selection(cinfo);
563}
Note: See TracBrowser for help on using the repository browser.