Coverage Report

Created: 2024-01-23 06:26

/src/libjpeg-turbo.main/jdmaster.c
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * jdmaster.c
3
 *
4
 * This file was part of the Independent JPEG Group's software:
5
 * Copyright (C) 1991-1997, Thomas G. Lane.
6
 * Modified 2002-2009 by Guido Vollbeding.
7
 * Lossless JPEG Modifications:
8
 * Copyright (C) 1999, Ken Murchison.
9
 * libjpeg-turbo Modifications:
10
 * Copyright (C) 2009-2011, 2016, 2019, 2022-2023, D. R. Commander.
11
 * Copyright (C) 2013, Linaro Limited.
12
 * Copyright (C) 2015, Google, Inc.
13
 * For conditions of distribution and use, see the accompanying README.ijg
14
 * 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 "jinclude.h"
24
#include "jpeglib.h"
25
#include "jpegapicomp.h"
26
#include "jdmaster.h"
27
28
29
/*
30
 * Determine whether merged upsample/color conversion should be used.
31
 * CRUCIAL: this must match the actual capabilities of jdmerge.c!
32
 */
33
34
LOCAL(boolean)
35
use_merged_upsample(j_decompress_ptr cinfo)
36
511k
{
37
511k
#ifdef UPSAMPLE_MERGING_SUPPORTED
38
  /* Merging is the equivalent of plain box-filter upsampling */
39
511k
  if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling)
40
283k
    return FALSE;
41
  /* jdmerge.c only supports YCC=>RGB and YCC=>RGB565 color conversion */
42
227k
  if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 ||
43
227k
      (cinfo->out_color_space != JCS_RGB &&
44
188k
       cinfo->out_color_space != JCS_RGB565 &&
45
188k
       cinfo->out_color_space != JCS_EXT_RGB &&
46
188k
       cinfo->out_color_space != JCS_EXT_RGBX &&
47
188k
       cinfo->out_color_space != JCS_EXT_BGR &&
48
188k
       cinfo->out_color_space != JCS_EXT_BGRX &&
49
188k
       cinfo->out_color_space != JCS_EXT_XBGR &&
50
188k
       cinfo->out_color_space != JCS_EXT_XRGB &&
51
188k
       cinfo->out_color_space != JCS_EXT_RGBA &&
52
188k
       cinfo->out_color_space != JCS_EXT_BGRA &&
53
188k
       cinfo->out_color_space != JCS_EXT_ABGR &&
54
188k
       cinfo->out_color_space != JCS_EXT_ARGB))
55
38.9k
    return FALSE;
56
188k
  if ((cinfo->out_color_space == JCS_RGB565 &&
57
188k
       cinfo->out_color_components != 3) ||
58
188k
      (cinfo->out_color_space != JCS_RGB565 &&
59
188k
       cinfo->out_color_components != rgb_pixelsize[cinfo->out_color_space]))
60
0
    return FALSE;
61
  /* and it only handles 2h1v or 2h2v sampling ratios */
62
188k
  if (cinfo->comp_info[0].h_samp_factor != 2 ||
63
188k
      cinfo->comp_info[1].h_samp_factor != 1 ||
64
188k
      cinfo->comp_info[2].h_samp_factor != 1 ||
65
188k
      cinfo->comp_info[0].v_samp_factor >  2 ||
66
188k
      cinfo->comp_info[1].v_samp_factor != 1 ||
67
188k
      cinfo->comp_info[2].v_samp_factor != 1)
68
113k
    return FALSE;
69
  /* furthermore, it doesn't work if we've scaled the IDCTs differently */
70
75.2k
  if (cinfo->comp_info[0]._DCT_scaled_size != cinfo->_min_DCT_scaled_size ||
71
75.2k
      cinfo->comp_info[1]._DCT_scaled_size != cinfo->_min_DCT_scaled_size ||
72
75.2k
      cinfo->comp_info[2]._DCT_scaled_size != cinfo->_min_DCT_scaled_size)
73
0
    return FALSE;
74
  /* ??? also need to test for upsample-time rescaling, when & if supported */
75
75.2k
  return TRUE;                  /* by golly, it'll work... */
76
#else
77
  return FALSE;
78
#endif
79
75.2k
}
80
81
82
/*
83
 * Compute output image dimensions and related values.
84
 * NOTE: this is exported for possible use by application.
85
 * Hence it mustn't do anything that can't be done twice.
86
 */
87
88
#if JPEG_LIB_VERSION >= 80
89
GLOBAL(void)
90
#else
91
LOCAL(void)
92
#endif
93
jpeg_core_output_dimensions(j_decompress_ptr cinfo)
94
/* Do computations that are needed before master selection phase.
95
 * This function is used for transcoding and full decompression.
96
 */
97
255k
{
98
255k
#ifdef IDCT_SCALING_SUPPORTED
99
255k
  int ci;
100
255k
  jpeg_component_info *compptr;
101
102
255k
  if (!cinfo->master->lossless) {
103
    /* Compute actual output image dimensions and DCT scaling choices. */
104
173k
    if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom) {
105
      /* Provide 1/block_size scaling */
106
0
      cinfo->output_width = (JDIMENSION)
107
0
        jdiv_round_up((long)cinfo->image_width, (long)DCTSIZE);
108
0
      cinfo->output_height = (JDIMENSION)
109
0
        jdiv_round_up((long)cinfo->image_height, (long)DCTSIZE);
110
0
      cinfo->_min_DCT_h_scaled_size = 1;
111
0
      cinfo->_min_DCT_v_scaled_size = 1;
112
173k
    } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 2) {
113
      /* Provide 2/block_size scaling */
114
0
      cinfo->output_width = (JDIMENSION)
115
0
        jdiv_round_up((long)cinfo->image_width * 2L, (long)DCTSIZE);
116
0
      cinfo->output_height = (JDIMENSION)
117
0
        jdiv_round_up((long)cinfo->image_height * 2L, (long)DCTSIZE);
118
0
      cinfo->_min_DCT_h_scaled_size = 2;
119
0
      cinfo->_min_DCT_v_scaled_size = 2;
120
173k
    } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 3) {
121
      /* Provide 3/block_size scaling */
122
0
      cinfo->output_width = (JDIMENSION)
123
0
        jdiv_round_up((long)cinfo->image_width * 3L, (long)DCTSIZE);
124
0
      cinfo->output_height = (JDIMENSION)
125
0
        jdiv_round_up((long)cinfo->image_height * 3L, (long)DCTSIZE);
126
0
      cinfo->_min_DCT_h_scaled_size = 3;
127
0
      cinfo->_min_DCT_v_scaled_size = 3;
128
173k
    } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 4) {
129
      /* Provide 4/block_size scaling */
130
19.7k
      cinfo->output_width = (JDIMENSION)
131
19.7k
        jdiv_round_up((long)cinfo->image_width * 4L, (long)DCTSIZE);
132
19.7k
      cinfo->output_height = (JDIMENSION)
133
19.7k
        jdiv_round_up((long)cinfo->image_height * 4L, (long)DCTSIZE);
134
19.7k
      cinfo->_min_DCT_h_scaled_size = 4;
135
19.7k
      cinfo->_min_DCT_v_scaled_size = 4;
136
153k
    } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 5) {
137
      /* Provide 5/block_size scaling */
138
0
      cinfo->output_width = (JDIMENSION)
139
0
        jdiv_round_up((long)cinfo->image_width * 5L, (long)DCTSIZE);
140
0
      cinfo->output_height = (JDIMENSION)
141
0
        jdiv_round_up((long)cinfo->image_height * 5L, (long)DCTSIZE);
142
0
      cinfo->_min_DCT_h_scaled_size = 5;
143
0
      cinfo->_min_DCT_v_scaled_size = 5;
144
153k
    } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 6) {
145
      /* Provide 6/block_size scaling */
146
0
      cinfo->output_width = (JDIMENSION)
147
0
        jdiv_round_up((long)cinfo->image_width * 6L, (long)DCTSIZE);
148
0
      cinfo->output_height = (JDIMENSION)
149
0
        jdiv_round_up((long)cinfo->image_height * 6L, (long)DCTSIZE);
150
0
      cinfo->_min_DCT_h_scaled_size = 6;
151
0
      cinfo->_min_DCT_v_scaled_size = 6;
152
153k
    } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 7) {
153
      /* Provide 7/block_size scaling */
154
0
      cinfo->output_width = (JDIMENSION)
155
0
        jdiv_round_up((long)cinfo->image_width * 7L, (long)DCTSIZE);
156
0
      cinfo->output_height = (JDIMENSION)
157
0
        jdiv_round_up((long)cinfo->image_height * 7L, (long)DCTSIZE);
158
0
      cinfo->_min_DCT_h_scaled_size = 7;
159
0
      cinfo->_min_DCT_v_scaled_size = 7;
160
153k
    } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 8) {
161
      /* Provide 8/block_size scaling */
162
153k
      cinfo->output_width = (JDIMENSION)
163
153k
        jdiv_round_up((long)cinfo->image_width * 8L, (long)DCTSIZE);
164
153k
      cinfo->output_height = (JDIMENSION)
165
153k
        jdiv_round_up((long)cinfo->image_height * 8L, (long)DCTSIZE);
166
153k
      cinfo->_min_DCT_h_scaled_size = 8;
167
153k
      cinfo->_min_DCT_v_scaled_size = 8;
168
153k
    } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 9) {
169
      /* Provide 9/block_size scaling */
170
0
      cinfo->output_width = (JDIMENSION)
171
0
        jdiv_round_up((long)cinfo->image_width * 9L, (long)DCTSIZE);
172
0
      cinfo->output_height = (JDIMENSION)
173
0
        jdiv_round_up((long)cinfo->image_height * 9L, (long)DCTSIZE);
174
0
      cinfo->_min_DCT_h_scaled_size = 9;
175
0
      cinfo->_min_DCT_v_scaled_size = 9;
176
0
    } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 10) {
177
      /* Provide 10/block_size scaling */
178
0
      cinfo->output_width = (JDIMENSION)
179
0
        jdiv_round_up((long)cinfo->image_width * 10L, (long)DCTSIZE);
180
0
      cinfo->output_height = (JDIMENSION)
181
0
        jdiv_round_up((long)cinfo->image_height * 10L, (long)DCTSIZE);
182
0
      cinfo->_min_DCT_h_scaled_size = 10;
183
0
      cinfo->_min_DCT_v_scaled_size = 10;
184
0
    } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 11) {
185
      /* Provide 11/block_size scaling */
186
0
      cinfo->output_width = (JDIMENSION)
187
0
        jdiv_round_up((long)cinfo->image_width * 11L, (long)DCTSIZE);
188
0
      cinfo->output_height = (JDIMENSION)
189
0
        jdiv_round_up((long)cinfo->image_height * 11L, (long)DCTSIZE);
190
0
      cinfo->_min_DCT_h_scaled_size = 11;
191
0
      cinfo->_min_DCT_v_scaled_size = 11;
192
0
    } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 12) {
193
      /* Provide 12/block_size scaling */
194
0
      cinfo->output_width = (JDIMENSION)
195
0
        jdiv_round_up((long)cinfo->image_width * 12L, (long)DCTSIZE);
196
0
      cinfo->output_height = (JDIMENSION)
197
0
        jdiv_round_up((long)cinfo->image_height * 12L, (long)DCTSIZE);
198
0
      cinfo->_min_DCT_h_scaled_size = 12;
199
0
      cinfo->_min_DCT_v_scaled_size = 12;
200
0
    } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 13) {
201
      /* Provide 13/block_size scaling */
202
0
      cinfo->output_width = (JDIMENSION)
203
0
        jdiv_round_up((long)cinfo->image_width * 13L, (long)DCTSIZE);
204
0
      cinfo->output_height = (JDIMENSION)
205
0
        jdiv_round_up((long)cinfo->image_height * 13L, (long)DCTSIZE);
206
0
      cinfo->_min_DCT_h_scaled_size = 13;
207
0
      cinfo->_min_DCT_v_scaled_size = 13;
208
0
    } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 14) {
209
      /* Provide 14/block_size scaling */
210
0
      cinfo->output_width = (JDIMENSION)
211
0
        jdiv_round_up((long)cinfo->image_width * 14L, (long)DCTSIZE);
212
0
      cinfo->output_height = (JDIMENSION)
213
0
        jdiv_round_up((long)cinfo->image_height * 14L, (long)DCTSIZE);
214
0
      cinfo->_min_DCT_h_scaled_size = 14;
215
0
      cinfo->_min_DCT_v_scaled_size = 14;
216
0
    } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 15) {
217
      /* Provide 15/block_size scaling */
218
0
      cinfo->output_width = (JDIMENSION)
219
0
        jdiv_round_up((long)cinfo->image_width * 15L, (long)DCTSIZE);
220
0
      cinfo->output_height = (JDIMENSION)
221
0
        jdiv_round_up((long)cinfo->image_height * 15L, (long)DCTSIZE);
222
0
      cinfo->_min_DCT_h_scaled_size = 15;
223
0
      cinfo->_min_DCT_v_scaled_size = 15;
224
0
    } else {
225
      /* Provide 16/block_size scaling */
226
0
      cinfo->output_width = (JDIMENSION)
227
0
        jdiv_round_up((long)cinfo->image_width * 16L, (long)DCTSIZE);
228
0
      cinfo->output_height = (JDIMENSION)
229
0
        jdiv_round_up((long)cinfo->image_height * 16L, (long)DCTSIZE);
230
0
      cinfo->_min_DCT_h_scaled_size = 16;
231
0
      cinfo->_min_DCT_v_scaled_size = 16;
232
0
    }
233
234
    /* Recompute dimensions of components */
235
662k
    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
236
489k
         ci++, compptr++) {
237
489k
      compptr->_DCT_h_scaled_size = cinfo->_min_DCT_h_scaled_size;
238
489k
      compptr->_DCT_v_scaled_size = cinfo->_min_DCT_v_scaled_size;
239
489k
    }
240
173k
  } else
241
82.8k
#endif /* !IDCT_SCALING_SUPPORTED */
242
82.8k
  {
243
    /* Hardwire it to "no scaling" */
244
82.8k
    cinfo->output_width = cinfo->image_width;
245
82.8k
    cinfo->output_height = cinfo->image_height;
246
    /* jdinput.c has already initialized DCT_scaled_size,
247
     * and has computed unscaled downsampled_width and downsampled_height.
248
     */
249
82.8k
  }
250
255k
}
251
252
253
/*
254
 * Compute output image dimensions and related values.
255
 * NOTE: this is exported for possible use by application.
256
 * Hence it mustn't do anything that can't be done twice.
257
 * Also note that it may be called before the master module is initialized!
258
 */
259
260
GLOBAL(void)
261
jpeg_calc_output_dimensions(j_decompress_ptr cinfo)
262
/* Do computations that are needed before master selection phase */
263
255k
{
264
255k
#ifdef IDCT_SCALING_SUPPORTED
265
255k
  int ci;
266
255k
  jpeg_component_info *compptr;
267
255k
#endif
268
269
  /* Prevent application from calling me at wrong times */
270
255k
  if (cinfo->global_state != DSTATE_READY)
271
0
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
272
273
  /* Compute core output image dimensions and DCT scaling choices. */
274
255k
  jpeg_core_output_dimensions(cinfo);
275
276
255k
#ifdef IDCT_SCALING_SUPPORTED
277
278
255k
  if (!cinfo->master->lossless) {
279
    /* In selecting the actual DCT scaling for each component, we try to
280
     * scale up the chroma components via IDCT scaling rather than upsampling.
281
     * This saves time if the upsampler gets to use 1:1 scaling.
282
     * Note this code adapts subsampling ratios which are powers of 2.
283
     */
284
662k
    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
285
489k
         ci++, compptr++) {
286
489k
      int ssize = cinfo->_min_DCT_scaled_size;
287
510k
      while (ssize < DCTSIZE &&
288
510k
             ((cinfo->max_h_samp_factor * cinfo->_min_DCT_scaled_size) %
289
54.7k
              (compptr->h_samp_factor * ssize * 2) == 0) &&
290
510k
             ((cinfo->max_v_samp_factor * cinfo->_min_DCT_scaled_size) %
291
31.2k
              (compptr->v_samp_factor * ssize * 2) == 0)) {
292
20.8k
        ssize = ssize * 2;
293
20.8k
      }
294
#if JPEG_LIB_VERSION >= 70
295
      compptr->DCT_h_scaled_size = compptr->DCT_v_scaled_size = ssize;
296
#else
297
489k
      compptr->DCT_scaled_size = ssize;
298
489k
#endif
299
489k
    }
300
301
    /* Recompute downsampled dimensions of components;
302
     * application needs to know these if using raw downsampled data.
303
     */
304
662k
    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
305
489k
         ci++, compptr++) {
306
      /* Size in samples, after IDCT scaling */
307
489k
      compptr->downsampled_width = (JDIMENSION)
308
489k
        jdiv_round_up((long)cinfo->image_width *
309
489k
                      (long)(compptr->h_samp_factor *
310
489k
                             compptr->_DCT_scaled_size),
311
489k
                      (long)(cinfo->max_h_samp_factor * DCTSIZE));
312
489k
      compptr->downsampled_height = (JDIMENSION)
313
489k
        jdiv_round_up((long)cinfo->image_height *
314
489k
                      (long)(compptr->v_samp_factor *
315
489k
                             compptr->_DCT_scaled_size),
316
489k
                      (long)(cinfo->max_v_samp_factor * DCTSIZE));
317
489k
    }
318
173k
  } else
319
82.8k
#endif /* IDCT_SCALING_SUPPORTED */
320
82.8k
  {
321
    /* Hardwire it to "no scaling" */
322
82.8k
    cinfo->output_width = cinfo->image_width;
323
82.8k
    cinfo->output_height = cinfo->image_height;
324
    /* jdinput.c has already initialized DCT_scaled_size to DCTSIZE,
325
     * and has computed unscaled downsampled_width and downsampled_height.
326
     */
327
82.8k
  }
328
329
  /* Report number of components in selected colorspace. */
330
  /* Probably this should be in the color conversion module... */
331
255k
  switch (cinfo->out_color_space) {
332
22.9k
  case JCS_GRAYSCALE:
333
22.9k
    cinfo->out_color_components = 1;
334
22.9k
    break;
335
0
  case JCS_RGB:
336
190k
  case JCS_EXT_RGB:
337
190k
  case JCS_EXT_RGBX:
338
190k
  case JCS_EXT_BGR:
339
213k
  case JCS_EXT_BGRX:
340
213k
  case JCS_EXT_XBGR:
341
213k
  case JCS_EXT_XRGB:
342
213k
  case JCS_EXT_RGBA:
343
213k
  case JCS_EXT_BGRA:
344
213k
  case JCS_EXT_ABGR:
345
213k
  case JCS_EXT_ARGB:
346
213k
    cinfo->out_color_components = rgb_pixelsize[cinfo->out_color_space];
347
213k
    break;
348
0
  case JCS_YCbCr:
349
0
  case JCS_RGB565:
350
0
    cinfo->out_color_components = 3;
351
0
    break;
352
19.7k
  case JCS_CMYK:
353
19.7k
  case JCS_YCCK:
354
19.7k
    cinfo->out_color_components = 4;
355
19.7k
    break;
356
0
  default:                      /* else must be same colorspace as in file */
357
0
    cinfo->out_color_components = cinfo->num_components;
358
0
    break;
359
255k
  }
360
255k
  cinfo->output_components = (cinfo->quantize_colors ? 1 :
361
255k
                              cinfo->out_color_components);
362
363
  /* See if upsampler will want to emit more than one row at a time */
364
255k
  if (use_merged_upsample(cinfo))
365
37.6k
    cinfo->rec_outbuf_height = cinfo->max_v_samp_factor;
366
218k
  else
367
218k
    cinfo->rec_outbuf_height = 1;
368
255k
}
369
370
371
/*
372
 * Several decompression processes need to range-limit values to the range
373
 * 0..MAXJSAMPLE; the input value may fall somewhat outside this range
374
 * due to noise introduced by quantization, roundoff error, etc.  These
375
 * processes are inner loops and need to be as fast as possible.  On most
376
 * machines, particularly CPUs with pipelines or instruction prefetch,
377
 * a (subscript-check-less) C table lookup
378
 *              x = sample_range_limit[x];
379
 * is faster than explicit tests
380
 *              if (x < 0)  x = 0;
381
 *              else if (x > MAXJSAMPLE)  x = MAXJSAMPLE;
382
 * These processes all use a common table prepared by the routine below.
383
 *
384
 * For most steps we can mathematically guarantee that the initial value
385
 * of x is within MAXJSAMPLE+1 of the legal range, so a table running from
386
 * -(MAXJSAMPLE+1) to 2*MAXJSAMPLE+1 is sufficient.  But for the initial
387
 * limiting step (just after the IDCT), a wildly out-of-range value is
388
 * possible if the input data is corrupt.  To avoid any chance of indexing
389
 * off the end of memory and getting a bad-pointer trap, we perform the
390
 * post-IDCT limiting thus:
391
 *              x = range_limit[x & MASK];
392
 * where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit
393
 * samples.  Under normal circumstances this is more than enough range and
394
 * a correct output will be generated; with bogus input data the mask will
395
 * cause wraparound, and we will safely generate a bogus-but-in-range output.
396
 * For the post-IDCT step, we want to convert the data from signed to unsigned
397
 * representation by adding CENTERJSAMPLE at the same time that we limit it.
398
 * So the post-IDCT limiting table ends up looking like this:
399
 *   CENTERJSAMPLE,CENTERJSAMPLE+1,...,MAXJSAMPLE,
400
 *   MAXJSAMPLE (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),
401
 *   0          (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),
402
 *   0,1,...,CENTERJSAMPLE-1
403
 * Negative inputs select values from the upper half of the table after
404
 * masking.
405
 *
406
 * We can save some space by overlapping the start of the post-IDCT table
407
 * with the simpler range limiting table.  The post-IDCT table begins at
408
 * sample_range_limit + CENTERJSAMPLE.
409
 */
410
411
LOCAL(void)
412
prepare_range_limit_table(j_decompress_ptr cinfo)
413
/* Allocate and fill in the sample_range_limit table */
414
255k
{
415
255k
  JSAMPLE *table;
416
255k
  J12SAMPLE *table12;
417
255k
#ifdef D_LOSSLESS_SUPPORTED
418
255k
  J16SAMPLE *table16;
419
255k
#endif
420
255k
  int i;
421
422
255k
  if (cinfo->data_precision == 16) {
423
29.3k
#ifdef D_LOSSLESS_SUPPORTED
424
29.3k
    table16 = (J16SAMPLE *)
425
29.3k
      (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
426
29.3k
                  (5 * (MAXJ16SAMPLE + 1) + CENTERJ16SAMPLE) *
427
29.3k
                  sizeof(J16SAMPLE));
428
29.3k
    table16 += (MAXJ16SAMPLE + 1);  /* allow negative subscripts of simple
429
                                       table */
430
29.3k
    cinfo->sample_range_limit = (JSAMPLE *)table16;
431
    /* First segment of "simple" table: limit[x] = 0 for x < 0 */
432
29.3k
    memset(table16 - (MAXJ16SAMPLE + 1), 0,
433
29.3k
           (MAXJ16SAMPLE + 1) * sizeof(J16SAMPLE));
434
    /* Main part of "simple" table: limit[x] = x */
435
1.92G
    for (i = 0; i <= MAXJ16SAMPLE; i++)
436
1.92G
      table16[i] = (J16SAMPLE)i;
437
29.3k
    table16 += CENTERJ16SAMPLE; /* Point to where post-IDCT table starts */
438
    /* End of simple table, rest of first half of post-IDCT table */
439
2.88G
    for (i = CENTERJ16SAMPLE; i < 2 * (MAXJ16SAMPLE + 1); i++)
440
2.88G
      table16[i] = MAXJ16SAMPLE;
441
    /* Second half of post-IDCT table */
442
29.3k
    memset(table16 + (2 * (MAXJ16SAMPLE + 1)), 0,
443
29.3k
           (2 * (MAXJ16SAMPLE + 1) - CENTERJ16SAMPLE) * sizeof(J16SAMPLE));
444
29.3k
    memcpy(table16 + (4 * (MAXJ16SAMPLE + 1) - CENTERJ16SAMPLE),
445
29.3k
           cinfo->sample_range_limit, CENTERJ16SAMPLE * sizeof(J16SAMPLE));
446
#else
447
    ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
448
#endif
449
226k
  } else if (cinfo->data_precision == 12) {
450
105k
    table12 = (J12SAMPLE *)
451
105k
      (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
452
105k
                  (5 * (MAXJ12SAMPLE + 1) + CENTERJ12SAMPLE) *
453
105k
                  sizeof(J12SAMPLE));
454
105k
    table12 += (MAXJ12SAMPLE + 1);  /* allow negative subscripts of simple
455
                                       table */
456
105k
    cinfo->sample_range_limit = (JSAMPLE *)table12;
457
    /* First segment of "simple" table: limit[x] = 0 for x < 0 */
458
105k
    memset(table12 - (MAXJ12SAMPLE + 1), 0,
459
105k
           (MAXJ12SAMPLE + 1) * sizeof(J12SAMPLE));
460
    /* Main part of "simple" table: limit[x] = x */
461
434M
    for (i = 0; i <= MAXJ12SAMPLE; i++)
462
434M
      table12[i] = (J12SAMPLE)i;
463
105k
    table12 += CENTERJ12SAMPLE; /* Point to where post-IDCT table starts */
464
    /* End of simple table, rest of first half of post-IDCT table */
465
651M
    for (i = CENTERJ12SAMPLE; i < 2 * (MAXJ12SAMPLE + 1); i++)
466
651M
      table12[i] = MAXJ12SAMPLE;
467
    /* Second half of post-IDCT table */
468
105k
    memset(table12 + (2 * (MAXJ12SAMPLE + 1)), 0,
469
105k
           (2 * (MAXJ12SAMPLE + 1) - CENTERJ12SAMPLE) * sizeof(J12SAMPLE));
470
105k
    memcpy(table12 + (4 * (MAXJ12SAMPLE + 1) - CENTERJ12SAMPLE),
471
105k
           cinfo->sample_range_limit, CENTERJ12SAMPLE * sizeof(J12SAMPLE));
472
120k
  } else {
473
120k
    table = (JSAMPLE *)
474
120k
      (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
475
120k
                  (5 * (MAXJSAMPLE + 1) + CENTERJSAMPLE) * sizeof(JSAMPLE));
476
120k
    table += (MAXJSAMPLE + 1);  /* allow negative subscripts of simple table */
477
120k
    cinfo->sample_range_limit = table;
478
    /* First segment of "simple" table: limit[x] = 0 for x < 0 */
479
120k
    memset(table - (MAXJSAMPLE + 1), 0, (MAXJSAMPLE + 1) * sizeof(JSAMPLE));
480
    /* Main part of "simple" table: limit[x] = x */
481
30.9M
    for (i = 0; i <= MAXJSAMPLE; i++)
482
30.8M
      table[i] = (JSAMPLE)i;
483
120k
    table += CENTERJSAMPLE;     /* Point to where post-IDCT table starts */
484
    /* End of simple table, rest of first half of post-IDCT table */
485
46.4M
    for (i = CENTERJSAMPLE; i < 2 * (MAXJSAMPLE + 1); i++)
486
46.3M
      table[i] = MAXJSAMPLE;
487
    /* Second half of post-IDCT table */
488
120k
    memset(table + (2 * (MAXJSAMPLE + 1)), 0,
489
120k
           (2 * (MAXJSAMPLE + 1) - CENTERJSAMPLE) * sizeof(JSAMPLE));
490
120k
    memcpy(table + (4 * (MAXJSAMPLE + 1) - CENTERJSAMPLE),
491
120k
           cinfo->sample_range_limit, CENTERJSAMPLE * sizeof(JSAMPLE));
492
120k
  }
493
255k
}
494
495
496
/*
497
 * Master selection of decompression modules.
498
 * This is done once at jpeg_start_decompress time.  We determine
499
 * which modules will be used and give them appropriate initialization calls.
500
 * We also initialize the decompressor input side to begin consuming data.
501
 *
502
 * Since jpeg_read_header has finished, we know what is in the SOF
503
 * and (first) SOS markers.  We also have all the application parameter
504
 * settings.
505
 */
506
507
LOCAL(void)
508
master_selection(j_decompress_ptr cinfo)
509
255k
{
510
255k
  my_master_ptr master = (my_master_ptr)cinfo->master;
511
255k
  boolean use_c_buffer;
512
255k
  long samplesperrow;
513
255k
  JDIMENSION jd_samplesperrow;
514
515
  /* Disable IDCT scaling and raw (downsampled) data output in lossless mode.
516
   * IDCT scaling is not useful in lossless mode, and it must be disabled in
517
   * order to properly calculate the output dimensions.  Raw data output isn't
518
   * particularly useful without subsampling and has not been tested in
519
   * lossless mode.
520
   */
521
255k
  if (cinfo->master->lossless) {
522
82.8k
    cinfo->raw_data_out = FALSE;
523
82.8k
    cinfo->scale_num = cinfo->scale_denom = 1;
524
82.8k
  }
525
526
  /* Initialize dimensions and other stuff */
527
255k
  jpeg_calc_output_dimensions(cinfo);
528
255k
  prepare_range_limit_table(cinfo);
529
530
  /* Width of an output scanline must be representable as JDIMENSION. */
531
255k
  samplesperrow = (long)cinfo->output_width *
532
255k
                  (long)cinfo->out_color_components;
533
255k
  jd_samplesperrow = (JDIMENSION)samplesperrow;
534
255k
  if ((long)jd_samplesperrow != samplesperrow)
535
0
    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
536
537
  /* Initialize my private state */
538
255k
  master->pass_number = 0;
539
255k
  master->using_merged_upsample = use_merged_upsample(cinfo);
540
541
  /* Color quantizer selection */
542
255k
  master->quantizer_1pass = NULL;
543
255k
  master->quantizer_2pass = NULL;
544
  /* No mode changes if not using buffered-image mode. */
545
255k
  if (!cinfo->quantize_colors || !cinfo->buffered_image) {
546
255k
    cinfo->enable_1pass_quant = FALSE;
547
255k
    cinfo->enable_external_quant = FALSE;
548
255k
    cinfo->enable_2pass_quant = FALSE;
549
255k
  }
550
255k
  if (cinfo->quantize_colors) {
551
0
    if (cinfo->raw_data_out)
552
0
      ERREXIT(cinfo, JERR_NOTIMPL);
553
    /* 2-pass quantizer only works in 3-component color space. */
554
0
    if (cinfo->out_color_components != 3 ||
555
0
        cinfo->out_color_space == JCS_RGB565) {
556
0
      cinfo->enable_1pass_quant = TRUE;
557
0
      cinfo->enable_external_quant = FALSE;
558
0
      cinfo->enable_2pass_quant = FALSE;
559
0
      cinfo->colormap = NULL;
560
0
    } else if (cinfo->colormap != NULL) {
561
0
      cinfo->enable_external_quant = TRUE;
562
0
    } else if (cinfo->two_pass_quantize) {
563
0
      cinfo->enable_2pass_quant = TRUE;
564
0
    } else {
565
0
      cinfo->enable_1pass_quant = TRUE;
566
0
    }
567
568
0
    if (cinfo->enable_1pass_quant) {
569
0
#ifdef QUANT_1PASS_SUPPORTED
570
0
      if (cinfo->data_precision == 16)
571
0
#ifdef D_LOSSLESS_SUPPORTED
572
0
        j16init_1pass_quantizer(cinfo);
573
#else
574
        ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
575
#endif
576
0
      else if (cinfo->data_precision == 12)
577
0
        j12init_1pass_quantizer(cinfo);
578
0
      else
579
0
        jinit_1pass_quantizer(cinfo);
580
0
      master->quantizer_1pass = cinfo->cquantize;
581
#else
582
      ERREXIT(cinfo, JERR_NOT_COMPILED);
583
#endif
584
0
    }
585
586
    /* We use the 2-pass code to map to external colormaps. */
587
0
    if (cinfo->enable_2pass_quant || cinfo->enable_external_quant) {
588
0
#ifdef QUANT_2PASS_SUPPORTED
589
0
      if (cinfo->data_precision == 16)
590
0
#ifdef D_LOSSLESS_SUPPORTED
591
0
        j16init_2pass_quantizer(cinfo);
592
#else
593
        ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
594
#endif
595
0
      else if (cinfo->data_precision == 12)
596
0
        j12init_2pass_quantizer(cinfo);
597
0
      else
598
0
        jinit_2pass_quantizer(cinfo);
599
0
      master->quantizer_2pass = cinfo->cquantize;
600
#else
601
      ERREXIT(cinfo, JERR_NOT_COMPILED);
602
#endif
603
0
    }
604
    /* If both quantizers are initialized, the 2-pass one is left active;
605
     * this is necessary for starting with quantization to an external map.
606
     */
607
0
  }
608
609
  /* Post-processing: in particular, color conversion first */
610
255k
  if (!cinfo->raw_data_out) {
611
255k
    if (master->using_merged_upsample) {
612
37.6k
#ifdef UPSAMPLE_MERGING_SUPPORTED
613
37.6k
      if (cinfo->data_precision == 16)
614
69
        ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
615
37.5k
      else if (cinfo->data_precision == 12)
616
9.01k
        j12init_merged_upsampler(cinfo); /* does color conversion too */
617
28.5k
      else
618
28.5k
        jinit_merged_upsampler(cinfo); /* does color conversion too */
619
#else
620
      ERREXIT(cinfo, JERR_NOT_COMPILED);
621
#endif
622
218k
    } else {
623
218k
      if (cinfo->data_precision == 16) {
624
29.2k
#ifdef D_LOSSLESS_SUPPORTED
625
29.2k
        j16init_color_deconverter(cinfo);
626
29.2k
        j16init_upsampler(cinfo);
627
#else
628
        ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
629
#endif
630
189k
      } else if (cinfo->data_precision == 12) {
631
96.9k
        j12init_color_deconverter(cinfo);
632
96.9k
        j12init_upsampler(cinfo);
633
96.9k
      } else {
634
92.0k
        jinit_color_deconverter(cinfo);
635
92.0k
        jinit_upsampler(cinfo);
636
92.0k
      }
637
218k
    }
638
255k
    if (cinfo->data_precision == 16)
639
27.7k
#ifdef D_LOSSLESS_SUPPORTED
640
27.7k
      j16init_d_post_controller(cinfo, cinfo->enable_2pass_quant);
641
#else
642
      ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
643
#endif
644
228k
    else if (cinfo->data_precision == 12)
645
91.0k
      j12init_d_post_controller(cinfo, cinfo->enable_2pass_quant);
646
137k
    else
647
137k
      jinit_d_post_controller(cinfo, cinfo->enable_2pass_quant);
648
255k
  }
649
650
255k
  if (cinfo->master->lossless) {
651
79.1k
#ifdef D_LOSSLESS_SUPPORTED
652
    /* Prediction, sample undifferencing, point transform, and sample size
653
     * scaling
654
     */
655
79.1k
    if (cinfo->data_precision == 16)
656
27.5k
      j16init_lossless_decompressor(cinfo);
657
51.5k
    else if (cinfo->data_precision == 12)
658
26.4k
      j12init_lossless_decompressor(cinfo);
659
25.1k
    else
660
25.1k
      jinit_lossless_decompressor(cinfo);
661
    /* Entropy decoding: either Huffman or arithmetic coding. */
662
79.1k
    if (cinfo->arith_code) {
663
144
      ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
664
78.9k
    } else {
665
78.9k
      jinit_lhuff_decoder(cinfo);
666
78.9k
    }
667
668
    /* Initialize principal buffer controllers. */
669
79.1k
    use_c_buffer = cinfo->inputctl->has_multiple_scans ||
670
79.1k
                   cinfo->buffered_image;
671
79.1k
    if (cinfo->data_precision == 16)
672
27.5k
      j16init_d_diff_controller(cinfo, use_c_buffer);
673
51.5k
    else if (cinfo->data_precision == 12)
674
26.3k
      j12init_d_diff_controller(cinfo, use_c_buffer);
675
25.1k
    else
676
25.1k
      jinit_d_diff_controller(cinfo, use_c_buffer);
677
#else
678
    ERREXIT(cinfo, JERR_NOT_COMPILED);
679
#endif
680
176k
  } else {
681
176k
    if (cinfo->data_precision == 16)
682
192
      ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
683
    /* Inverse DCT */
684
176k
    if (cinfo->data_precision == 12)
685
64.5k
      j12init_inverse_dct(cinfo);
686
112k
    else
687
112k
      jinit_inverse_dct(cinfo);
688
    /* Entropy decoding: either Huffman or arithmetic coding. */
689
176k
    if (cinfo->arith_code) {
690
47.2k
#ifdef D_ARITH_CODING_SUPPORTED
691
47.2k
      jinit_arith_decoder(cinfo);
692
#else
693
      ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
694
#endif
695
129k
    } else {
696
129k
      if (cinfo->progressive_mode) {
697
26.0k
#ifdef D_PROGRESSIVE_SUPPORTED
698
26.0k
        jinit_phuff_decoder(cinfo);
699
#else
700
        ERREXIT(cinfo, JERR_NOT_COMPILED);
701
#endif
702
26.0k
      } else
703
103k
        jinit_huff_decoder(cinfo);
704
129k
    }
705
706
    /* Initialize principal buffer controllers. */
707
176k
    use_c_buffer = cinfo->inputctl->has_multiple_scans ||
708
176k
                   cinfo->buffered_image;
709
176k
    if (cinfo->data_precision == 12)
710
64.5k
      j12init_d_coef_controller(cinfo, use_c_buffer);
711
112k
    else
712
112k
      jinit_d_coef_controller(cinfo, use_c_buffer);
713
176k
  }
714
715
255k
  if (!cinfo->raw_data_out) {
716
231k
    if (cinfo->data_precision == 16)
717
27.5k
#ifdef D_LOSSLESS_SUPPORTED
718
27.5k
      j16init_d_main_controller(cinfo,
719
27.5k
                                FALSE /* never need full buffer here */);
720
#else
721
      ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
722
#endif
723
203k
    else if (cinfo->data_precision == 12)
724
90.9k
      j12init_d_main_controller(cinfo,
725
90.9k
                                FALSE /* never need full buffer here */);
726
112k
    else
727
112k
      jinit_d_main_controller(cinfo, FALSE /* never need full buffer here */);
728
231k
  }
729
730
  /* We can now tell the memory manager to allocate virtual arrays. */
731
255k
  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr)cinfo);
732
733
  /* Initialize input side of decompressor to consume first scan. */
734
255k
  (*cinfo->inputctl->start_input_pass) (cinfo);
735
736
  /* Set the first and last iMCU columns to decompress from single-scan images.
737
   * By default, decompress all of the iMCU columns.
738
   */
739
255k
  cinfo->master->first_iMCU_col = 0;
740
255k
  cinfo->master->last_iMCU_col = cinfo->MCUs_per_row - 1;
741
255k
  cinfo->master->last_good_iMCU_row = 0;
742
743
255k
#ifdef D_MULTISCAN_FILES_SUPPORTED
744
  /* If jpeg_start_decompress will read the whole file, initialize
745
   * progress monitoring appropriately.  The input step is counted
746
   * as one pass.
747
   */
748
255k
  if (cinfo->progress != NULL && !cinfo->buffered_image &&
749
255k
      cinfo->inputctl->has_multiple_scans) {
750
72.1k
    int nscans;
751
    /* Estimate number of scans to set pass_limit. */
752
72.1k
    if (cinfo->progressive_mode) {
753
      /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */
754
59.4k
      nscans = 2 + 3 * cinfo->num_components;
755
59.4k
    } else {
756
      /* For a nonprogressive multiscan file, estimate 1 scan per component. */
757
12.7k
      nscans = cinfo->num_components;
758
12.7k
    }
759
72.1k
    cinfo->progress->pass_counter = 0L;
760
72.1k
    cinfo->progress->pass_limit = (long)cinfo->total_iMCU_rows * nscans;
761
72.1k
    cinfo->progress->completed_passes = 0;
762
72.1k
    cinfo->progress->total_passes = (cinfo->enable_2pass_quant ? 3 : 2);
763
    /* Count the input pass as done */
764
72.1k
    master->pass_number++;
765
72.1k
  }
766
255k
#endif /* D_MULTISCAN_FILES_SUPPORTED */
767
255k
}
768
769
770
/*
771
 * Per-pass setup.
772
 * This is called at the beginning of each output pass.  We determine which
773
 * modules will be active during this pass and give them appropriate
774
 * start_pass calls.  We also set is_dummy_pass to indicate whether this
775
 * is a "real" output pass or a dummy pass for color quantization.
776
 * (In the latter case, jdapistd.c will crank the pass to completion.)
777
 */
778
779
METHODDEF(void)
780
prepare_for_output_pass(j_decompress_ptr cinfo)
781
201k
{
782
201k
  my_master_ptr master = (my_master_ptr)cinfo->master;
783
784
201k
  if (master->pub.is_dummy_pass) {
785
0
#ifdef QUANT_2PASS_SUPPORTED
786
    /* Final pass of 2-pass quantization */
787
0
    master->pub.is_dummy_pass = FALSE;
788
0
    (*cinfo->cquantize->start_pass) (cinfo, FALSE);
789
0
    (*cinfo->post->start_pass) (cinfo, JBUF_CRANK_DEST);
790
0
    (*cinfo->main->start_pass) (cinfo, JBUF_CRANK_DEST);
791
#else
792
    ERREXIT(cinfo, JERR_NOT_COMPILED);
793
#endif /* QUANT_2PASS_SUPPORTED */
794
201k
  } else {
795
201k
    if (cinfo->quantize_colors && cinfo->colormap == NULL) {
796
      /* Select new quantization method */
797
0
      if (cinfo->two_pass_quantize && cinfo->enable_2pass_quant) {
798
0
        cinfo->cquantize = master->quantizer_2pass;
799
0
        master->pub.is_dummy_pass = TRUE;
800
0
      } else if (cinfo->enable_1pass_quant) {
801
0
        cinfo->cquantize = master->quantizer_1pass;
802
0
      } else {
803
0
        ERREXIT(cinfo, JERR_MODE_CHANGE);
804
0
      }
805
0
    }
806
201k
    (*cinfo->idct->start_pass) (cinfo);
807
201k
    (*cinfo->coef->start_output_pass) (cinfo);
808
201k
    if (!cinfo->raw_data_out) {
809
201k
      if (!master->using_merged_upsample)
810
171k
        (*cinfo->cconvert->start_pass) (cinfo);
811
201k
      (*cinfo->upsample->start_pass) (cinfo);
812
201k
      if (cinfo->quantize_colors)
813
0
        (*cinfo->cquantize->start_pass) (cinfo, master->pub.is_dummy_pass);
814
201k
      (*cinfo->post->start_pass) (cinfo,
815
201k
            (master->pub.is_dummy_pass ? JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));
816
201k
      (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU);
817
201k
    }
818
201k
  }
819
820
  /* Set up progress monitor's pass info if present */
821
201k
  if (cinfo->progress != NULL) {
822
201k
    cinfo->progress->completed_passes = master->pass_number;
823
201k
    cinfo->progress->total_passes = master->pass_number +
824
201k
                                    (master->pub.is_dummy_pass ? 2 : 1);
825
    /* In buffered-image mode, we assume one more output pass if EOI not
826
     * yet reached, but no more passes if EOI has been reached.
827
     */
828
201k
    if (cinfo->buffered_image && !cinfo->inputctl->eoi_reached) {
829
0
      cinfo->progress->total_passes += (cinfo->enable_2pass_quant ? 2 : 1);
830
0
    }
831
201k
  }
832
201k
}
833
834
835
/*
836
 * Finish up at end of an output pass.
837
 */
838
839
METHODDEF(void)
840
finish_output_pass(j_decompress_ptr cinfo)
841
199k
{
842
199k
  my_master_ptr master = (my_master_ptr)cinfo->master;
843
844
199k
  if (cinfo->quantize_colors)
845
0
    (*cinfo->cquantize->finish_pass) (cinfo);
846
199k
  master->pass_number++;
847
199k
}
848
849
850
#ifdef D_MULTISCAN_FILES_SUPPORTED
851
852
/*
853
 * Switch to a new external colormap between output passes.
854
 */
855
856
GLOBAL(void)
857
jpeg_new_colormap(j_decompress_ptr cinfo)
858
0
{
859
0
  my_master_ptr master = (my_master_ptr)cinfo->master;
860
861
  /* Prevent application from calling me at wrong times */
862
0
  if (cinfo->global_state != DSTATE_BUFIMAGE)
863
0
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
864
865
0
  if (cinfo->quantize_colors && cinfo->enable_external_quant &&
866
0
      cinfo->colormap != NULL) {
867
    /* Select 2-pass quantizer for external colormap use */
868
0
    cinfo->cquantize = master->quantizer_2pass;
869
    /* Notify quantizer of colormap change */
870
0
    (*cinfo->cquantize->new_color_map) (cinfo);
871
0
    master->pub.is_dummy_pass = FALSE; /* just in case */
872
0
  } else
873
0
    ERREXIT(cinfo, JERR_MODE_CHANGE);
874
0
}
875
876
#endif /* D_MULTISCAN_FILES_SUPPORTED */
877
878
879
/*
880
 * Initialize master decompression control and select active modules.
881
 * This is performed at the start of jpeg_start_decompress.
882
 */
883
884
GLOBAL(void)
885
jinit_master_decompress(j_decompress_ptr cinfo)
886
255k
{
887
255k
  my_master_ptr master = (my_master_ptr)cinfo->master;
888
889
255k
  master->pub.prepare_for_output_pass = prepare_for_output_pass;
890
255k
  master->pub.finish_output_pass = finish_output_pass;
891
892
255k
  master->pub.is_dummy_pass = FALSE;
893
255k
  master->pub.jinit_upsampler_no_alloc = FALSE;
894
895
255k
  master_selection(cinfo);
896
255k
}