35 #define JPEG_INTERNALS 39 #ifdef UPSAMPLE_MERGING_SUPPORTED 73 #define ONE_HALF ((INT32) 1 << (SCALEBITS-1)) 74 #define FIX(x) ((INT32) ((x) * (1L<<SCALEBITS) + 0.5)) 94 (*cinfo->mem->alloc_small) ((
j_common_ptr) cinfo, JPOOL_IMAGE,
97 (*cinfo->mem->alloc_small) ((
j_common_ptr) cinfo, JPOOL_IMAGE,
100 (*cinfo->mem->alloc_small) ((
j_common_ptr) cinfo, JPOOL_IMAGE,
168 out_rows_avail -= *out_row_ctr;
172 work_ptrs[0] = output_buf[*out_row_ctr];
174 work_ptrs[1] = output_buf[*out_row_ctr + 1];
180 (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, work_ptrs);
188 (*in_row_group_ctr)++;
203 (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr,
207 (*in_row_group_ctr)++;
231 register int y, cred, cgreen, cblue;
237 register JSAMPLE * range_limit = cinfo->sample_range_limit;
244 inptr0 = input_buf[0][in_row_group_ctr];
245 inptr1 = input_buf[1][in_row_group_ctr];
246 inptr2 = input_buf[2][in_row_group_ctr];
249 for (col = cinfo->output_width >> 1; col > 0; col--) {
258 outptr[RGB_RED] = range_limit[
y + cred];
259 outptr[RGB_GREEN] = range_limit[
y + cgreen];
260 outptr[RGB_BLUE] = range_limit[
y + cblue];
261 outptr += RGB_PIXELSIZE;
263 outptr[RGB_RED] = range_limit[
y + cred];
264 outptr[RGB_GREEN] = range_limit[
y + cgreen];
265 outptr[RGB_BLUE] = range_limit[
y + cblue];
266 outptr += RGB_PIXELSIZE;
269 if (cinfo->output_width & 1) {
276 outptr[RGB_RED] = range_limit[
y + cred];
277 outptr[RGB_GREEN] = range_limit[
y + cgreen];
278 outptr[RGB_BLUE] = range_limit[
y + cblue];
293 register int y, cred, cgreen, cblue;
296 JSAMPROW inptr00, inptr01, inptr1, inptr2;
299 register JSAMPLE * range_limit = cinfo->sample_range_limit;
306 inptr00 = input_buf[0][in_row_group_ctr*2];
307 inptr01 = input_buf[0][in_row_group_ctr*2 + 1];
308 inptr1 = input_buf[1][in_row_group_ctr];
309 inptr2 = input_buf[2][in_row_group_ctr];
313 for (col = cinfo->output_width >> 1; col > 0; col--) {
322 outptr0[RGB_RED] = range_limit[
y + cred];
323 outptr0[RGB_GREEN] = range_limit[
y + cgreen];
324 outptr0[RGB_BLUE] = range_limit[
y + cblue];
325 outptr0 += RGB_PIXELSIZE;
327 outptr0[RGB_RED] = range_limit[
y + cred];
328 outptr0[RGB_GREEN] = range_limit[
y + cgreen];
329 outptr0[RGB_BLUE] = range_limit[
y + cblue];
330 outptr0 += RGB_PIXELSIZE;
332 outptr1[RGB_RED] = range_limit[
y + cred];
333 outptr1[RGB_GREEN] = range_limit[
y + cgreen];
334 outptr1[RGB_BLUE] = range_limit[
y + cblue];
335 outptr1 += RGB_PIXELSIZE;
337 outptr1[RGB_RED] = range_limit[
y + cred];
338 outptr1[RGB_GREEN] = range_limit[
y + cgreen];
339 outptr1[RGB_BLUE] = range_limit[
y + cblue];
340 outptr1 += RGB_PIXELSIZE;
343 if (cinfo->output_width & 1) {
350 outptr0[RGB_RED] = range_limit[
y + cred];
351 outptr0[RGB_GREEN] = range_limit[
y + cgreen];
352 outptr0[RGB_BLUE] = range_limit[
y + cblue];
354 outptr1[RGB_RED] = range_limit[
y + cred];
355 outptr1[RGB_GREEN] = range_limit[
y + cgreen];
356 outptr1[RGB_BLUE] = range_limit[
y + cblue];
381 upsample->
out_row_width = cinfo->output_width * cinfo->out_color_components;
383 if (cinfo->max_v_samp_factor == 2) {
merged_2v_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)
struct jpeg_common_struct * j_common_ptr
#define GETJSAMPLE(value)
JMETHOD(void, prepare_for_output_pass,(j_decompress_ptr cinfo))
struct jpeg_upsampler pub
my_upsampler * my_upsample_ptr
h2v1_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)
build_ycc_rgb_table(j_decompress_ptr cinfo)
int JSAMPARRAY int int num_rows
jinit_merged_upsampler(j_decompress_ptr cinfo)
h2v2_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)
#define RIGHT_SHIFT(x, shft)
boolean need_context_rows
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)
start_pass_merged_upsample(j_decompress_ptr cinfo)
merged_1v_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)