10 #define JPEG_INTERNALS 19 #ifdef INPUT_SMOOTHING_SUPPORTED 20 #define CONTEXT_ROWS_SUPPORTED 55 #ifdef CONTEXT_ROWS_SUPPORTED 78 #ifdef CONTEXT_ROWS_SUPPORTED 99 for (
row = input_rows;
row < output_rows;
row++)
102 image_data, input_rows - 1, image_data,
row, 1, num_cols);
126 while (*in_row_ctr < in_rows_avail &&
127 *out_row_group_ctr < out_row_groups_avail)
130 inrows = in_rows_avail - *in_row_ctr;
131 numrows = cinfo->max_v_samp_factor - prep->
next_buf_row;
133 (*cinfo->cconvert->color_convert)(
134 cinfo, input_buf + *in_row_ctr, prep->
color_buf,
136 *in_row_ctr += numrows;
143 for (ci = 0; ci < cinfo->num_components; ci++)
147 cinfo->max_v_samp_factor);
154 (*cinfo->downsample->downsample)(
158 (*out_row_group_ctr)++;
164 if (prep->
rows_to_go == 0 && *out_row_group_ctr < out_row_groups_avail)
166 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
174 *out_row_group_ctr = out_row_groups_avail;
180 #ifdef CONTEXT_ROWS_SUPPORTED 194 int buf_height = cinfo->max_v_samp_factor * 3;
197 while (*out_row_group_ctr < out_row_groups_avail)
199 if (*in_row_ctr < in_rows_avail)
202 inrows = in_rows_avail - *in_row_ctr;
205 (*cinfo->cconvert->color_convert)(
206 cinfo, input_buf + *in_row_ctr, prep->
color_buf,
211 for (ci = 0; ci < cinfo->num_components; ci++)
214 for (
row = 1;
row <= cinfo->max_v_samp_factor;
row++)
218 1, cinfo->image_width);
222 *in_row_ctr += numrows;
234 for (ci = 0; ci < cinfo->num_components; ci++)
246 (*cinfo->downsample->downsample)(
249 (*out_row_group_ctr)++;
267 int rgroup_height = cinfo->max_v_samp_factor;
275 fake_buffer = (
JSAMPARRAY)(*cinfo->mem->alloc_small)(
279 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
287 true_buffer = (*cinfo->mem->alloc_sarray)(
291 cinfo->max_h_samp_factor) /
297 fake_buffer + rgroup_height, true_buffer,
300 for (i = 0; i < rgroup_height; i++)
302 fake_buffer[i] = true_buffer[2 * rgroup_height + i];
303 fake_buffer[4 * rgroup_height + i] = true_buffer[i];
305 prep->
color_buf[ci] = fake_buffer + rgroup_height;
324 if (need_full_buffer)
325 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
336 if (cinfo->downsample->need_context_rows)
339 #ifdef CONTEXT_ROWS_SUPPORTED 343 ERREXIT(cinfo, JERR_NOT_COMPILED);
350 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
353 prep->
color_buf[ci] = (*cinfo->mem->alloc_sarray)(
357 cinfo->max_h_samp_factor) /
JSAMPARRAY color_buf[MAX_COMPONENTS]
struct jpeg_common_struct * j_common_ptr
#define ERREXIT(cinfo, code)
JDIMENSION width_in_blocks
jcopy_sample_rows(JSAMPARRAY input_array, int source_row, JSAMPARRAY output_array, int dest_row, int num_rows, JDIMENSION num_cols)
#define MEMCOPY(dest, src, size)
expand_bottom_edge(JSAMPARRAY image_data, JDIMENSION num_cols, int input_rows, int output_rows)
jpeg_component_info JCOEFPTR JSAMPARRAY output_buf
struct jpeg_c_prep_controller pub
jinit_c_prep_controller(j_compress_ptr cinfo, boolean need_full_buffer)
create_context_buffer(j_compress_ptr cinfo)
pre_process_context(j_compress_ptr cinfo, JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail, JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr, JDIMENSION out_row_groups_avail)
pre_process_data(j_compress_ptr cinfo, JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail, JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr, JDIMENSION out_row_groups_avail)
GLenum GLenum GLvoid * row
my_prep_controller * my_prep_ptr
start_pass_prep(j_compress_ptr cinfo, J_BUF_MODE pass_mode)
jpeg_component_info * compptr