10 #define JPEG_INTERNALS 16 typedef JMETHOD(
void, upsample1_ptr,
90 if (upsample->
next_row_out >= cinfo->max_v_samp_factor) {
91 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
117 (*cinfo->cconvert->color_convert) (cinfo, upsample->
color_buf,
128 (*in_row_group_ctr)++;
149 *output_data_ptr = input_data;
162 *output_data_ptr = NULL;
187 int h_expand, v_expand;
194 while (outrow < cinfo->max_v_samp_factor) {
196 inptr = input_data[inrow];
197 outptr = output_data[outrow];
198 outend = outptr + cinfo->output_width;
199 while (outptr < outend) {
201 for (h = h_expand; h > 0; h--) {
208 v_expand-1, cinfo->output_width);
231 for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {
232 inptr = input_data[inrow];
233 outptr = output_data[inrow];
234 outend = outptr + cinfo->output_width;
235 while (outptr < outend) {
260 while (outrow < cinfo->max_v_samp_factor) {
261 inptr = input_data[inrow];
262 outptr = output_data[outrow];
263 outend = outptr + cinfo->output_width;
264 while (outptr < outend) {
270 1, cinfo->output_width);
302 for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {
303 inptr = input_data[inrow];
304 outptr = output_data[inrow];
339 #if BITS_IN_JSAMPLE == 8 340 int thiscolsum, lastcolsum, nextcolsum;
342 INT32 thiscolsum, lastcolsum, nextcolsum;
345 int inrow, outrow,
v;
348 while (outrow < cinfo->max_v_samp_factor) {
349 for (
v = 0;
v < 2;
v++) {
351 inptr0 = input_data[inrow];
353 inptr1 = input_data[inrow-1];
355 inptr1 = input_data[inrow+1];
356 outptr = output_data[outrow++];
361 *outptr++ = (
JSAMPLE) ((thiscolsum * 4 + 8) >> 4);
362 *outptr++ = (
JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4);
363 lastcolsum = thiscolsum; thiscolsum = nextcolsum;
369 *outptr++ = (
JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4);
370 *outptr++ = (
JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4);
371 lastcolsum = thiscolsum; thiscolsum = nextcolsum;
375 *outptr++ = (
JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4);
376 *outptr++ = (
JSAMPLE) ((thiscolsum * 4 + 7) >> 4);
393 boolean need_buffer, do_fancy;
394 int h_in_group, v_in_group, h_out_group, v_out_group;
404 if (cinfo->CCIR601_sampling)
405 ERREXIT(cinfo, JERR_CCIR601_NOTIMPL);
410 do_fancy = cinfo->do_fancy_upsampling && cinfo->min_DCT_scaled_size > 1;
415 for (ci = 0,
compptr = cinfo->comp_info; ci < cinfo->num_components;
421 cinfo->min_DCT_scaled_size;
423 cinfo->min_DCT_scaled_size;
424 h_out_group = cinfo->max_h_samp_factor;
425 v_out_group = cinfo->max_v_samp_factor;
432 }
else if (h_in_group == h_out_group && v_in_group == v_out_group) {
436 }
else if (h_in_group * 2 == h_out_group &&
437 v_in_group == v_out_group) {
443 }
else if (h_in_group * 2 == h_out_group &&
444 v_in_group * 2 == v_out_group) {
451 }
else if ((h_out_group % h_in_group) == 0 &&
452 (v_out_group % v_in_group) == 0) {
458 ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
460 upsample->
color_buf[ci] = (*cinfo->mem->alloc_sarray)
463 (long) cinfo->max_h_samp_factor),
typedef JMETHOD(void, upsample1_ptr,(j_decompress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr))
JDIMENSION downsampled_width
h2v1_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
my_upsampler * my_upsample_ptr
upsample1_ptr methods[MAX_COMPONENTS]
jround_up(long a, long b)
struct jpeg_common_struct * j_common_ptr
#define GETJSAMPLE(value)
JSAMPARRAY JDIMENSION * out_row_ctr
#define ERREXIT(cinfo, code)
h2v1_upsample(j_decompress_ptr cinfo, jpeg_component_info *, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
JSAMPARRAY color_buf[MAX_COMPONENTS]
h2v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
struct jpeg_upsampler pub
h2v2_upsample(j_decompress_ptr cinfo, jpeg_component_info *, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
jpeg_component_info * compptr
sep_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, JDIMENSION, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
jcopy_sample_rows(JSAMPARRAY input_array, int source_row, JSAMPARRAY output_array, int dest_row, int num_rows, JDIMENSION num_cols)
UINT8 v_expand[MAX_COMPONENTS]
int rowgroup_height[MAX_COMPONENTS]
start_pass_upsample(j_decompress_ptr cinfo)
int_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
fullsize_upsample(j_decompress_ptr, jpeg_component_info *, JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
int JSAMPARRAY int int num_rows
noop_upsample(j_decompress_ptr, jpeg_component_info *, JSAMPARRAY, JSAMPARRAY *output_data_ptr)
boolean need_context_rows
UINT8 h_expand[MAX_COMPONENTS]
jinit_upsampler(j_decompress_ptr cinfo)
JSAMPIMAGE JDIMENSION * in_row_group_ctr
JSAMPARRAY JDIMENSION JDIMENSION out_rows_avail