14 #define JPEG_INTERNALS 48 ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (
unsigned int) JPEG_MAX_DIMENSION);
52 ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
56 ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
60 cinfo->max_h_samp_factor = 1;
61 cinfo->max_v_samp_factor = 1;
62 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
66 ERREXIT(cinfo, JERR_BAD_SAMPLING);
67 cinfo->max_h_samp_factor =
MAX(cinfo->max_h_samp_factor,
69 cinfo->max_v_samp_factor =
MAX(cinfo->max_v_samp_factor,
77 cinfo->min_DCT_scaled_size =
DCTSIZE;
80 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
86 (
long) (cinfo->max_h_samp_factor *
DCTSIZE));
89 (
long) (cinfo->max_v_samp_factor *
DCTSIZE));
97 (
long) cinfo->max_h_samp_factor);
100 (
long) cinfo->max_v_samp_factor);
110 (long) (cinfo->max_v_samp_factor*
DCTSIZE));
113 if (cinfo->comps_in_scan < cinfo->num_components || cinfo->progressive_mode)
114 cinfo->inputctl->has_multiple_scans =
TRUE;
116 cinfo->inputctl->has_multiple_scans =
FALSE;
125 int ci, mcublks, tmp;
128 if (cinfo->comps_in_scan == 1) {
131 compptr = cinfo->cur_comp_info[0];
151 cinfo->blocks_in_MCU = 1;
152 cinfo->MCU_membership[0] = 0;
158 ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,
164 (long) (cinfo->max_h_samp_factor*
DCTSIZE));
167 (long) (cinfo->max_v_samp_factor*
DCTSIZE));
169 cinfo->blocks_in_MCU = 0;
171 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
172 compptr = cinfo->cur_comp_info[ci];
188 ERREXIT(cinfo, JERR_BAD_MCU_SIZE);
189 while (mcublks-- > 0) {
190 cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
226 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
227 compptr = cinfo->cur_comp_info[ci];
234 cinfo->quant_tbl_ptrs[qtblno] == NULL)
235 ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
258 (*cinfo->entropy->start_pass) (cinfo);
259 (*cinfo->coef->start_input_pass) (cinfo);
260 cinfo->inputctl->consume_input = cinfo->coef->consume_data;
296 val = (*cinfo->marker->read_markers) (cinfo);
309 ERREXIT(cinfo, JERR_EOI_EXPECTED);
316 if (cinfo->marker->saw_SOF)
317 ERREXIT(cinfo, JERR_SOF_NO_SOS);
322 if (cinfo->output_scan_number > cinfo->input_scan_number)
323 cinfo->output_scan_number = cinfo->input_scan_number;
349 (*cinfo->marker->reset_marker_reader) (cinfo);
351 cinfo->coef_bits = NULL;
#define MAX(a, b)
Returns the max value between a and b.
JDIMENSION downsampled_width
struct jpeg_common_struct * j_common_ptr
#define ERREXIT(cinfo, code)
jpeg_component_info * compptr
JDIMENSION width_in_blocks
#define MEMCOPY(dest, src, size)
JDIMENSION height_in_blocks
#define JPEG_MAX_DIMENSION
jdiv_round_up(long a, long b)
initial_setup(j_compress_ptr cinfo)
#define ERREXIT1(cinfo, code, p1)
#define D_MAX_BLOCKS_IN_MCU
#define ERREXIT2(cinfo, code, p1, p2)
#define MAX_COMPS_IN_SCAN
JDIMENSION downsampled_height