52#ifdef IDCT_SCALING_SUPPORTED
220 if (cinfo->data_precision < 8 || cinfo->data_precision > 12)
221 ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
225 ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
229 cinfo->max_h_samp_factor = 1;
230 cinfo->max_v_samp_factor = 1;
231 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
235 ERREXIT(cinfo, JERR_BAD_SAMPLING);
236 cinfo->max_h_samp_factor =
MAX(cinfo->max_h_samp_factor,
238 cinfo->max_v_samp_factor =
MAX(cinfo->max_v_samp_factor,
243 if (cinfo->is_baseline || (cinfo->progressive_mode &&
244 cinfo->comps_in_scan)) {
251 cinfo->block_size = 1;
253 cinfo->lim_Se = cinfo->Se;
256 cinfo->block_size = 2;
258 cinfo->lim_Se = cinfo->Se;
261 cinfo->block_size = 3;
263 cinfo->lim_Se = cinfo->Se;
266 cinfo->block_size = 4;
268 cinfo->lim_Se = cinfo->Se;
271 cinfo->block_size = 5;
273 cinfo->lim_Se = cinfo->Se;
276 cinfo->block_size = 6;
278 cinfo->lim_Se = cinfo->Se;
281 cinfo->block_size = 7;
283 cinfo->lim_Se = cinfo->Se;
286 cinfo->block_size = 8;
291 cinfo->block_size = 9;
296 cinfo->block_size = 10;
301 cinfo->block_size = 11;
306 cinfo->block_size = 12;
311 cinfo->block_size = 13;
316 cinfo->block_size = 14;
321 cinfo->block_size = 15;
326 cinfo->block_size = 16;
331 ERREXIT4(cinfo, JERR_BAD_PROGRESSION,
332 cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al);
342 cinfo->min_DCT_h_scaled_size = cinfo->block_size;
343 cinfo->min_DCT_v_scaled_size = cinfo->block_size;
346 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
353 (
long) (cinfo->max_h_samp_factor * cinfo->block_size));
356 (
long) (cinfo->max_v_samp_factor * cinfo->block_size));
364 (
long) cinfo->max_h_samp_factor);
367 (
long) cinfo->max_v_samp_factor);
377 (
long) (cinfo->max_v_samp_factor * cinfo->block_size));
380 if (cinfo->comps_in_scan < cinfo->num_components || cinfo->progressive_mode)
381 cinfo->inputctl->has_multiple_scans =
TRUE;
383 cinfo->inputctl->has_multiple_scans =
FALSE;
392 int ci, mcublks, tmp;
395 if (cinfo->comps_in_scan == 1) {
398 compptr = cinfo->cur_comp_info[0];
418 cinfo->blocks_in_MCU = 1;
419 cinfo->MCU_membership[0] = 0;
425 ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,
431 (
long) (cinfo->max_h_samp_factor * cinfo->block_size));
434 (
long) (cinfo->max_v_samp_factor * cinfo->block_size));
436 cinfo->blocks_in_MCU = 0;
438 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
439 compptr = cinfo->cur_comp_info[ci];
455 ERREXIT(cinfo, JERR_BAD_MCU_SIZE);
456 while (mcublks-- > 0) {
457 cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
493 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
494 compptr = cinfo->cur_comp_info[ci];
501 cinfo->quant_tbl_ptrs[qtblno] ==
NULL)
502 ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
525 (*cinfo->entropy->start_pass) (cinfo);
526 (*cinfo->coef->start_input_pass) (cinfo);
527 cinfo->inputctl->consume_input = cinfo->coef->consume_data;
540 (*cinfo->entropy->finish_pass) (cinfo);
565 if (inputctl->
pub.eoi_reached)
569 val = (*cinfo->marker->read_markers) (cinfo);
576 if (cinfo->comps_in_scan == 0) {
586 if (! inputctl->
pub.has_multiple_scans)
587 ERREXIT(cinfo, JERR_EOI_EXPECTED);
588 if (cinfo->comps_in_scan == 0)
594 inputctl->
pub.eoi_reached =
TRUE;
596 if (cinfo->marker->saw_SOF)
597 ERREXIT(cinfo, JERR_SOF_NO_SOS);
602 if (cinfo->output_scan_number > cinfo->input_scan_number)
603 cinfo->output_scan_number = cinfo->input_scan_number;
625 inputctl->
pub.has_multiple_scans =
FALSE;
630 (*cinfo->marker->reset_marker_reader) (cinfo);
632 cinfo->coef_bits =
NULL;
650 cinfo->inputctl = &inputctl->
pub;
659 inputctl->
pub.has_multiple_scans =
FALSE;
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
jpeg_component_info * compptr
#define ERREXIT4(cinfo, code, p1, p2, p3, p4)
#define ERREXIT1(cinfo, code, p1)
#define ERREXIT2(cinfo, code, p1, p2)
#define MEMCOPY(dest, src, size)
#define JPEG_MAX_DIMENSION
struct jpeg_common_struct * j_common_ptr
#define MAX_COMPS_IN_SCAN
#define D_MAX_BLOCKS_IN_MCU
jdiv_round_up(long a, long b)
const int jpeg_natural_order4[4 *4+16]
const int jpeg_natural_order[DCTSIZE2+16]
const int jpeg_natural_order2[2 *2+16]
const int jpeg_natural_order5[5 *5+16]
const int jpeg_natural_order7[7 *7+16]
const int jpeg_natural_order6[6 *6+16]
const int jpeg_natural_order3[3 *3+16]
JDIMENSION downsampled_height
JDIMENSION width_in_blocks
JDIMENSION height_in_blocks
JDIMENSION downsampled_width
int min_DCT_h_scaled_size
int min_DCT_v_scaled_size
jpeg_component_info * comp_info