17 #define JPEG_INTERNALS
27 #ifdef INPUT_SMOOTHING_SUPPORTED
28 #define CONTEXT_ROWS_SUPPORTED
64 #ifdef CONTEXT_ROWS_SUPPORTED
83 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
89 #ifdef CONTEXT_ROWS_SUPPORTED
107 int input_rows,
int output_rows)
111 for (
row = input_rows;
row < output_rows;
row++) {
139 while (*in_row_ctr < in_rows_avail &&
140 *out_row_group_ctr < out_row_groups_avail) {
142 inrows = in_rows_avail - *in_row_ctr;
143 numrows = cinfo->max_v_samp_factor - prep->
next_buf_row;
145 (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,
149 *in_row_ctr += numrows;
155 for (ci = 0; ci < cinfo->num_components; ci++) {
163 (*cinfo->downsample->downsample) (cinfo,
167 (*out_row_group_ctr)++;
173 *out_row_group_ctr < out_row_groups_avail) {
174 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
181 *out_row_group_ctr = out_row_groups_avail;
188 #ifdef CONTEXT_ROWS_SUPPORTED
203 int buf_height = cinfo->max_v_samp_factor * 3;
206 while (*out_row_group_ctr < out_row_groups_avail) {
207 if (*in_row_ctr < in_rows_avail) {
209 inrows = in_rows_avail - *in_row_ctr;
212 (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,
217 if (prep->
rows_to_go == cinfo->image_height) {
218 for (ci = 0; ci < cinfo->num_components; ci++) {
220 for (
row = 1;
row <= cinfo->max_v_samp_factor;
row++) {
223 1, cinfo->image_width);
227 *in_row_ctr += numrows;
236 for (ci = 0; ci < cinfo->num_components; ci++) {
245 (*cinfo->downsample->downsample) (cinfo,
249 (*out_row_group_ctr)++;
270 int rgroup_height = cinfo->max_v_samp_factor;
280 (cinfo->num_components * 5 * rgroup_height) *
283 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
289 true_buffer = (*cinfo->mem->alloc_sarray)
295 MEMCOPY(fake_buffer + rgroup_height, true_buffer,
298 for (
i = 0;
i < rgroup_height;
i++) {
299 fake_buffer[
i] = true_buffer[2 * rgroup_height +
i];
300 fake_buffer[4 * rgroup_height +
i] = true_buffer[
i];
302 prep->
color_buf[ci] = fake_buffer + rgroup_height;
303 fake_buffer += 5 * rgroup_height;
322 ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
334 if (cinfo->downsample->need_context_rows) {
336 #ifdef CONTEXT_ROWS_SUPPORTED
340 ERREXIT(cinfo, JERR_NOT_COMPILED);
345 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
347 prep->
color_buf[ci] = (*cinfo->mem->alloc_sarray)