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))
168 out_rows_avail -= *out_row_ctr;
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) {