4 * This file was part of the Independent JPEG Group's software:
5 * Copyright (C) 1994-1996, Thomas G. Lane.
6 * libjpeg-turbo Modifications:
7 * Copyright (C) 2020, 2022, D. R. Commander.
8 * For conditions of distribution and use, see the accompanying README.ijg
12 #define JPEG_INTERNALS
14 #include "jsamplecomp.h"
16 #ifdef UPSAMPLE_MERGING_SUPPORTED
19 /* Private subobject */
22 struct jpeg_upsampler pub
; /* public fields */
24 /* Pointer to routine to do actual upsampling/conversion of one row group */
25 void (*upmethod
) (j_decompress_ptr cinfo
, _JSAMPIMAGE input_buf
,
26 JDIMENSION in_row_group_ctr
, _JSAMPARRAY output_buf
);
28 /* Private state for YCC->RGB conversion */
29 int *Cr_r_tab
; /* => table for Cr to R conversion */
30 int *Cb_b_tab
; /* => table for Cb to B conversion */
31 JLONG
*Cr_g_tab
; /* => table for Cr to G conversion */
32 JLONG
*Cb_g_tab
; /* => table for Cb to G conversion */
34 /* For 2:1 vertical sampling, we produce two output rows at a time.
35 * We need a "spare" row buffer to hold the second output row if the
36 * application provides just a one-row buffer; we also use the spare
37 * to discard the dummy last row if the image height is odd.
40 boolean spare_full
; /* T if spare buffer is occupied */
42 JDIMENSION out_row_width
; /* samples per output row */
43 JDIMENSION rows_to_go
; /* counts rows remaining in image */
44 } my_merged_upsampler
;
46 typedef my_merged_upsampler
*my_merged_upsample_ptr
;
48 #endif /* UPSAMPLE_MERGING_SUPPORTED */