10 #define JPEG_INTERNALS 51 int numcols = (int)(output_cols - input_cols);
57 ptr = image_data[
row] + input_cols;
80 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
83 in_ptr = input_buf[ci] + in_row_index;
102 int inrow, outrow, h_expand, v_expand, numpix, numpix2, h,
v;
110 numpix = h_expand * v_expand;
111 numpix2 = numpix / 2;
118 input_data, cinfo->max_v_samp_factor, cinfo->image_width,
119 output_cols * h_expand);
124 outptr = output_data[outrow];
125 for (outcol = 0, outcol_h = 0; outcol < output_cols;
126 outcol++, outcol_h += h_expand)
129 for (
v = 0;
v < v_expand;
v++)
131 inptr = input_data[inrow +
v] + outcol_h;
132 for (h = 0; h < h_expand; h++)
156 input_data, 0, output_data, 0, cinfo->max_v_samp_factor,
160 output_data, cinfo->max_v_samp_factor, cinfo->image_width,
192 input_data, cinfo->max_v_samp_factor, cinfo->image_width,
197 outptr = output_data[outrow];
198 inptr = input_data[outrow];
200 for (outcol = 0; outcol < output_cols; outcol++)
232 input_data, cinfo->max_v_samp_factor, cinfo->image_width,
238 outptr = output_data[outrow];
239 inptr0 = input_data[inrow];
240 inptr1 = input_data[inrow + 1];
242 for (outcol = 0; outcol < output_cols; outcol++)
256 #ifdef INPUT_SMOOTHING_SUPPORTED 273 INT32 membersum, neighsum, memberscale, neighscale;
280 input_data - 1, cinfo->max_v_samp_factor + 2, cinfo->image_width,
296 memberscale = 16384 - cinfo->smoothing_factor * 80;
297 neighscale = cinfo->smoothing_factor * 16;
302 outptr = output_data[outrow];
303 inptr0 = input_data[inrow];
304 inptr1 = input_data[inrow + 1];
305 above_ptr = input_data[inrow - 1];
306 below_ptr = input_data[inrow + 2];
316 neighsum += neighsum;
319 membersum = membersum * memberscale + neighsum * neighscale;
326 for (colctr = output_cols - 2; colctr > 0; colctr--)
337 neighsum += neighsum;
342 membersum = membersum * memberscale + neighsum * neighscale;
358 neighsum += neighsum;
361 membersum = membersum * memberscale + neighsum * neighscale;
383 INT32 membersum, neighsum, memberscale, neighscale;
384 int colsum, lastcolsum, nextcolsum;
391 input_data - 1, cinfo->max_v_samp_factor + 2, cinfo->image_width,
400 memberscale = 65536L - cinfo->smoothing_factor * 512L;
401 neighscale = cinfo->smoothing_factor * 64;
405 outptr = output_data[outrow];
406 inptr = input_data[outrow];
407 above_ptr = input_data[outrow - 1];
408 below_ptr = input_data[outrow + 1];
416 neighsum = colsum + (colsum - membersum) + nextcolsum;
417 membersum = membersum * memberscale + neighsum * neighscale;
422 for (colctr = output_cols - 2; colctr > 0; colctr--)
429 neighsum = lastcolsum + (colsum - membersum) + nextcolsum;
430 membersum = membersum * memberscale + neighsum * neighscale;
438 neighsum = lastcolsum + (colsum - membersum) + colsum;
439 membersum = membersum * memberscale + neighsum * neighscale;
457 boolean smoothok =
TRUE;
466 if (cinfo->CCIR601_sampling)
ERREXIT(cinfo, JERR_CCIR601_NOTIMPL);
469 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
475 #ifdef INPUT_SMOOTHING_SUPPORTED 476 if (cinfo->smoothing_factor)
496 #ifdef INPUT_SMOOTHING_SUPPORTED 497 if (cinfo->smoothing_factor)
514 ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
517 #ifdef INPUT_SMOOTHING_SUPPORTED 518 if (cinfo->smoothing_factor && !smoothok)
519 TRACEMS(cinfo, 0, JTRC_SMOOTH_NOTIMPL);
jinit_downsampler(j_compress_ptr cinfo)
start_pass_downsample(j_compress_ptr)
GLuint GLuint GLsizei count
my_downsampler * my_downsample_ptr
h2v2_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data)
struct jpeg_common_struct * j_common_ptr
int_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data)
#define GETJSAMPLE(value)
#define ERREXIT(cinfo, code)
for(ctr=DCTSIZE;ctr > 0;ctr--)
JDIMENSION width_in_blocks
#define TRACEMS(cinfo, lvl, code)
jcopy_sample_rows(JSAMPARRAY input_array, int source_row, JSAMPARRAY output_array, int dest_row, int num_rows, JDIMENSION num_cols)
h2v1_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data)
expand_right_edge(JSAMPARRAY image_data, int num_rows, JDIMENSION input_cols, JDIMENSION output_cols)
jpeg_component_info JCOEFPTR JSAMPARRAY output_buf
sep_downsample(j_compress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION in_row_index, JSAMPIMAGE output_buf, JDIMENSION out_row_group_index)
struct jpeg_downsampler pub
GLenum GLenum GLvoid * row
downsample1_ptr methods[MAX_COMPONENTS]
fullsize_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data)
fullsize_smooth_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data)
boolean need_context_rows
typedef JMETHOD(void, downsample1_ptr,(j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data))
jpeg_component_info * compptr
h2v2_smooth_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data)