157 jcopy_sample_rows(& upsample->spare_row, 0, output_buf + *out_row_ctr, 0,
158 1, upsample->out_row_width);
160 upsample->spare_full = FALSE;
165 if (num_rows > upsample->rows_to_go)
166 num_rows = upsample->rows_to_go;
168 out_rows_avail -= *out_row_ctr;
169 if (num_rows > out_rows_avail)
170 num_rows = out_rows_avail;
172 work_ptrs[0] = output_buf[*out_row_ctr];
174 work_ptrs[1] = output_buf[*out_row_ctr + 1];
176 work_ptrs[1] = upsample->spare_row;
177 upsample->spare_full = TRUE;
180 (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, work_ptrs);
187 if (! upsample->spare_full)
188 (*in_row_group_ctr)++;
231 int y, cred, cgreen, cblue;
237 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--) {
251 cb = GETJSAMPLE(*inptr1++);
252 cr = GETJSAMPLE(*inptr2++);
254 cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
257 y = GETJSAMPLE(*inptr0++);
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;
262 y = GETJSAMPLE(*inptr0++);
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) {
270 cb = GETJSAMPLE(*inptr1);
271 cr = GETJSAMPLE(*inptr2);
273 cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
275 y = GETJSAMPLE(*inptr0);
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 int y, cred, cgreen, cblue;
296 JSAMPROW inptr00, inptr01, inptr1, inptr2;
299 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--) {
315 cb = GETJSAMPLE(*inptr1++);
316 cr = GETJSAMPLE(*inptr2++);
318 cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
321 y = GETJSAMPLE(*inptr00++);
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;
326 y = GETJSAMPLE(*inptr00++);
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;
331 y = GETJSAMPLE(*inptr01++);
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;
336 y = GETJSAMPLE(*inptr01++);
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) {
344 cb = GETJSAMPLE(*inptr1);
345 cr = GETJSAMPLE(*inptr2);
347 cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
349 y = GETJSAMPLE(*inptr00);
350 outptr0[RGB_RED] = range_limit[y + cred];
351 outptr0[RGB_GREEN] = range_limit[y + cgreen];
352 outptr0[RGB_BLUE] = range_limit[y + cblue];
353 y = GETJSAMPLE(*inptr01);
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) {
384 upsample->pub.upsample = merged_2v_upsample;
385 upsample->upmethod = h2v2_merged_upsample;
387 upsample->spare_row = (JSAMPROW)
388 (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
389 (size_t) (upsample->out_row_width * SIZEOF(JSAMPLE)));
391 upsample->pub.upsample = merged_1v_upsample;
392 upsample->upmethod = h2v1_merged_upsample;
394 upsample->spare_row = NULL;
merged_2v_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)
Definition jdmerge.c:144
merged_1v_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, JDIMENSION, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION)
Definition jdmerge.c:193
JMETHOD(void, upmethod,(j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf))