Home | History | Annotate | Download | only in jpeg

Lines Matching refs:cinfo

23 LOCAL(boolean) output_pass_setup JPP((j_decompress_ptr cinfo));
38 jpeg_start_decompress (j_decompress_ptr cinfo)
40 if (cinfo->global_state == DSTATE_READY) {
42 jinit_master_decompress(cinfo);
43 if (cinfo->buffered_image) {
45 cinfo->global_state = DSTATE_BUFIMAGE;
48 cinfo->global_state = DSTATE_PRELOAD;
50 if (cinfo->global_state == DSTATE_PRELOAD) {
52 if (cinfo->inputctl->has_multiple_scans) {
57 if (cinfo->progress != NULL)
58 (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
60 retcode = (*cinfo->inputctl->consume_input) (cinfo);
66 if (cinfo->progress != NULL &&
68 if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {
70 cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows;
75 ERREXIT(cinfo, JERR_NOT_COMPILED);
78 cinfo->output_scan_number = cinfo->input_scan_number;
79 } else if (cinfo->global_state != DSTATE_PRESCAN)
80 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
82 return output_pass_setup(cinfo);
91 jpeg_start_tile_decompress (j_decompress_ptr cinfo)
93 if (cinfo->global_state == DSTATE_READY) {
95 cinfo->tile_decode = TRUE;
96 jinit_master_decompress(cinfo);
97 if (cinfo->buffered_image) {
98 cinfo->global_state = DSTATE_BUFIMAGE;
101 cinfo->global_state = DSTATE_PRELOAD;
103 if (cinfo->global_state == DSTATE_PRELOAD) {
104 cinfo->output_scan_number = cinfo->input_scan_number;
105 } else if (cinfo->global_state != DSTATE_PRESCAN)
106 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
108 return output_pass_setup(cinfo);
121 output_pass_setup (j_decompress_ptr cinfo)
123 if (cinfo->global_state != DSTATE_PRESCAN) {
125 (*cinfo->master->prepare_for_output_pass) (cinfo);
126 cinfo->output_scanline = 0;
127 cinfo->global_state = DSTATE_PRESCAN;
130 while (cinfo->master->is_dummy_pass) {
133 while (cinfo->output_scanline < cinfo->output_height) {
136 if (cinfo->progress != NULL) {
137 cinfo->progress->pass_counter = (long) cinfo->output_scanline;
138 cinfo->progress->pass_limit = (long) cinfo->output_height;
139 (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
142 last_scanline = cinfo->output_scanline;
143 (*cinfo->main->process_data) (cinfo, (JSAMPARRAY) NULL,
144 &cinfo->output_scanline, (JDIMENSION) 0);
145 if (cinfo->output_scanline == last_scanline)
149 (*cinfo->master->finish_output_pass) (cinfo);
150 (*cinfo->master->prepare_for_output_pass) (cinfo);
151 cinfo->output_scanline = 0;
153 ERREXIT(cinfo, JERR_NOT_COMPILED);
159 cinfo->global_state = cinfo->raw_data_out ? DSTATE_RAW_OK : DSTATE_SCANNING;
178 jpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines,
183 if (cinfo->global_state != DSTATE_SCANNING)
184 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
185 if (cinfo->output_scanline >= cinfo->output_height) {
186 WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
191 if (cinfo->progress != NULL) {
192 cinfo->progress->pass_counter = (long) cinfo->output_scanline;
193 cinfo->progress->pass_limit = (long) cinfo->output_height;
194 (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
199 (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, max_lines);
200 cinfo->output_scanline += row_ctr;
212 jpeg_init_read_tile_scanline(j_decompress_ptr cinfo, huffman_index *index,
216 int lines_per_iMCU_row = cinfo->max_v_samp_factor * DCTSIZE;
217 int lines_per_iMCU_col = cinfo->max_h_samp_factor * DCTSIZE;
224 cinfo->coef->MCU_columns_to_skip =
230 cinfo->image_width = jmin(cinfo->original_image_width,
233 cinfo->input_iMCU_row = row_offset;
234 cinfo->output_iMCU_row = row_offset;
237 jinit_color_deconverter(cinfo);
238 jpeg_calc_output_dimensions(cinfo);
239 jinit_upsampler(cinfo);
240 (*cinfo->master->prepare_for_output_pass) (cinfo);
241 if (cinfo->progressive_mode)
242 (*cinfo->entropy->start_pass) (cinfo);
244 jpeg_decompress_per_scan_setup(cinfo);
246 int sample_size = DCTSIZE / cinfo->min_DCT_scaled_size;
249 *width = cinfo->output_width;
250 cinfo->output_scanline = lines_per_iMCU_row * row_offset / sample_size;
251 cinfo->inputctl->consume_input = cinfo->coef->consume_data;
252 cinfo->inputctl->consume_input_build_huffman_index =
253 cinfo->coef->consume_data_build_huffman_index;
254 cinfo->entropy->index = index;
255 cinfo->input_iMCU_row = row_offset;
256 cinfo->output_iMCU_row = row_offset;
257 cinfo->coef->MCU_column_left_boundary = col_left_boundary;
258 cinfo->coef->MCU_column_right_boundary = col_right_boundary;
259 cinfo->coef->column_left_boundary =
261 cinfo->coef->column_right_boundary =
272 jpeg_read_tile_scanline (j_decompress_ptr cinfo, huffman_index *index,
276 int lines_per_iMCU_row = cinfo->max_v_samp_factor * DCTSIZE;
277 int lines_per_iMCU_col = cinfo->max_h_samp_factor * DCTSIZE;
278 int sample_size = DCTSIZE / cinfo->min_DCT_scaled_size;
281 if (cinfo->progressive_mode) {
282 (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, 1);
284 if (cinfo->output_scanline % (lines_per_iMCU_row / sample_size) == 0) {
286 int iMCU_row_offset = cinfo->output_scanline /
288 int offset_data_col_position = cinfo->coef->MCU_column_left_boundary /
292 (*cinfo->entropy->configure_huffman_decoder) (cinfo, offset_data);
294 (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, 1);
297 cinfo->output_scanline += row_ctr;
307 jpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data,
312 if (cinfo->global_state != DSTATE_RAW_OK)
313 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
314 if (cinfo->output_scanline >= cinfo->output_height) {
315 WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
320 if (cinfo->progress != NULL) {
321 cinfo->progress->pass_counter = (long) cinfo->output_scanline;
322 cinfo->progress->pass_limit = (long) cinfo->output_height;
323 (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
327 lines_per_iMCU_row = cinfo->max_v_samp_factor * cinfo->min_DCT_scaled_size;
329 ERREXIT(cinfo, JERR_BUFFER_SIZE);
332 if (! (*cinfo->coef->decompress_data) (cinfo, data))
336 cinfo->output_scanline += lines_per_iMCU_row;
350 jpeg_start_output (j_decompress_ptr cinfo, int scan_number)
352 if (cinfo->global_state != DSTATE_BUFIMAGE &&
353 cinfo->global_state != DSTATE_PRESCAN)
354 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
358 if (cinfo->inputctl->eoi_reached &&
359 scan_number > cinfo->input_scan_number)
360 scan_number = cinfo->input_scan_number;
361 cinfo->output_scan_number = scan_number;
363 return output_pass_setup(cinfo);
375 jpeg_finish_output (j_decompress_ptr cinfo)
377 if ((cinfo->global_state == DSTATE_SCANNING ||
378 cinfo->global_state == DSTATE_RAW_OK) && cinfo->buffered_image) {
381 (*cinfo->master->finish_output_pass) (cinfo);
382 cinfo->global_state = DSTATE_BUFPOST;
383 } else if (cinfo->global_state != DSTATE_BUFPOST) {
385 ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
388 while (cinfo->input_scan_number <= cinfo->output_scan_number &&
389 ! cinfo->inputctl->eoi_reached) {
390 if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
393 cinfo->global_state = DSTATE_BUFIMAGE;