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