21 #define JPEG_INTERNALS 27 typedef JMETHOD(
void, upsample1_ptr,
101 if (upsample->
next_row_out >= cinfo->max_v_samp_factor) {
102 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
124 out_rows_avail -= *out_row_ctr;
128 (*cinfo->cconvert->color_convert) (cinfo, upsample->
color_buf,
130 output_buf + *out_row_ctr,
139 (*in_row_group_ctr)++;
160 *output_data_ptr = input_data;
173 *output_data_ptr = NULL;
198 int h_expand, v_expand;
205 while (outrow < cinfo->max_v_samp_factor) {
207 inptr = input_data[inrow];
208 outptr = output_data[outrow];
209 outend = outptr + cinfo->output_width;
210 while (outptr < outend) {
212 for (h = h_expand; h > 0; h--) {
219 v_expand-1, cinfo->output_width);
242 for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {
243 inptr = input_data[inrow];
244 outptr = output_data[inrow];
245 outend = outptr + cinfo->output_width;
246 while (outptr < outend) {
271 while (outrow < cinfo->max_v_samp_factor) {
272 inptr = input_data[inrow];
273 outptr = output_data[outrow];
274 outend = outptr + cinfo->output_width;
275 while (outptr < outend) {
281 1, cinfo->output_width);
309 register int invalue;
313 for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {
314 inptr = input_data[inrow];
315 outptr = output_data[inrow];
349 register JSAMPROW inptr0, inptr1, outptr;
350 #if BITS_IN_JSAMPLE == 8 351 register int thiscolsum, lastcolsum, nextcolsum;
353 register INT32 thiscolsum, lastcolsum, nextcolsum;
356 int inrow, outrow, v;
359 while (outrow < cinfo->max_v_samp_factor) {
360 for (v = 0; v < 2; v++) {
362 inptr0 = input_data[inrow];
364 inptr1 = input_data[inrow-1];
366 inptr1 = input_data[inrow+1];
367 outptr = output_data[outrow++];
372 *outptr++ = (
JSAMPLE) ((thiscolsum * 4 + 8) >> 4);
373 *outptr++ = (
JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4);
374 lastcolsum = thiscolsum; thiscolsum = nextcolsum;
380 *outptr++ = (
JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4);
381 *outptr++ = (
JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4);
382 lastcolsum = thiscolsum; thiscolsum = nextcolsum;
386 *outptr++ = (
JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4);
387 *outptr++ = (
JSAMPLE) ((thiscolsum * 4 + 7) >> 4);
404 boolean need_buffer, do_fancy;
405 int h_in_group, v_in_group, h_out_group, v_out_group;
415 if (cinfo->CCIR601_sampling)
416 ERREXIT(cinfo, JERR_CCIR601_NOTIMPL);
421 do_fancy = cinfo->do_fancy_upsampling && cinfo->min_DCT_scaled_size > 1;
426 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
432 cinfo->min_DCT_scaled_size;
434 cinfo->min_DCT_scaled_size;
435 h_out_group = cinfo->max_h_samp_factor;
436 v_out_group = cinfo->max_v_samp_factor;
443 }
else if (h_in_group == h_out_group && v_in_group == v_out_group) {
447 }
else if (h_in_group * 2 == h_out_group &&
448 v_in_group == v_out_group) {
454 }
else if (h_in_group * 2 == h_out_group &&
455 v_in_group * 2 == v_out_group) {
462 }
else if ((h_out_group % h_in_group) == 0 &&
463 (v_out_group % v_in_group) == 0) {
469 ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
471 upsample->
color_buf[ci] = (*cinfo->mem->alloc_sarray)
474 (long) cinfo->max_h_samp_factor),
start_pass_upsample(j_decompress_ptr cinfo)
noop_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
JDIMENSION downsampled_width
upsample1_ptr methods[MAX_COMPONENTS]
struct jpeg_common_struct * j_common_ptr
h2v1_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
#define GETJSAMPLE(value)
#define ERREXIT(cinfo, code)
JSAMPARRAY color_buf[MAX_COMPONENTS]
jinit_upsampler(j_decompress_ptr cinfo)
struct jpeg_upsampler pub
jpeg_component_info * compptr
jround_up(long a, long b)
UINT8 v_expand[MAX_COMPONENTS]
int rowgroup_height[MAX_COMPONENTS]
int_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
int JSAMPARRAY int int num_rows
my_upsampler * my_upsample_ptr
h2v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
boolean need_context_rows
sep_upsample(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)
UINT8 h_expand[MAX_COMPONENTS]
jpeg_component_info JCOEFPTR JSAMPARRAY output_buf
h2v2_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
h2v1_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
fullsize_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
jcopy_sample_rows(JSAMPARRAY input_array, int source_row, JSAMPARRAY output_array, int dest_row, int num_rows, JDIMENSION num_cols)
typedef JMETHOD(void, upsample1_ptr,(j_decompress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr))