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)
JSAMPARRAY color_buf[MAX_COMPONENTS]
struct jpeg_common_struct * j_common_ptr
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)
#define ERREXIT(cinfo, code)
#define MIN(a, b)
Returns the min value between a and b.
jpeg_component_info * compptr
JDIMENSION width_in_blocks
my_prep_controller * my_prep_ptr
start_pass_prep(j_compress_ptr cinfo, J_BUF_MODE pass_mode)
#define MEMCOPY(dest, src, size)
struct jpeg_c_prep_controller pub
int JSAMPARRAY int int JDIMENSION num_cols
expand_bottom_edge(JSAMPARRAY image_data, JDIMENSION num_cols, int input_rows, int output_rows)
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)
jpeg_component_info JCOEFPTR JSAMPARRAY output_buf
jcopy_sample_rows(JSAMPARRAY input_array, int source_row, JSAMPARRAY output_array, int dest_row, int num_rows, JDIMENSION num_cols)
create_context_buffer(j_compress_ptr cinfo)
jinit_c_prep_controller(j_compress_ptr cinfo, boolean need_full_buffer)