blob: 53361252d11baab995fa0b30527caac5bdc2788b [file] [log] [blame]
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +00001/*
2 * jdmerge.c
3 *
Thomas G. Lane489583f1996-02-07 00:00:00 +00004 * Copyright (C) 1994-1996, Thomas G. Lane.
Pierre Ossman59a39382009-03-09 13:15:56 +00005 * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
DRCb4570bb2011-09-07 06:31:00 +00006 * Copyright (C) 2009, 2011, D. R. Commander.
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +00007 * This file is part of the Independent JPEG Group's software.
8 * For conditions of distribution and use, see the accompanying README file.
9 *
10 * This file contains code for merged upsampling/color conversion.
11 *
12 * This file combines functions from jdsample.c and jdcolor.c;
13 * read those files first to understand what's going on.
14 *
15 * When the chroma components are to be upsampled by simple replication
16 * (ie, box filtering), we can save some work in color conversion by
17 * calculating all the output pixels corresponding to a pair of chroma
18 * samples at one time. In the conversion equations
19 * R = Y + K1 * Cr
20 * G = Y + K2 * Cb + K3 * Cr
21 * B = Y + K4 * Cb
22 * only the Y term varies among the group of pixels corresponding to a pair
23 * of chroma samples, so the rest of the terms can be calculated just once.
24 * At typical sampling ratios, this eliminates half or three-quarters of the
25 * multiplications needed for color conversion.
26 *
27 * This file currently provides implementations for the following cases:
28 * YCbCr => RGB color conversion only.
29 * Sampling ratios of 2h1v or 2h2v.
30 * No scaling needed at upsample time.
31 * Corner-aligned (non-CCIR601) sampling alignment.
32 * Other special cases could be added, but in most applications these are
33 * the only common cases. (For uncommon cases we fall back on the more
34 * general code in jdsample.c and jdcolor.c.)
35 */
36
37#define JPEG_INTERNALS
38#include "jinclude.h"
39#include "jpeglib.h"
Pierre Ossman59a39382009-03-09 13:15:56 +000040#include "jsimd.h"
DRCa7466c92012-01-26 22:20:31 +000041#include "config.h"
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +000042
43#ifdef UPSAMPLE_MERGING_SUPPORTED
44
45
46/* Private subobject */
47
48typedef struct {
49 struct jpeg_upsampler pub; /* public fields */
50
51 /* Pointer to routine to do actual upsampling/conversion of one row group */
52 JMETHOD(void, upmethod, (j_decompress_ptr cinfo,
53 JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
54 JSAMPARRAY output_buf));
55
56 /* Private state for YCC->RGB conversion */
57 int * Cr_r_tab; /* => table for Cr to R conversion */
58 int * Cb_b_tab; /* => table for Cb to B conversion */
59 INT32 * Cr_g_tab; /* => table for Cr to G conversion */
60 INT32 * Cb_g_tab; /* => table for Cb to G conversion */
61
62 /* For 2:1 vertical sampling, we produce two output rows at a time.
63 * We need a "spare" row buffer to hold the second output row if the
64 * application provides just a one-row buffer; we also use the spare
65 * to discard the dummy last row if the image height is odd.
66 */
67 JSAMPROW spare_row;
68 boolean spare_full; /* T if spare buffer is occupied */
69
70 JDIMENSION out_row_width; /* samples per output row */
71 JDIMENSION rows_to_go; /* counts rows remaining in image */
72} my_upsampler;
73
74typedef my_upsampler * my_upsample_ptr;
75
76#define SCALEBITS 16 /* speediest right-shift on some machines */
77#define ONE_HALF ((INT32) 1 << (SCALEBITS-1))
78#define FIX(x) ((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
79
80
DRCb4570bb2011-09-07 06:31:00 +000081/* Include inline routines for colorspace extensions */
82
83#include "jdmrgext.c"
84#undef RGB_RED
85#undef RGB_GREEN
86#undef RGB_BLUE
87#undef RGB_PIXELSIZE
88
89#define RGB_RED EXT_RGB_RED
90#define RGB_GREEN EXT_RGB_GREEN
91#define RGB_BLUE EXT_RGB_BLUE
92#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE
93#define h2v1_merged_upsample_internal extrgb_h2v1_merged_upsample_internal
94#define h2v2_merged_upsample_internal extrgb_h2v2_merged_upsample_internal
95#include "jdmrgext.c"
96#undef RGB_RED
97#undef RGB_GREEN
98#undef RGB_BLUE
99#undef RGB_PIXELSIZE
100#undef h2v1_merged_upsample_internal
101#undef h2v2_merged_upsample_internal
102
103#define RGB_RED EXT_RGBX_RED
104#define RGB_GREEN EXT_RGBX_GREEN
105#define RGB_BLUE EXT_RGBX_BLUE
DRCcac10512012-03-16 14:37:36 +0000106#define RGB_ALPHA 3
DRCb4570bb2011-09-07 06:31:00 +0000107#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE
108#define h2v1_merged_upsample_internal extrgbx_h2v1_merged_upsample_internal
109#define h2v2_merged_upsample_internal extrgbx_h2v2_merged_upsample_internal
110#include "jdmrgext.c"
111#undef RGB_RED
112#undef RGB_GREEN
113#undef RGB_BLUE
DRCcac10512012-03-16 14:37:36 +0000114#undef RGB_ALPHA
DRCb4570bb2011-09-07 06:31:00 +0000115#undef RGB_PIXELSIZE
116#undef h2v1_merged_upsample_internal
117#undef h2v2_merged_upsample_internal
118
119#define RGB_RED EXT_BGR_RED
120#define RGB_GREEN EXT_BGR_GREEN
121#define RGB_BLUE EXT_BGR_BLUE
122#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE
123#define h2v1_merged_upsample_internal extbgr_h2v1_merged_upsample_internal
124#define h2v2_merged_upsample_internal extbgr_h2v2_merged_upsample_internal
125#include "jdmrgext.c"
126#undef RGB_RED
127#undef RGB_GREEN
128#undef RGB_BLUE
129#undef RGB_PIXELSIZE
130#undef h2v1_merged_upsample_internal
131#undef h2v2_merged_upsample_internal
132
133#define RGB_RED EXT_BGRX_RED
134#define RGB_GREEN EXT_BGRX_GREEN
135#define RGB_BLUE EXT_BGRX_BLUE
DRCcac10512012-03-16 14:37:36 +0000136#define RGB_ALPHA 3
DRCb4570bb2011-09-07 06:31:00 +0000137#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE
138#define h2v1_merged_upsample_internal extbgrx_h2v1_merged_upsample_internal
139#define h2v2_merged_upsample_internal extbgrx_h2v2_merged_upsample_internal
140#include "jdmrgext.c"
141#undef RGB_RED
142#undef RGB_GREEN
143#undef RGB_BLUE
DRCcac10512012-03-16 14:37:36 +0000144#undef RGB_ALPHA
DRCb4570bb2011-09-07 06:31:00 +0000145#undef RGB_PIXELSIZE
146#undef h2v1_merged_upsample_internal
147#undef h2v2_merged_upsample_internal
148
149#define RGB_RED EXT_XBGR_RED
150#define RGB_GREEN EXT_XBGR_GREEN
151#define RGB_BLUE EXT_XBGR_BLUE
DRCcac10512012-03-16 14:37:36 +0000152#define RGB_ALPHA 0
DRCb4570bb2011-09-07 06:31:00 +0000153#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE
154#define h2v1_merged_upsample_internal extxbgr_h2v1_merged_upsample_internal
155#define h2v2_merged_upsample_internal extxbgr_h2v2_merged_upsample_internal
156#include "jdmrgext.c"
157#undef RGB_RED
158#undef RGB_GREEN
159#undef RGB_BLUE
DRCcac10512012-03-16 14:37:36 +0000160#undef RGB_ALPHA
DRCb4570bb2011-09-07 06:31:00 +0000161#undef RGB_PIXELSIZE
162#undef h2v1_merged_upsample_internal
163#undef h2v2_merged_upsample_internal
164
165#define RGB_RED EXT_XRGB_RED
166#define RGB_GREEN EXT_XRGB_GREEN
167#define RGB_BLUE EXT_XRGB_BLUE
DRCcac10512012-03-16 14:37:36 +0000168#define RGB_ALPHA 0
DRCb4570bb2011-09-07 06:31:00 +0000169#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE
170#define h2v1_merged_upsample_internal extxrgb_h2v1_merged_upsample_internal
171#define h2v2_merged_upsample_internal extxrgb_h2v2_merged_upsample_internal
172#include "jdmrgext.c"
173#undef RGB_RED
174#undef RGB_GREEN
175#undef RGB_BLUE
DRCcac10512012-03-16 14:37:36 +0000176#undef RGB_ALPHA
DRCb4570bb2011-09-07 06:31:00 +0000177#undef RGB_PIXELSIZE
178#undef h2v1_merged_upsample_internal
179#undef h2v2_merged_upsample_internal
180
181
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000182/*
Thomas G. Lanebc79e061995-08-02 00:00:00 +0000183 * Initialize tables for YCC->RGB colorspace conversion.
184 * This is taken directly from jdcolor.c; see that file for more info.
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000185 */
186
Thomas G. Lane489583f1996-02-07 00:00:00 +0000187LOCAL(void)
Thomas G. Lanebc79e061995-08-02 00:00:00 +0000188build_ycc_rgb_table (j_decompress_ptr cinfo)
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000189{
190 my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
Thomas G. Lanebc79e061995-08-02 00:00:00 +0000191 int i;
192 INT32 x;
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000193 SHIFT_TEMPS
194
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000195 upsample->Cr_r_tab = (int *)
196 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
197 (MAXJSAMPLE+1) * SIZEOF(int));
198 upsample->Cb_b_tab = (int *)
199 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
200 (MAXJSAMPLE+1) * SIZEOF(int));
201 upsample->Cr_g_tab = (INT32 *)
202 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
203 (MAXJSAMPLE+1) * SIZEOF(INT32));
204 upsample->Cb_g_tab = (INT32 *)
205 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
206 (MAXJSAMPLE+1) * SIZEOF(INT32));
207
Thomas G. Lane9ba2f5e1994-12-07 00:00:00 +0000208 for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000209 /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
Thomas G. Lane9ba2f5e1994-12-07 00:00:00 +0000210 /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000211 /* Cr=>R value is nearest int to 1.40200 * x */
212 upsample->Cr_r_tab[i] = (int)
Thomas G. Lane9ba2f5e1994-12-07 00:00:00 +0000213 RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000214 /* Cb=>B value is nearest int to 1.77200 * x */
215 upsample->Cb_b_tab[i] = (int)
Thomas G. Lane9ba2f5e1994-12-07 00:00:00 +0000216 RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000217 /* Cr=>G value is scaled-up -0.71414 * x */
Thomas G. Lane9ba2f5e1994-12-07 00:00:00 +0000218 upsample->Cr_g_tab[i] = (- FIX(0.71414)) * x;
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000219 /* Cb=>G value is scaled-up -0.34414 * x */
220 /* We also add in ONE_HALF so that need not do it in inner loop */
Thomas G. Lane9ba2f5e1994-12-07 00:00:00 +0000221 upsample->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF;
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000222 }
223}
224
225
226/*
Thomas G. Lanebc79e061995-08-02 00:00:00 +0000227 * Initialize for an upsampling pass.
228 */
229
Thomas G. Lane489583f1996-02-07 00:00:00 +0000230METHODDEF(void)
Thomas G. Lanebc79e061995-08-02 00:00:00 +0000231start_pass_merged_upsample (j_decompress_ptr cinfo)
232{
233 my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
234
235 /* Mark the spare buffer empty */
236 upsample->spare_full = FALSE;
237 /* Initialize total-height counter for detecting bottom of image */
238 upsample->rows_to_go = cinfo->output_height;
239}
240
241
242/*
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000243 * Control routine to do upsampling (and color conversion).
244 *
245 * The control routine just handles the row buffering considerations.
246 */
247
Thomas G. Lane489583f1996-02-07 00:00:00 +0000248METHODDEF(void)
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000249merged_2v_upsample (j_decompress_ptr cinfo,
250 JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
251 JDIMENSION in_row_groups_avail,
252 JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
253 JDIMENSION out_rows_avail)
254/* 2:1 vertical sampling case: may need a spare row. */
255{
256 my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
257 JSAMPROW work_ptrs[2];
258 JDIMENSION num_rows; /* number of rows returned to caller */
259
260 if (upsample->spare_full) {
261 /* If we have a spare row saved from a previous cycle, just return it. */
262 jcopy_sample_rows(& upsample->spare_row, 0, output_buf + *out_row_ctr, 0,
263 1, upsample->out_row_width);
264 num_rows = 1;
265 upsample->spare_full = FALSE;
266 } else {
267 /* Figure number of rows to return to caller. */
268 num_rows = 2;
269 /* Not more than the distance to the end of the image. */
270 if (num_rows > upsample->rows_to_go)
271 num_rows = upsample->rows_to_go;
272 /* And not more than what the client can accept: */
273 out_rows_avail -= *out_row_ctr;
274 if (num_rows > out_rows_avail)
275 num_rows = out_rows_avail;
276 /* Create output pointer array for upsampler. */
277 work_ptrs[0] = output_buf[*out_row_ctr];
278 if (num_rows > 1) {
279 work_ptrs[1] = output_buf[*out_row_ctr + 1];
280 } else {
281 work_ptrs[1] = upsample->spare_row;
282 upsample->spare_full = TRUE;
283 }
284 /* Now do the upsampling. */
285 (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, work_ptrs);
286 }
287
288 /* Adjust counts */
289 *out_row_ctr += num_rows;
290 upsample->rows_to_go -= num_rows;
291 /* When the buffer is emptied, declare this input row group consumed */
292 if (! upsample->spare_full)
293 (*in_row_group_ctr)++;
294}
295
296
Thomas G. Lane489583f1996-02-07 00:00:00 +0000297METHODDEF(void)
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000298merged_1v_upsample (j_decompress_ptr cinfo,
299 JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
300 JDIMENSION in_row_groups_avail,
301 JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
302 JDIMENSION out_rows_avail)
303/* 1:1 vertical sampling case: much easier, never need a spare row. */
304{
305 my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
306
307 /* Just do the upsampling. */
308 (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr,
309 output_buf + *out_row_ctr);
310 /* Adjust counts */
311 (*out_row_ctr)++;
312 (*in_row_group_ctr)++;
313}
314
315
316/*
317 * These are the routines invoked by the control routines to do
318 * the actual upsampling/conversion. One row group is processed per call.
319 *
320 * Note: since we may be writing directly into application-supplied buffers,
321 * we have to be honest about the output width; we can't assume the buffer
322 * has been rounded up to an even width.
323 */
324
325
326/*
327 * Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical.
328 */
329
Thomas G. Lane489583f1996-02-07 00:00:00 +0000330METHODDEF(void)
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000331h2v1_merged_upsample (j_decompress_ptr cinfo,
332 JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
333 JSAMPARRAY output_buf)
334{
DRCb4570bb2011-09-07 06:31:00 +0000335 switch (cinfo->out_color_space) {
336 case JCS_EXT_RGB:
337 extrgb_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
338 output_buf);
339 break;
340 case JCS_EXT_RGBX:
DRC67ce3b22011-12-19 02:21:03 +0000341 case JCS_EXT_RGBA:
DRCb4570bb2011-09-07 06:31:00 +0000342 extrgbx_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
343 output_buf);
344 break;
345 case JCS_EXT_BGR:
346 extbgr_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
347 output_buf);
348 break;
349 case JCS_EXT_BGRX:
DRC67ce3b22011-12-19 02:21:03 +0000350 case JCS_EXT_BGRA:
DRCb4570bb2011-09-07 06:31:00 +0000351 extbgrx_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
352 output_buf);
353 break;
354 case JCS_EXT_XBGR:
DRC67ce3b22011-12-19 02:21:03 +0000355 case JCS_EXT_ABGR:
DRCb4570bb2011-09-07 06:31:00 +0000356 extxbgr_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
357 output_buf);
358 break;
359 case JCS_EXT_XRGB:
DRC67ce3b22011-12-19 02:21:03 +0000360 case JCS_EXT_ARGB:
DRCb4570bb2011-09-07 06:31:00 +0000361 extxrgb_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
362 output_buf);
363 break;
364 default:
365 h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
366 output_buf);
367 break;
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000368 }
369}
370
371
372/*
373 * Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical.
374 */
375
Thomas G. Lane489583f1996-02-07 00:00:00 +0000376METHODDEF(void)
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000377h2v2_merged_upsample (j_decompress_ptr cinfo,
378 JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
379 JSAMPARRAY output_buf)
380{
DRCb4570bb2011-09-07 06:31:00 +0000381 switch (cinfo->out_color_space) {
382 case JCS_EXT_RGB:
383 extrgb_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
384 output_buf);
385 break;
386 case JCS_EXT_RGBX:
DRC67ce3b22011-12-19 02:21:03 +0000387 case JCS_EXT_RGBA:
DRCb4570bb2011-09-07 06:31:00 +0000388 extrgbx_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
389 output_buf);
390 break;
391 case JCS_EXT_BGR:
392 extbgr_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
393 output_buf);
394 break;
395 case JCS_EXT_BGRX:
DRC67ce3b22011-12-19 02:21:03 +0000396 case JCS_EXT_BGRA:
DRCb4570bb2011-09-07 06:31:00 +0000397 extbgrx_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
398 output_buf);
399 break;
400 case JCS_EXT_XBGR:
DRC67ce3b22011-12-19 02:21:03 +0000401 case JCS_EXT_ABGR:
DRCb4570bb2011-09-07 06:31:00 +0000402 extxbgr_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
403 output_buf);
404 break;
405 case JCS_EXT_XRGB:
DRC67ce3b22011-12-19 02:21:03 +0000406 case JCS_EXT_ARGB:
DRCb4570bb2011-09-07 06:31:00 +0000407 extxrgb_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
408 output_buf);
409 break;
410 default:
411 h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
412 output_buf);
413 break;
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000414 }
415}
416
417
418/*
419 * Module initialization routine for merged upsampling/color conversion.
420 *
421 * NB: this is called under the conditions determined by use_merged_upsample()
422 * in jdmaster.c. That routine MUST correspond to the actual capabilities
423 * of this module; no safety checks are made here.
424 */
425
Thomas G. Lane489583f1996-02-07 00:00:00 +0000426GLOBAL(void)
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000427jinit_merged_upsampler (j_decompress_ptr cinfo)
428{
429 my_upsample_ptr upsample;
430
431 upsample = (my_upsample_ptr)
432 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
433 SIZEOF(my_upsampler));
434 cinfo->upsample = (struct jpeg_upsampler *) upsample;
435 upsample->pub.start_pass = start_pass_merged_upsample;
436 upsample->pub.need_context_rows = FALSE;
437
438 upsample->out_row_width = cinfo->output_width * cinfo->out_color_components;
439
440 if (cinfo->max_v_samp_factor == 2) {
441 upsample->pub.upsample = merged_2v_upsample;
Pierre Ossman59a39382009-03-09 13:15:56 +0000442 if (jsimd_can_h2v2_merged_upsample())
443 upsample->upmethod = jsimd_h2v2_merged_upsample;
444 else
445 upsample->upmethod = h2v2_merged_upsample;
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000446 /* Allocate a spare row buffer */
447 upsample->spare_row = (JSAMPROW)
448 (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
449 (size_t) (upsample->out_row_width * SIZEOF(JSAMPLE)));
450 } else {
451 upsample->pub.upsample = merged_1v_upsample;
Pierre Ossman59a39382009-03-09 13:15:56 +0000452 if (jsimd_can_h2v1_merged_upsample())
453 upsample->upmethod = jsimd_h2v1_merged_upsample;
454 else
455 upsample->upmethod = h2v1_merged_upsample;
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000456 /* No spare row needed */
457 upsample->spare_row = NULL;
458 }
Thomas G. Lanebc79e061995-08-02 00:00:00 +0000459
460 build_ycc_rgb_table(cinfo);
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000461}
462
463#endif /* UPSAMPLE_MERGING_SUPPORTED */