52#ifdef QUANT_2PASS_SUPPORTED
79 if (cinfo->quantize_colors) {
87 post->buffer = (*cinfo->mem->access_virt_sarray)
95 post->pub.post_process_data = cinfo->upsample->upsample;
98#ifdef QUANT_2PASS_SUPPORTED
102 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
108 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
113 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
116 post->starting_row =
post->next_row = 0;
168 if (
post->next_row == 0) {
169 post->buffer = (*cinfo->mem->access_virt_sarray)
170 ((j_common_ptr) cinfo, post->whole_image,
171 post->starting_row, post->strip_height, TRUE);
175 old_next_row =
post->next_row;
176 (*cinfo->upsample->upsample) (cinfo,
177 input_buf, in_row_group_ctr, in_row_groups_avail,
182 if (
post->next_row > old_next_row) {
183 num_rows = post->next_row - old_next_row;
184 (*cinfo->cquantize->color_quantize) (cinfo, post->buffer + old_next_row,
185 (JSAMPARRAY) NULL, (int) num_rows);
186 *out_row_ctr += num_rows;
191 post->starting_row += post->strip_height;
212 if (
post->next_row == 0) {
213 post->buffer = (*cinfo->mem->access_virt_sarray)
214 ((j_common_ptr) cinfo, post->whole_image,
215 post->starting_row, post->strip_height, FALSE);
220 max_rows = out_rows_avail - *out_row_ctr;
224 max_rows = cinfo->output_height -
post->starting_row;
229 (*cinfo->cquantize->color_quantize) (cinfo,
236 if (
post->next_row >=
post->strip_height) {
237 post->starting_row += post->strip_height;
258 post->pub.start_pass = start_pass_dpost;
263 if (cinfo->quantize_colors) {
268 post->strip_height = (JDIMENSION) cinfo->max_v_samp_factor;
269 if (need_full_buffer) {
272#ifdef QUANT_2PASS_SUPPORTED
273 post->whole_image = (*cinfo->mem->request_virt_sarray)
274 ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
275 cinfo->output_width * cinfo->out_color_components,
276 (JDIMENSION) jround_up((long) cinfo->output_height,
277 (long) post->strip_height),
280 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
284 post->buffer = (*cinfo->mem->alloc_sarray)
285 ((j_common_ptr) cinfo, JPOOL_IMAGE,
286 cinfo->output_width * cinfo->out_color_components,
my_post_controller * my_post_ptr
Definition jdpostct.c:42
jinit_d_post_controller(j_decompress_ptr cinfo, boolean need_full_buffer)
Definition jdpostct.c:250
post_process_1pass(j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
Definition jdpostct.c:126
post_process_2pass(j_decompress_ptr cinfo, JSAMPIMAGE, JDIMENSION *, JDIMENSION, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
Definition jdpostct.c:202
post_process_prepass(j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, JDIMENSION in_row_groups_avail, JSAMPARRAY, JDIMENSION *out_row_ctr, JDIMENSION)
Definition jdpostct.c:158
struct jpeg_d_post_controller pub
Definition jdpostct.c:27
jvirt_sarray_ptr whole_image
Definition jdpostct.c:34