nuclear@1: /* nuclear@1: * jdsample.c nuclear@1: * nuclear@1: * Copyright (C) 1991-1996, Thomas G. Lane. nuclear@1: * This file is part of the Independent JPEG Group's software. nuclear@1: * For conditions of distribution and use, see the accompanying README file. nuclear@1: * nuclear@1: * This file contains upsampling routines. nuclear@1: * nuclear@1: * Upsampling input data is counted in "row groups". A row group nuclear@1: * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size) nuclear@1: * sample rows of each component. Upsampling will normally produce nuclear@1: * max_v_samp_factor pixel rows from each row group (but this could vary nuclear@1: * if the upsampler is applying a scale factor of its own). nuclear@1: * nuclear@1: * An excellent reference for image resampling is nuclear@1: * Digital Image Warping, George Wolberg, 1990. nuclear@1: * Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7. nuclear@1: */ nuclear@1: nuclear@1: #define JPEG_INTERNALS nuclear@1: #include "jinclude.h" nuclear@1: #include "jpeglib.h" nuclear@1: nuclear@1: nuclear@1: /* Pointer to routine to upsample a single component */ nuclear@1: typedef JMETHOD(void, upsample1_ptr, nuclear@1: (j_decompress_ptr cinfo, jpeg_component_info * compptr, nuclear@1: JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)); nuclear@1: nuclear@1: /* Private subobject */ nuclear@1: nuclear@1: typedef struct { nuclear@1: struct jpeg_upsampler pub; /* public fields */ nuclear@1: nuclear@1: /* Color conversion buffer. When using separate upsampling and color nuclear@1: * conversion steps, this buffer holds one upsampled row group until it nuclear@1: * has been color converted and output. nuclear@1: * Note: we do not allocate any storage for component(s) which are full-size, nuclear@1: * ie do not need rescaling. The corresponding entry of color_buf[] is nuclear@1: * simply set to point to the input data array, thereby avoiding copying. nuclear@1: */ nuclear@1: JSAMPARRAY color_buf[MAX_COMPONENTS]; nuclear@1: nuclear@1: /* Per-component upsampling method pointers */ nuclear@1: upsample1_ptr methods[MAX_COMPONENTS]; nuclear@1: nuclear@1: int next_row_out; /* counts rows emitted from color_buf */ nuclear@1: JDIMENSION rows_to_go; /* counts rows remaining in image */ nuclear@1: nuclear@1: /* Height of an input row group for each component. */ nuclear@1: int rowgroup_height[MAX_COMPONENTS]; nuclear@1: nuclear@1: /* These arrays save pixel expansion factors so that int_expand need not nuclear@1: * recompute them each time. They are unused for other upsampling methods. nuclear@1: */ nuclear@1: UINT8 h_expand[MAX_COMPONENTS]; nuclear@1: UINT8 v_expand[MAX_COMPONENTS]; nuclear@1: } my_upsampler; nuclear@1: nuclear@1: typedef my_upsampler * my_upsample_ptr; nuclear@1: nuclear@1: nuclear@1: /* nuclear@1: * Initialize for an upsampling pass. nuclear@1: */ nuclear@1: nuclear@1: METHODDEF(void) nuclear@1: start_pass_upsample (j_decompress_ptr cinfo) nuclear@1: { nuclear@1: my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; nuclear@1: nuclear@1: /* Mark the conversion buffer empty */ nuclear@1: upsample->next_row_out = cinfo->max_v_samp_factor; nuclear@1: /* Initialize total-height counter for detecting bottom of image */ nuclear@1: upsample->rows_to_go = cinfo->output_height; nuclear@1: } nuclear@1: nuclear@1: nuclear@1: /* nuclear@1: * Control routine to do upsampling (and color conversion). nuclear@1: * nuclear@1: * In this version we upsample each component independently. nuclear@1: * We upsample one row group into the conversion buffer, then apply nuclear@1: * color conversion a row at a time. nuclear@1: */ nuclear@1: nuclear@1: METHODDEF(void) nuclear@1: sep_upsample (j_decompress_ptr cinfo, nuclear@1: JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, nuclear@1: JDIMENSION in_row_groups_avail, nuclear@1: JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, nuclear@1: JDIMENSION out_rows_avail) nuclear@1: { nuclear@1: my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; nuclear@1: int ci; nuclear@1: jpeg_component_info * compptr; nuclear@1: JDIMENSION num_rows; nuclear@1: nuclear@1: /* Fill the conversion buffer, if it's empty */ nuclear@1: if (upsample->next_row_out >= cinfo->max_v_samp_factor) { nuclear@1: for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; nuclear@1: ci++, compptr++) { nuclear@1: /* Invoke per-component upsample method. Notice we pass a POINTER nuclear@1: * to color_buf[ci], so that fullsize_upsample can change it. nuclear@1: */ nuclear@1: (*upsample->methods[ci]) (cinfo, compptr, nuclear@1: input_buf[ci] + (*in_row_group_ctr * upsample->rowgroup_height[ci]), nuclear@1: upsample->color_buf + ci); nuclear@1: } nuclear@1: upsample->next_row_out = 0; nuclear@1: } nuclear@1: nuclear@1: /* Color-convert and emit rows */ nuclear@1: nuclear@1: /* How many we have in the buffer: */ nuclear@1: num_rows = (JDIMENSION) (cinfo->max_v_samp_factor - upsample->next_row_out); nuclear@1: /* Not more than the distance to the end of the image. Need this test nuclear@1: * in case the image height is not a multiple of max_v_samp_factor: nuclear@1: */ nuclear@1: if (num_rows > upsample->rows_to_go) nuclear@1: num_rows = upsample->rows_to_go; nuclear@1: /* And not more than what the client can accept: */ nuclear@1: out_rows_avail -= *out_row_ctr; nuclear@1: if (num_rows > out_rows_avail) nuclear@1: num_rows = out_rows_avail; nuclear@1: nuclear@1: (*cinfo->cconvert->color_convert) (cinfo, upsample->color_buf, nuclear@1: (JDIMENSION) upsample->next_row_out, nuclear@1: output_buf + *out_row_ctr, nuclear@1: (int) num_rows); nuclear@1: nuclear@1: /* Adjust counts */ nuclear@1: *out_row_ctr += num_rows; nuclear@1: upsample->rows_to_go -= num_rows; nuclear@1: upsample->next_row_out += num_rows; nuclear@1: /* When the buffer is emptied, declare this input row group consumed */ nuclear@1: if (upsample->next_row_out >= cinfo->max_v_samp_factor) nuclear@1: (*in_row_group_ctr)++; nuclear@1: } nuclear@1: nuclear@1: nuclear@1: /* nuclear@1: * These are the routines invoked by sep_upsample to upsample pixel values nuclear@1: * of a single component. One row group is processed per call. nuclear@1: */ nuclear@1: nuclear@1: nuclear@1: /* nuclear@1: * For full-size components, we just make color_buf[ci] point at the nuclear@1: * input buffer, and thus avoid copying any data. Note that this is nuclear@1: * safe only because sep_upsample doesn't declare the input row group nuclear@1: * "consumed" until we are done color converting and emitting it. nuclear@1: */ nuclear@1: nuclear@1: METHODDEF(void) nuclear@1: fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, nuclear@1: JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) nuclear@1: { nuclear@1: *output_data_ptr = input_data; nuclear@1: } nuclear@1: nuclear@1: nuclear@1: /* nuclear@1: * This is a no-op version used for "uninteresting" components. nuclear@1: * These components will not be referenced by color conversion. nuclear@1: */ nuclear@1: nuclear@1: METHODDEF(void) nuclear@1: noop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, nuclear@1: JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) nuclear@1: { nuclear@1: *output_data_ptr = NULL; /* safety check */ nuclear@1: } nuclear@1: nuclear@1: nuclear@1: /* nuclear@1: * This version handles any integral sampling ratios. nuclear@1: * This is not used for typical JPEG files, so it need not be fast. nuclear@1: * Nor, for that matter, is it particularly accurate: the algorithm is nuclear@1: * simple replication of the input pixel onto the corresponding output nuclear@1: * pixels. The hi-falutin sampling literature refers to this as a nuclear@1: * "box filter". A box filter tends to introduce visible artifacts, nuclear@1: * so if you are actually going to use 3:1 or 4:1 sampling ratios nuclear@1: * you would be well advised to improve this code. nuclear@1: */ nuclear@1: nuclear@1: METHODDEF(void) nuclear@1: int_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, nuclear@1: JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) nuclear@1: { nuclear@1: my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; nuclear@1: JSAMPARRAY output_data = *output_data_ptr; nuclear@1: register JSAMPROW inptr, outptr; nuclear@1: register JSAMPLE invalue; nuclear@1: register int h; nuclear@1: JSAMPROW outend; nuclear@1: int h_expand, v_expand; nuclear@1: int inrow, outrow; nuclear@1: nuclear@1: h_expand = upsample->h_expand[compptr->component_index]; nuclear@1: v_expand = upsample->v_expand[compptr->component_index]; nuclear@1: nuclear@1: inrow = outrow = 0; nuclear@1: while (outrow < cinfo->max_v_samp_factor) { nuclear@1: /* Generate one output row with proper horizontal expansion */ nuclear@1: inptr = input_data[inrow]; nuclear@1: outptr = output_data[outrow]; nuclear@1: outend = outptr + cinfo->output_width; nuclear@1: while (outptr < outend) { nuclear@1: invalue = *inptr++; /* don't need GETJSAMPLE() here */ nuclear@1: for (h = h_expand; h > 0; h--) { nuclear@1: *outptr++ = invalue; nuclear@1: } nuclear@1: } nuclear@1: /* Generate any additional output rows by duplicating the first one */ nuclear@1: if (v_expand > 1) { nuclear@1: jcopy_sample_rows(output_data, outrow, output_data, outrow+1, nuclear@1: v_expand-1, cinfo->output_width); nuclear@1: } nuclear@1: inrow++; nuclear@1: outrow += v_expand; nuclear@1: } nuclear@1: } nuclear@1: nuclear@1: nuclear@1: /* nuclear@1: * Fast processing for the common case of 2:1 horizontal and 1:1 vertical. nuclear@1: * It's still a box filter. nuclear@1: */ nuclear@1: nuclear@1: METHODDEF(void) nuclear@1: h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, nuclear@1: JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) nuclear@1: { nuclear@1: JSAMPARRAY output_data = *output_data_ptr; nuclear@1: register JSAMPROW inptr, outptr; nuclear@1: register JSAMPLE invalue; nuclear@1: JSAMPROW outend; nuclear@1: int inrow; nuclear@1: nuclear@1: for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) { nuclear@1: inptr = input_data[inrow]; nuclear@1: outptr = output_data[inrow]; nuclear@1: outend = outptr + cinfo->output_width; nuclear@1: while (outptr < outend) { nuclear@1: invalue = *inptr++; /* don't need GETJSAMPLE() here */ nuclear@1: *outptr++ = invalue; nuclear@1: *outptr++ = invalue; nuclear@1: } nuclear@1: } nuclear@1: } nuclear@1: nuclear@1: nuclear@1: /* nuclear@1: * Fast processing for the common case of 2:1 horizontal and 2:1 vertical. nuclear@1: * It's still a box filter. nuclear@1: */ nuclear@1: nuclear@1: METHODDEF(void) nuclear@1: h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, nuclear@1: JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) nuclear@1: { nuclear@1: JSAMPARRAY output_data = *output_data_ptr; nuclear@1: register JSAMPROW inptr, outptr; nuclear@1: register JSAMPLE invalue; nuclear@1: JSAMPROW outend; nuclear@1: int inrow, outrow; nuclear@1: nuclear@1: inrow = outrow = 0; nuclear@1: while (outrow < cinfo->max_v_samp_factor) { nuclear@1: inptr = input_data[inrow]; nuclear@1: outptr = output_data[outrow]; nuclear@1: outend = outptr + cinfo->output_width; nuclear@1: while (outptr < outend) { nuclear@1: invalue = *inptr++; /* don't need GETJSAMPLE() here */ nuclear@1: *outptr++ = invalue; nuclear@1: *outptr++ = invalue; nuclear@1: } nuclear@1: jcopy_sample_rows(output_data, outrow, output_data, outrow+1, nuclear@1: 1, cinfo->output_width); nuclear@1: inrow++; nuclear@1: outrow += 2; nuclear@1: } nuclear@1: } nuclear@1: nuclear@1: nuclear@1: /* nuclear@1: * Fancy processing for the common case of 2:1 horizontal and 1:1 vertical. nuclear@1: * nuclear@1: * The upsampling algorithm is linear interpolation between pixel centers, nuclear@1: * also known as a "triangle filter". This is a good compromise between nuclear@1: * speed and visual quality. The centers of the output pixels are 1/4 and 3/4 nuclear@1: * of the way between input pixel centers. nuclear@1: * nuclear@1: * A note about the "bias" calculations: when rounding fractional values to nuclear@1: * integer, we do not want to always round 0.5 up to the next integer. nuclear@1: * If we did that, we'd introduce a noticeable bias towards larger values. nuclear@1: * Instead, this code is arranged so that 0.5 will be rounded up or down at nuclear@1: * alternate pixel locations (a simple ordered dither pattern). nuclear@1: */ nuclear@1: nuclear@1: METHODDEF(void) nuclear@1: h2v1_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, nuclear@1: JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) nuclear@1: { nuclear@1: JSAMPARRAY output_data = *output_data_ptr; nuclear@1: register JSAMPROW inptr, outptr; nuclear@1: register int invalue; nuclear@1: register JDIMENSION colctr; nuclear@1: int inrow; nuclear@1: nuclear@1: for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) { nuclear@1: inptr = input_data[inrow]; nuclear@1: outptr = output_data[inrow]; nuclear@1: /* Special case for first column */ nuclear@1: invalue = GETJSAMPLE(*inptr++); nuclear@1: *outptr++ = (JSAMPLE) invalue; nuclear@1: *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(*inptr) + 2) >> 2); nuclear@1: nuclear@1: for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) { nuclear@1: /* General case: 3/4 * nearer pixel + 1/4 * further pixel */ nuclear@1: invalue = GETJSAMPLE(*inptr++) * 3; nuclear@1: *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(inptr[-2]) + 1) >> 2); nuclear@1: *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(*inptr) + 2) >> 2); nuclear@1: } nuclear@1: nuclear@1: /* Special case for last column */ nuclear@1: invalue = GETJSAMPLE(*inptr); nuclear@1: *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(inptr[-1]) + 1) >> 2); nuclear@1: *outptr++ = (JSAMPLE) invalue; nuclear@1: } nuclear@1: } nuclear@1: nuclear@1: nuclear@1: /* nuclear@1: * Fancy processing for the common case of 2:1 horizontal and 2:1 vertical. nuclear@1: * Again a triangle filter; see comments for h2v1 case, above. nuclear@1: * nuclear@1: * It is OK for us to reference the adjacent input rows because we demanded nuclear@1: * context from the main buffer controller (see initialization code). nuclear@1: */ nuclear@1: nuclear@1: METHODDEF(void) nuclear@1: h2v2_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, nuclear@1: JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) nuclear@1: { nuclear@1: JSAMPARRAY output_data = *output_data_ptr; nuclear@1: register JSAMPROW inptr0, inptr1, outptr; nuclear@1: #if BITS_IN_JSAMPLE == 8 nuclear@1: register int thiscolsum, lastcolsum, nextcolsum; nuclear@1: #else nuclear@1: register INT32 thiscolsum, lastcolsum, nextcolsum; nuclear@1: #endif nuclear@1: register JDIMENSION colctr; nuclear@1: int inrow, outrow, v; nuclear@1: nuclear@1: inrow = outrow = 0; nuclear@1: while (outrow < cinfo->max_v_samp_factor) { nuclear@1: for (v = 0; v < 2; v++) { nuclear@1: /* inptr0 points to nearest input row, inptr1 points to next nearest */ nuclear@1: inptr0 = input_data[inrow]; nuclear@1: if (v == 0) /* next nearest is row above */ nuclear@1: inptr1 = input_data[inrow-1]; nuclear@1: else /* next nearest is row below */ nuclear@1: inptr1 = input_data[inrow+1]; nuclear@1: outptr = output_data[outrow++]; nuclear@1: nuclear@1: /* Special case for first column */ nuclear@1: thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++); nuclear@1: nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++); nuclear@1: *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 8) >> 4); nuclear@1: *outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4); nuclear@1: lastcolsum = thiscolsum; thiscolsum = nextcolsum; nuclear@1: nuclear@1: for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) { nuclear@1: /* General case: 3/4 * nearer pixel + 1/4 * further pixel in each */ nuclear@1: /* dimension, thus 9/16, 3/16, 3/16, 1/16 overall */ nuclear@1: nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++); nuclear@1: *outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4); nuclear@1: *outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4); nuclear@1: lastcolsum = thiscolsum; thiscolsum = nextcolsum; nuclear@1: } nuclear@1: nuclear@1: /* Special case for last column */ nuclear@1: *outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4); nuclear@1: *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 7) >> 4); nuclear@1: } nuclear@1: inrow++; nuclear@1: } nuclear@1: } nuclear@1: nuclear@1: nuclear@1: /* nuclear@1: * Module initialization routine for upsampling. nuclear@1: */ nuclear@1: nuclear@1: GLOBAL(void) nuclear@1: jinit_upsampler (j_decompress_ptr cinfo) nuclear@1: { nuclear@1: my_upsample_ptr upsample; nuclear@1: int ci; nuclear@1: jpeg_component_info * compptr; nuclear@1: boolean need_buffer, do_fancy; nuclear@1: int h_in_group, v_in_group, h_out_group, v_out_group; nuclear@1: nuclear@1: upsample = (my_upsample_ptr) nuclear@1: (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, nuclear@1: SIZEOF(my_upsampler)); nuclear@1: cinfo->upsample = (struct jpeg_upsampler *) upsample; nuclear@1: upsample->pub.start_pass = start_pass_upsample; nuclear@1: upsample->pub.upsample = sep_upsample; nuclear@1: upsample->pub.need_context_rows = FALSE; /* until we find out differently */ nuclear@1: nuclear@1: if (cinfo->CCIR601_sampling) /* this isn't supported */ nuclear@1: ERREXIT(cinfo, JERR_CCIR601_NOTIMPL); nuclear@1: nuclear@1: /* jdmainct.c doesn't support context rows when min_DCT_scaled_size = 1, nuclear@1: * so don't ask for it. nuclear@1: */ nuclear@1: do_fancy = cinfo->do_fancy_upsampling && cinfo->min_DCT_scaled_size > 1; nuclear@1: nuclear@1: /* Verify we can handle the sampling factors, select per-component methods, nuclear@1: * and create storage as needed. nuclear@1: */ nuclear@1: for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; nuclear@1: ci++, compptr++) { nuclear@1: /* Compute size of an "input group" after IDCT scaling. This many samples nuclear@1: * are to be converted to max_h_samp_factor * max_v_samp_factor pixels. nuclear@1: */ nuclear@1: h_in_group = (compptr->h_samp_factor * compptr->DCT_scaled_size) / nuclear@1: cinfo->min_DCT_scaled_size; nuclear@1: v_in_group = (compptr->v_samp_factor * compptr->DCT_scaled_size) / nuclear@1: cinfo->min_DCT_scaled_size; nuclear@1: h_out_group = cinfo->max_h_samp_factor; nuclear@1: v_out_group = cinfo->max_v_samp_factor; nuclear@1: upsample->rowgroup_height[ci] = v_in_group; /* save for use later */ nuclear@1: need_buffer = TRUE; nuclear@1: if (! compptr->component_needed) { nuclear@1: /* Don't bother to upsample an uninteresting component. */ nuclear@1: upsample->methods[ci] = noop_upsample; nuclear@1: need_buffer = FALSE; nuclear@1: } else if (h_in_group == h_out_group && v_in_group == v_out_group) { nuclear@1: /* Fullsize components can be processed without any work. */ nuclear@1: upsample->methods[ci] = fullsize_upsample; nuclear@1: need_buffer = FALSE; nuclear@1: } else if (h_in_group * 2 == h_out_group && nuclear@1: v_in_group == v_out_group) { nuclear@1: /* Special cases for 2h1v upsampling */ nuclear@1: if (do_fancy && compptr->downsampled_width > 2) nuclear@1: upsample->methods[ci] = h2v1_fancy_upsample; nuclear@1: else nuclear@1: upsample->methods[ci] = h2v1_upsample; nuclear@1: } else if (h_in_group * 2 == h_out_group && nuclear@1: v_in_group * 2 == v_out_group) { nuclear@1: /* Special cases for 2h2v upsampling */ nuclear@1: if (do_fancy && compptr->downsampled_width > 2) { nuclear@1: upsample->methods[ci] = h2v2_fancy_upsample; nuclear@1: upsample->pub.need_context_rows = TRUE; nuclear@1: } else nuclear@1: upsample->methods[ci] = h2v2_upsample; nuclear@1: } else if ((h_out_group % h_in_group) == 0 && nuclear@1: (v_out_group % v_in_group) == 0) { nuclear@1: /* Generic integral-factors upsampling method */ nuclear@1: upsample->methods[ci] = int_upsample; nuclear@1: upsample->h_expand[ci] = (UINT8) (h_out_group / h_in_group); nuclear@1: upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group); nuclear@1: } else nuclear@1: ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL); nuclear@1: if (need_buffer) { nuclear@1: upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray) nuclear@1: ((j_common_ptr) cinfo, JPOOL_IMAGE, nuclear@1: (JDIMENSION) jround_up((long) cinfo->output_width, nuclear@1: (long) cinfo->max_h_samp_factor), nuclear@1: (JDIMENSION) cinfo->max_v_samp_factor); nuclear@1: } nuclear@1: } nuclear@1: }