10 #define JPEG_INTERNALS 46 ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
51 cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
MAX_COMPONENTS);
54 cinfo->max_h_samp_factor = 1;
55 cinfo->max_v_samp_factor = 1;
56 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
63 ERREXIT(cinfo, JERR_BAD_SAMPLING);
64 cinfo->max_h_samp_factor =
66 cinfo->max_v_samp_factor =
74 cinfo->min_DCT_scaled_size =
DCTSIZE;
77 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
84 (
long)(cinfo->max_h_samp_factor *
DCTSIZE));
87 (
long)(cinfo->max_v_samp_factor *
DCTSIZE));
96 (
long)cinfo->max_h_samp_factor);
99 (
long)cinfo->max_v_samp_factor);
108 (
long)cinfo->image_height, (long)(cinfo->max_v_samp_factor *
DCTSIZE));
111 if (cinfo->comps_in_scan < cinfo->num_components || cinfo->progressive_mode)
112 cinfo->inputctl->has_multiple_scans =
TRUE;
114 cinfo->inputctl->has_multiple_scans =
FALSE;
122 int ci, mcublks, tmp;
125 if (cinfo->comps_in_scan == 1)
128 compptr = cinfo->cur_comp_info[0];
148 cinfo->blocks_in_MCU = 1;
149 cinfo->MCU_membership[0] = 0;
154 if (cinfo->comps_in_scan <= 0 ||
157 cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,
162 (
long)cinfo->image_width,
163 (long)(cinfo->max_h_samp_factor *
DCTSIZE));
165 (
long)cinfo->image_height,
166 (long)(cinfo->max_v_samp_factor *
DCTSIZE));
168 cinfo->blocks_in_MCU = 0;
170 for (ci = 0; ci < cinfo->comps_in_scan; ci++)
172 compptr = cinfo->cur_comp_info[ci];
189 ERREXIT(cinfo, JERR_BAD_MCU_SIZE);
190 while (mcublks-- > 0)
192 cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
226 for (ci = 0; ci < cinfo->comps_in_scan; ci++)
228 compptr = cinfo->cur_comp_info[ci];
234 cinfo->quant_tbl_ptrs[qtblno] ==
nullptr)
235 ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
237 qtbl = (
JQUANT_TBL*)(*cinfo->mem->alloc_small)(
256 (*cinfo->entropy->start_pass)(cinfo);
257 (*cinfo->coef->start_input_pass)(cinfo);
258 cinfo->inputctl->consume_input = cinfo->coef->consume_data;
292 val = (*cinfo->marker->read_markers)(cinfo);
319 if (cinfo->marker->saw_SOF)
ERREXIT(cinfo, JERR_SOF_NO_SOS);
326 if (cinfo->output_scan_number > cinfo->input_scan_number)
327 cinfo->output_scan_number = cinfo->input_scan_number;
352 (*cinfo->marker->reset_marker_reader)(cinfo);
355 cinfo->coef_bits =
nullptr;
jdiv_round_up(long a, long b)
JDIMENSION downsampled_width
#define MAX_COMPS_IN_SCAN
#define D_MAX_BLOCKS_IN_MCU
struct jpeg_common_struct * j_common_ptr
#define ERREXIT(cinfo, code)
JDIMENSION width_in_blocks
#define MEMCOPY(dest, src, size)
JDIMENSION height_in_blocks
#define JPEG_MAX_DIMENSION
#define ERREXIT1(cinfo, code, p1)
#define ERREXIT2(cinfo, code, p1, p2)
jpeg_component_info * compptr
JDIMENSION downsampled_height