Home | History | Annotate | Download | only in jpeg

Lines Matching refs:cinfo

31 METHODDEF(int) consume_markers JPP((j_decompress_ptr cinfo));
32 METHODDEF(int) consume_markers_with_huffman_index JPP((j_decompress_ptr cinfo,
41 initial_setup (j_decompress_ptr cinfo)
48 if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION ||
49 (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION)
50 ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
53 if (cinfo->data_precision != BITS_IN_JSAMPLE)
54 ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
57 if (cinfo->num_components > MAX_COMPONENTS)
58 ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
62 cinfo->max_h_samp_factor = 1;
63 cinfo->max_v_samp_factor = 1;
64 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
68 ERREXIT(cinfo, JERR_BAD_SAMPLING);
69 cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,
71 cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,
79 cinfo->min_DCT_scaled_size = DCTSIZE;
82 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
87 jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
88 (long) (cinfo->max_h_samp_factor * DCTSIZE));
90 jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
91 (long) (cinfo->max_v_samp_factor * DCTSIZE));
98 jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
99 (long) cinfo->max_h_samp_factor);
101 jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
102 (long) cinfo->max_v_samp_factor);
110 cinfo->total_iMCU_rows = (JDIMENSION)
111 jdiv_round_up((long) cinfo->image_height,
112 (long) (cinfo->max_v_samp_factor*DCTSIZE));
115 if (cinfo->comps_in_scan < cinfo->num_components || cinfo->progressive_mode)
116 cinfo->inputctl->has_multiple_scans = TRUE;
118 cinfo->inputctl->has_multiple_scans = FALSE;
119 cinfo->original_image_width = cinfo->image_width;
123 per_scan_setup (j_decompress_ptr cinfo)
125 /* cinfo->comps_in_scan and cinfo->cur_comp_info[] were set from SOS marker */
130 if (cinfo->comps_in_scan == 1) {
133 compptr = cinfo->cur_comp_info[0];
136 cinfo->MCUs_per_row = compptr->width_in_blocks;
137 cinfo->MCU_rows_in_scan = compptr->height_in_blocks;
153 cinfo->blocks_in_MCU = 1;
154 cinfo->MCU_membership[0] = 0;
159 if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)
160 ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,
164 cinfo->MCUs_per_row = (JDIMENSION)
165 jdiv_round_up((long) cinfo->image_width,
166 (long) (cinfo->max_h_samp_factor*DCTSIZE));
167 cinfo->MCU_rows_in_scan = (JDIMENSION)
168 jdiv_round_up((long) cinfo->image_height,
169 (long) (cinfo->max_v_samp_factor*DCTSIZE));
171 cinfo->blocks_in_MCU = 0;
173 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
174 compptr = cinfo->cur_comp_info[ci];
185 if (cinfo->tile_decode) {
186 tmp = (int) (jdiv_round_up(cinfo->image_width, 8)
198 if (cinfo->blocks_in_MCU + mcublks > D_MAX_BLOCKS_IN_MCU)
199 ERREXIT(cinfo, JERR_BAD_MCU_SIZE);
201 cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
209 jpeg_decompress_per_scan_setup(j_decompress_ptr cinfo)
211 per_scan_setup(cinfo);
238 latch_quant_tables (j_decompress_ptr cinfo)
244 for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
245 compptr = cinfo->cur_comp_info[ci];
252 cinfo->quant_tbl_ptrs[qtblno] == NULL)
253 ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
256 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
258 MEMCOPY(qtbl, cinfo->quant_tbl_ptrs[qtblno], SIZEOF(JQUANT_TBL));
272 start_input_pass (j_decompress_ptr cinfo)
274 per_scan_setup(cinfo);
275 latch_quant_tables(cinfo);
276 (*cinfo->entropy->start_pass) (cinfo);
277 (*cinfo->coef->start_input_pass) (cinfo);
278 cinfo->inputctl->consume_input = cinfo->coef->consume_data;
279 cinfo->inputctl->consume_input_build_huffman_index =
280 cinfo->coef->consume_data_build_huffman_index;
291 finish_input_pass (j_decompress_ptr cinfo)
293 cinfo->inputctl->consume_input = consume_markers;
294 cinfo->inputctl->consume_input_build_huffman_index =
300 consume_markers_with_huffman_index (j_decompress_ptr cinfo,
303 return consume_markers(cinfo);
316 consume_markers (j_decompress_ptr cinfo)
318 my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl;
324 val = (*cinfo->marker->read_markers) (cinfo);
329 initial_setup(cinfo);
337 ERREXIT(cinfo, JERR_EOI_EXPECTED); /* Oops, I wasn't expecting this! */
338 start_input_pass(cinfo);
344 if (cinfo->marker->saw_SOF)
345 ERREXIT(cinfo, JERR_SOF_NO_SOS);
350 if (cinfo->output_scan_number > cinfo->input_scan_number)
351 cinfo->output_scan_number = cinfo->input_scan_number;
367 reset_input_controller (j_decompress_ptr cinfo)
369 my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl;
378 (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
379 (*cinfo->marker->reset_marker_reader) (cinfo);
381 cinfo->coef_bits = NULL;
391 jinit_input_controller (j_decompress_ptr cinfo)
397 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
399 cinfo->inputctl = (struct jpeg_input_controller *) inputctl;