Debian Codegraph @

Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jdmerge.c

raw symbols SCIP
1 /*
2 * jdmerge.c
3 *
4 * Copyright (C) 1994-1996, Thomas G. Lane.
5 * This file is part of the Independent JPEG Group's software.
6 * For conditions of distribution and use, see the accompanying README file.
7 *
8 * This file contains code for merged upsampling/color conversion.
9 *
10 * This file combines functions from jdsample.c and jdcolor.c;
11 * read those files first to understand what's going on.
12 *
13 * When the chroma components are to be upsampled by simple replication
14 * (ie, box filtering), we can save some work in color conversion by
15 * calculating all the output pixels corresponding to a pair of chroma
16 * samples at one time. In the conversion equations
17 * R = Y + K1 * Cr
18 * G = Y + K2 * Cb + K3 * Cr
19 * B = Y + K4 * Cb
20 * only the Y term varies among the group of pixels corresponding to a pair
21 * of chroma samples, so the rest of the terms can be calculated just once.
22 * At typical sampling ratios, this eliminates half or three-quarters of the
23 * multiplications needed for color conversion.
24 *
25 * This file currently provides implementations for the following cases:
26 * YCbCr => RGB color conversion only.
27 * Sampling ratios of 2h1v or 2h2v.
28 * No scaling needed at upsample time.
29 * Corner-aligned (non-CCIR601) sampling alignment.
30 * Other special cases could be added, but in most applications these are
31 * the only common cases. (For uncommon cases we fall back on the more
32 * general code in jdsample.c and jdcolor.c.)
33 */
34
35 #define JPEG_INTERNALScxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jdmerge.c:35:9`!
36 #include "jinclude.h"cxx . . $ `<file>/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jinclude.h`/
37 #include "jpeglib.h"cxx . . $ `<file>/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jpeglib.h`/
38
39 #ifdef UPSAMPLE_MERGING_SUPPORTEDcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:353:9`!
40
41
42 /* Private subobject */
43
44 typedef structcxx . . $ $anonymous_type_13b7d85e4610bb3f_0# {
45 struct jpeg_upsamplercxx . . $ jpeg_upsampler# pubcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#pub.; /* public fields */
46
47 /* Pointer to routine to do actual upsampling/conversion of one row group */
48 JMETHODcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:256:9`!(void, upmethod, (j_decompress_ptr cinfo,
49 JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
50 JSAMPARRAY output_buf));
51
52 /* Private state for YCC->RGB conversion */
53 int * Cr_r_tabcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#Cr_r_tab.; /* => table for Cr to R conversion */
54 int * Cb_b_tabcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#Cb_b_tab.; /* => table for Cb to B conversion */
55 INT32cxx . . $ INT32# * Cr_g_tabcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#Cr_g_tab.; /* => table for Cr to G conversion */
56 INT32cxx . . $ INT32# * Cb_g_tabcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#Cb_g_tab.; /* => table for Cb to G conversion */
57
58 /* For 2:1 vertical sampling, we produce two output rows at a time.
59 * We need a "spare" row buffer to hold the second output row if the
60 * application provides just a one-row buffer; we also use the spare
61 * to discard the dummy last row if the image height is odd.
62 */
63 JSAMPROWcxx . . $ JSAMPROW# spare_rowcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#spare_row.;
64 booleancxx . . $ boolean# spare_fullcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#spare_full.; /* T if spare buffer is occupied */
65
66 JDIMENSIONcxx . . $ JDIMENSION# out_row_widthcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#out_row_width.; /* samples per output row */
67 JDIMENSIONcxx . . $ JDIMENSION# rows_to_gocxx . . $ $anonymous_type_13b7d85e4610bb3f_0#rows_to_go.; /* counts rows remaining in image */
68 } my_upsamplercxx . . $ my_upsampler#;
69
70 typedef my_upsamplercxx . . $ my_upsampler# * my_upsample_ptrcxx . . $ my_upsample_ptr#;
71
72 #define SCALEBITScxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jdmerge.c:72:9`! 16 /* speediest right-shift on some machines */
73 #define ONE_HALFcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jdmerge.c:73:9`! ((INT32) 1 << (SCALEBITScxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jdmerge.c:72:9`!-1))
74 #define FIXcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jdmerge.c:74:9`!(x) ((INT32) ((x) * (1L<<SCALEBITScxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jdmerge.c:72:9`!) + 0.5))
75
76
77 /*
78 * Initialize tables for YCC->RGB colorspace conversion.
79 * This is taken directly from jdcolor.c; see that file for more info.
80 */
81
82 LOCALcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:222:9`!(void)
83 build_ycc_rgb_tablecxx . . $ build_ycc_rgb_table(3d26031805684a5f). (j_decompress_ptrcxx . . $ j_decompress_ptr# cinfo)
84 {
85 my_upsample_ptrcxx . . $ my_upsample_ptr# upsample = (my_upsample_ptrcxx . . $ my_upsample_ptr#) cinfo->upsamplecxx . . $ gdcmjpeg8_decompress_struct#upsample.;
86 int i;
87 INT32cxx . . $ INT32# x;
88 SHIFT_TEMPScxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jpegint.h:251:9`!
89
90 upsample->Cr_r_tabcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#Cr_r_tab. = (int *)
91 (*cinfo->memcxx . . $ gdcmjpeg8_decompress_struct#mem.->alloc_smallcxx . . $ gdcmjpeg8_memory_mgr#alloc_small.) ((j_common_ptrcxx . . $ j_common_ptr#) cinfo, JPOOL_IMAGEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jpeglib.h:768:9`!,
92 (MAXJSAMPLEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:74:9`!+1) * SIZEOFcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jinclude.h:80:9`!(int));
93 upsample->Cb_b_tabcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#Cb_b_tab. = (int *)
94 (*cinfo->memcxx . . $ gdcmjpeg8_decompress_struct#mem.->alloc_smallcxx . . $ gdcmjpeg8_memory_mgr#alloc_small.) ((j_common_ptrcxx . . $ j_common_ptr#) cinfo, JPOOL_IMAGEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jpeglib.h:768:9`!,
95 (MAXJSAMPLEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:74:9`!+1) * SIZEOFcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jinclude.h:80:9`!(int));
96 upsample->Cr_g_tabcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#Cr_g_tab. = (INT32cxx . . $ INT32# *)
97 (*cinfo->memcxx . . $ gdcmjpeg8_decompress_struct#mem.->alloc_smallcxx . . $ gdcmjpeg8_memory_mgr#alloc_small.) ((j_common_ptrcxx . . $ j_common_ptr#) cinfo, JPOOL_IMAGEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jpeglib.h:768:9`!,
98 (MAXJSAMPLEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:74:9`!+1) * SIZEOFcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jinclude.h:80:9`!(INT32));
99 upsample->Cb_g_tabcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#Cb_g_tab. = (INT32cxx . . $ INT32# *)
100 (*cinfo->memcxx . . $ gdcmjpeg8_decompress_struct#mem.->alloc_smallcxx . . $ gdcmjpeg8_memory_mgr#alloc_small.) ((j_common_ptrcxx . . $ j_common_ptr#) cinfo, JPOOL_IMAGEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jpeglib.h:768:9`!,
101 (MAXJSAMPLEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:74:9`!+1) * SIZEOFcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jinclude.h:80:9`!(INT32));
102
103 for (i = 0, x = -CENTERJSAMPLEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:75:9`!; i <= MAXJSAMPLEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:74:9`!; i++, x++) {
104 /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
105 /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
106 /* Cr=>R value is nearest int to 1.40200 * x */
107 upsample->Cr_r_tabcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#Cr_r_tab.[i] = (int)
108 RIGHT_SHIFTcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jpegint.h:252:9`!(FIXcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jdmerge.c:74:9`!(1.40200) * x + ONE_HALFcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jdmerge.c:73:9`!, SCALEBITScxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jdmerge.c:72:9`!);
109 /* Cb=>B value is nearest int to 1.77200 * x */
110 upsample->Cb_b_tabcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#Cb_b_tab.[i] = (int)
111 RIGHT_SHIFTcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jpegint.h:252:9`!(FIXcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jdmerge.c:74:9`!(1.77200) * x + ONE_HALFcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jdmerge.c:73:9`!, SCALEBITScxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jdmerge.c:72:9`!);
112 /* Cr=>G value is scaled-up -0.71414 * x */
113 upsample->Cr_g_tabcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#Cr_g_tab.[i] = (- FIXcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jdmerge.c:74:9`!(0.71414)) * x;
114 /* Cb=>G value is scaled-up -0.34414 * x */
115 /* We also add in ONE_HALF so that need not do it in inner loop */
116 upsample->Cb_g_tabcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#Cb_g_tab.[i] = (- FIXcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jdmerge.c:74:9`!(0.34414)) * x + ONE_HALFcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jdmerge.c:73:9`!;
117 }
118 }
119
120
121 /*
122 * Initialize for an upsampling pass.
123 */
124
125 METHODDEFcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:220:9`!(void)
126 start_pass_merged_upsamplecxx . . $ start_pass_merged_upsample(3d26031805684a5f). (j_decompress_ptrcxx . . $ j_decompress_ptr# cinfo)
127 {
128 my_upsample_ptrcxx . . $ my_upsample_ptr# upsample = (my_upsample_ptrcxx . . $ my_upsample_ptr#) cinfo->upsamplecxx . . $ gdcmjpeg8_decompress_struct#upsample.;
129
130 /* Mark the spare buffer empty */
131 upsample->spare_fullcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#spare_full. = FALSEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:288:9`!;
132 /* Initialize total-height counter for detecting bottom of image */
133 upsample->rows_to_gocxx . . $ $anonymous_type_13b7d85e4610bb3f_0#rows_to_go. = cinfo->output_heightcxx . . $ gdcmjpeg8_decompress_struct#output_height.;
134 }
135
136
137 /*
138 * Control routine to do upsampling (and color conversion).
139 *
140 * The control routine just handles the row buffering considerations.
141 */
142
143 METHODDEFcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:220:9`!(void)
144 merged_2v_upsamplecxx . . $ merged_2v_upsample(54a7e9b858d2ea7a). (j_decompress_ptrcxx . . $ j_decompress_ptr# cinfo,
145 JSAMPIMAGEcxx . . $ JSAMPIMAGE# input_buf, JDIMENSIONcxx . . $ JDIMENSION# *in_row_group_ctr,
146 JDIMENSIONcxx . . $ JDIMENSION# in_row_groups_avail,
147 JSAMPARRAYcxx . . $ JSAMPARRAY# output_buf, JDIMENSIONcxx . . $ JDIMENSION# *out_row_ctr,
148 JDIMENSIONcxx . . $ JDIMENSION# out_rows_avail)
149 /* 2:1 vertical sampling case: may need a spare row. */
150 {
151 my_upsample_ptrcxx . . $ my_upsample_ptr# upsample = (my_upsample_ptrcxx . . $ my_upsample_ptr#) cinfo->upsamplecxx . . $ gdcmjpeg8_decompress_struct#upsample.;
152 JSAMPROWcxx . . $ JSAMPROW# work_ptrs[2];
153 JDIMENSIONcxx . . $ JDIMENSION# num_rows; /* number of rows returned to caller */
154 (void)in_row_groups_avail;
155
156 if (upsample->spare_fullcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#spare_full.) {
157 /* If we have a spare row saved from a previous cycle, just return it. */
158 jcopy_sample_rowscxx . . $ `build/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/8/mangle_jpeg8bits.h:18:9`!(& upsample->spare_rowcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#spare_row., 0, output_buf + *out_row_ctr, 0,
159 1, upsample->out_row_widthcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#out_row_width.);
160 num_rows = 1;
161 upsample->spare_fullcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#spare_full. = FALSEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:288:9`!;
162 } else {
163 /* Figure number of rows to return to caller. */
164 num_rows = 2;
165 /* Not more than the distance to the end of the image. */
166 if (num_rows > upsample->rows_to_gocxx . . $ $anonymous_type_13b7d85e4610bb3f_0#rows_to_go.)
167 num_rows = upsample->rows_to_gocxx . . $ $anonymous_type_13b7d85e4610bb3f_0#rows_to_go.;
168 /* And not more than what the client can accept: */
169 out_rows_avail -= *out_row_ctr;
170 if (num_rows > out_rows_avail)
171 num_rows = out_rows_avail;
172 /* Create output pointer array for upsampler. */
173 work_ptrs[0] = output_buf[*out_row_ctr];
174 if (num_rows > 1) {
175 work_ptrs[1] = output_buf[*out_row_ctr + 1];
176 } else {
177 work_ptrs[1] = upsample->spare_rowcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#spare_row.;
178 upsample->spare_fullcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#spare_full. = TRUEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:291:9`!;
179 }
180 /* Now do the upsampling. */
181 (*upsample->upmethodcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#upmethod.) (cinfo, input_buf, *in_row_group_ctr, work_ptrs);
182 }
183
184 /* Adjust counts */
185 *out_row_ctr += num_rows;
186 upsample->rows_to_gocxx . . $ $anonymous_type_13b7d85e4610bb3f_0#rows_to_go. -= num_rows;
187 /* When the buffer is emptied, declare this input row group consumed */
188 if (! upsample->spare_fullcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#spare_full.)
189 (*in_row_group_ctr)++;
190 }
191
192
193 METHODDEFcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:220:9`!(void)
194 merged_1v_upsamplecxx . . $ merged_1v_upsample(54a7e9b858d2ea7a). (j_decompress_ptrcxx . . $ j_decompress_ptr# cinfo,
195 JSAMPIMAGEcxx . . $ JSAMPIMAGE# input_buf, JDIMENSIONcxx . . $ JDIMENSION# *in_row_group_ctr,
196 JDIMENSIONcxx . . $ JDIMENSION# in_row_groups_avail,
197 JSAMPARRAYcxx . . $ JSAMPARRAY# output_buf, JDIMENSIONcxx . . $ JDIMENSION# *out_row_ctr,
198 JDIMENSIONcxx . . $ JDIMENSION# out_rows_avail)
199 /* 1:1 vertical sampling case: much easier, never need a spare row. */
200 {
201 my_upsample_ptrcxx . . $ my_upsample_ptr# upsample = (my_upsample_ptrcxx . . $ my_upsample_ptr#) cinfo->upsamplecxx . . $ gdcmjpeg8_decompress_struct#upsample.;
202 (void)in_row_groups_avail;(void)out_rows_avail;
203
204 /* Just do the upsampling. */
205 (*upsample->upmethodcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#upmethod.) (cinfo, input_buf, *in_row_group_ctr,
206 output_buf + *out_row_ctr);
207 /* Adjust counts */
208 (*out_row_ctr)++;
209 (*in_row_group_ctr)++;
210 }
211
212
213 /*
214 * These are the routines invoked by the control routines to do
215 * the actual upsampling/conversion. One row group is processed per call.
216 *
217 * Note: since we may be writing directly into application-supplied buffers,
218 * we have to be honest about the output width; we can't assume the buffer
219 * has been rounded up to an even width.
220 */
221
222
223 /*
224 * Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical.
225 */
226
227 METHODDEFcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:220:9`!(void)
228 h2v1_merged_upsamplecxx . . $ h2v1_merged_upsample(3add4c5796a115f6). (j_decompress_ptrcxx . . $ j_decompress_ptr# cinfo,
229 JSAMPIMAGEcxx . . $ JSAMPIMAGE# input_buf, JDIMENSIONcxx . . $ JDIMENSION# in_row_group_ctr,
230 JSAMPARRAYcxx . . $ JSAMPARRAY# output_buf)
231 {
232 my_upsample_ptrcxx . . $ my_upsample_ptr# upsample = (my_upsample_ptrcxx . . $ my_upsample_ptr#) cinfo->upsamplecxx . . $ gdcmjpeg8_decompress_struct#upsample.;
233 register int y, cred, cgreen, cblue;
234 int cb, cr;
235 register JSAMPROWcxx . . $ JSAMPROW# outptr;
236 JSAMPROWcxx . . $ JSAMPROW# inptr0, inptr1, inptr2;
237 JDIMENSIONcxx . . $ JDIMENSION# col;
238 /* copy these pointers into registers if possible */
239 register JSAMPLEcxx . . $ JSAMPLE# * range_limit = cinfo->sample_range_limitcxx . . $ gdcmjpeg8_decompress_struct#sample_range_limit.;
240 int * Crrtab = upsample->Cr_r_tabcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#Cr_r_tab.;
241 int * Cbbtab = upsample->Cb_b_tabcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#Cb_b_tab.;
242 INT32cxx . . $ INT32# * Crgtab = upsample->Cr_g_tabcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#Cr_g_tab.;
243 INT32cxx . . $ INT32# * Cbgtab = upsample->Cb_g_tabcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#Cb_g_tab.;
244 SHIFT_TEMPScxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jpegint.h:251:9`!
245
246 inptr0 = input_buf[0][in_row_group_ctr];
247 inptr1 = input_buf[1][in_row_group_ctr];
248 inptr2 = input_buf[2][in_row_group_ctr];
249 outptr = output_buf[0];
250 /* Loop for each pair of output pixels */
251 for (col = cinfo->output_widthcxx . . $ gdcmjpeg8_decompress_struct#output_width. >> 1; col > 0; col--) {
252 /* Do the chroma part of the calculation */
253 cb = GETJSAMPLEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:61:9`!(*inptr1++);
254 cr = GETJSAMPLEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:61:9`!(*inptr2++);
255 cred = Crrtab[cr];
256 cgreen = (int) RIGHT_SHIFTcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jpegint.h:252:9`!(Cbgtab[cb] + Crgtab[cr], SCALEBITScxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jdmerge.c:72:9`!);
257 cblue = Cbbtab[cb];
258 /* Fetch 2 Y values and emit 2 pixels */
259 y = GETJSAMPLEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:61:9`!(*inptr0++);
260 outptr[RGB_REDcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:375:9`!] = range_limit[y + cred];
261 outptr[RGB_GREENcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:376:9`!] = range_limit[y + cgreen];
262 outptr[RGB_BLUEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:377:9`!] = range_limit[y + cblue];
263 outptr += RGB_PIXELSIZEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:378:9`!;
264 y = GETJSAMPLEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:61:9`!(*inptr0++);
265 outptr[RGB_REDcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:375:9`!] = range_limit[y + cred];
266 outptr[RGB_GREENcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:376:9`!] = range_limit[y + cgreen];
267 outptr[RGB_BLUEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:377:9`!] = range_limit[y + cblue];
268 outptr += RGB_PIXELSIZEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:378:9`!;
269 }
270 /* If image width is odd, do the last output column separately */
271 if (cinfo->output_widthcxx . . $ gdcmjpeg8_decompress_struct#output_width. & 1) {
272 cb = GETJSAMPLEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:61:9`!(*inptr1);
273 cr = GETJSAMPLEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:61:9`!(*inptr2);
274 cred = Crrtab[cr];
275 cgreen = (int) RIGHT_SHIFTcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jpegint.h:252:9`!(Cbgtab[cb] + Crgtab[cr], SCALEBITScxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jdmerge.c:72:9`!);
276 cblue = Cbbtab[cb];
277 y = GETJSAMPLEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:61:9`!(*inptr0);
278 outptr[RGB_REDcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:375:9`!] = range_limit[y + cred];
279 outptr[RGB_GREENcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:376:9`!] = range_limit[y + cgreen];
280 outptr[RGB_BLUEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:377:9`!] = range_limit[y + cblue];
281 }
282 }
283
284
285 /*
286 * Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical.
287 */
288
289 METHODDEFcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:220:9`!(void)
290 h2v2_merged_upsamplecxx . . $ h2v2_merged_upsample(3add4c5796a115f6). (j_decompress_ptrcxx . . $ j_decompress_ptr# cinfo,
291 JSAMPIMAGEcxx . . $ JSAMPIMAGE# input_buf, JDIMENSIONcxx . . $ JDIMENSION# in_row_group_ctr,
292 JSAMPARRAYcxx . . $ JSAMPARRAY# output_buf)
293 {
294 my_upsample_ptrcxx . . $ my_upsample_ptr# upsample = (my_upsample_ptrcxx . . $ my_upsample_ptr#) cinfo->upsamplecxx . . $ gdcmjpeg8_decompress_struct#upsample.;
295 register int y, cred, cgreen, cblue;
296 int cb, cr;
297 register JSAMPROWcxx . . $ JSAMPROW# outptr0, outptr1;
298 JSAMPROWcxx . . $ JSAMPROW# inptr00, inptr01, inptr1, inptr2;
299 JDIMENSIONcxx . . $ JDIMENSION# col;
300 /* copy these pointers into registers if possible */
301 register JSAMPLEcxx . . $ JSAMPLE# * range_limit = cinfo->sample_range_limitcxx . . $ gdcmjpeg8_decompress_struct#sample_range_limit.;
302 int * Crrtab = upsample->Cr_r_tabcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#Cr_r_tab.;
303 int * Cbbtab = upsample->Cb_b_tabcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#Cb_b_tab.;
304 INT32cxx . . $ INT32# * Crgtab = upsample->Cr_g_tabcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#Cr_g_tab.;
305 INT32cxx . . $ INT32# * Cbgtab = upsample->Cb_g_tabcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#Cb_g_tab.;
306 SHIFT_TEMPScxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jpegint.h:251:9`!
307
308 inptr00 = input_buf[0][in_row_group_ctr*2];
309 inptr01 = input_buf[0][in_row_group_ctr*2 + 1];
310 inptr1 = input_buf[1][in_row_group_ctr];
311 inptr2 = input_buf[2][in_row_group_ctr];
312 outptr0 = output_buf[0];
313 outptr1 = output_buf[1];
314 /* Loop for each group of output pixels */
315 for (col = cinfo->output_widthcxx . . $ gdcmjpeg8_decompress_struct#output_width. >> 1; col > 0; col--) {
316 /* Do the chroma part of the calculation */
317 cb = GETJSAMPLEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:61:9`!(*inptr1++);
318 cr = GETJSAMPLEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:61:9`!(*inptr2++);
319 cred = Crrtab[cr];
320 cgreen = (int) RIGHT_SHIFTcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jpegint.h:252:9`!(Cbgtab[cb] + Crgtab[cr], SCALEBITScxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jdmerge.c:72:9`!);
321 cblue = Cbbtab[cb];
322 /* Fetch 4 Y values and emit 4 pixels */
323 y = GETJSAMPLEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:61:9`!(*inptr00++);
324 outptr0[RGB_REDcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:375:9`!] = range_limit[y + cred];
325 outptr0[RGB_GREENcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:376:9`!] = range_limit[y + cgreen];
326 outptr0[RGB_BLUEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:377:9`!] = range_limit[y + cblue];
327 outptr0 += RGB_PIXELSIZEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:378:9`!;
328 y = GETJSAMPLEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:61:9`!(*inptr00++);
329 outptr0[RGB_REDcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:375:9`!] = range_limit[y + cred];
330 outptr0[RGB_GREENcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:376:9`!] = range_limit[y + cgreen];
331 outptr0[RGB_BLUEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:377:9`!] = range_limit[y + cblue];
332 outptr0 += RGB_PIXELSIZEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:378:9`!;
333 y = GETJSAMPLEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:61:9`!(*inptr01++);
334 outptr1[RGB_REDcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:375:9`!] = range_limit[y + cred];
335 outptr1[RGB_GREENcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:376:9`!] = range_limit[y + cgreen];
336 outptr1[RGB_BLUEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:377:9`!] = range_limit[y + cblue];
337 outptr1 += RGB_PIXELSIZEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:378:9`!;
338 y = GETJSAMPLEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:61:9`!(*inptr01++);
339 outptr1[RGB_REDcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:375:9`!] = range_limit[y + cred];
340 outptr1[RGB_GREENcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:376:9`!] = range_limit[y + cgreen];
341 outptr1[RGB_BLUEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:377:9`!] = range_limit[y + cblue];
342 outptr1 += RGB_PIXELSIZEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:378:9`!;
343 }
344 /* If image width is odd, do the last output column separately */
345 if (cinfo->output_widthcxx . . $ gdcmjpeg8_decompress_struct#output_width. & 1) {
346 cb = GETJSAMPLEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:61:9`!(*inptr1);
347 cr = GETJSAMPLEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:61:9`!(*inptr2);
348 cred = Crrtab[cr];
349 cgreen = (int) RIGHT_SHIFTcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jpegint.h:252:9`!(Cbgtab[cb] + Crgtab[cr], SCALEBITScxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jdmerge.c:72:9`!);
350 cblue = Cbbtab[cb];
351 y = GETJSAMPLEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:61:9`!(*inptr00);
352 outptr0[RGB_REDcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:375:9`!] = range_limit[y + cred];
353 outptr0[RGB_GREENcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:376:9`!] = range_limit[y + cgreen];
354 outptr0[RGB_BLUEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:377:9`!] = range_limit[y + cblue];
355 y = GETJSAMPLEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:61:9`!(*inptr01);
356 outptr1[RGB_REDcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:375:9`!] = range_limit[y + cred];
357 outptr1[RGB_GREENcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:376:9`!] = range_limit[y + cgreen];
358 outptr1[RGB_BLUEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:377:9`!] = range_limit[y + cblue];
359 }
360 }
361
362
363 /*
364 * Module initialization routine for merged upsampling/color conversion.
365 *
366 * NB: this is called under the conditions determined by use_merged_upsample()
367 * in jdmaster.c. That routine MUST correspond to the actual capabilities
368 * of this module; no safety checks are made here.
369 */
370
371 GLOBALcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:230:9`!(void)
372 jinit_merged_upsamplercxx . . $ `build/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/8/mangle_jpeg8bits.h:55:9`! (j_decompress_ptrcxx . . $ j_decompress_ptr# cinfo)
373 {
374 my_upsample_ptrcxx . . $ my_upsample_ptr# upsample;
375
376 upsample = (my_upsample_ptrcxx . . $ my_upsample_ptr#)
377 (*cinfo->memcxx . . $ gdcmjpeg8_decompress_struct#mem.->alloc_smallcxx . . $ gdcmjpeg8_memory_mgr#alloc_small.) ((j_common_ptrcxx . . $ j_common_ptr#) cinfo, JPOOL_IMAGEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jpeglib.h:768:9`!,
378 SIZEOFcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jinclude.h:80:9`!(my_upsampler));
379 cinfo->upsamplecxx . . $ gdcmjpeg8_decompress_struct#upsample. = (struct jpeg_upsamplercxx . . $ jpeg_upsampler# *) upsample;
380 upsample->pubcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#pub..start_passcxx . . $ jpeg_upsampler#start_pass. = start_pass_merged_upsamplecxx . . $ start_pass_merged_upsample(3d26031805684a5f).;
381 upsample->pubcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#pub..need_context_rowscxx . . $ jpeg_upsampler#need_context_rows. = FALSEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jmorecfg.h:288:9`!;
382
383 upsample->out_row_widthcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#out_row_width. = cinfo->output_widthcxx . . $ gdcmjpeg8_decompress_struct#output_width. * cinfo->out_color_componentscxx . . $ gdcmjpeg8_decompress_struct#out_color_components.;
384
385 if (cinfo->max_v_samp_factorcxx . . $ gdcmjpeg8_decompress_struct#max_v_samp_factor. == 2) {
386 upsample->pubcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#pub..upsamplecxx . . $ jpeg_upsampler#upsample. = merged_2v_upsamplecxx . . $ merged_2v_upsample(54a7e9b858d2ea7a).;
387 upsample->upmethodcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#upmethod. = h2v2_merged_upsamplecxx . . $ h2v2_merged_upsample(3add4c5796a115f6).;
388 /* Allocate a spare row buffer */
389 upsample->spare_rowcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#spare_row. = (JSAMPROWcxx . . $ JSAMPROW#)
390 (*cinfo->memcxx . . $ gdcmjpeg8_decompress_struct#mem.->alloc_largecxx . . $ gdcmjpeg8_memory_mgr#alloc_large.) ((j_common_ptrcxx . . $ j_common_ptr#) cinfo, JPOOL_IMAGEcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jpeglib.h:768:9`!,
391 (size_t) (upsample->out_row_widthcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#out_row_width. * SIZEOFcxx . . $ `Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmjpeg/jinclude.h:80:9`!(JSAMPLE)));
392 } else {
393 upsample->pubcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#pub..upsamplecxx . . $ jpeg_upsampler#upsample. = merged_1v_upsamplecxx . . $ merged_1v_upsample(54a7e9b858d2ea7a).;
394 upsample->upmethodcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#upmethod. = h2v1_merged_upsamplecxx . . $ h2v1_merged_upsample(3add4c5796a115f6).;
395 /* No spare row needed */
396 upsample->spare_rowcxx . . $ $anonymous_type_13b7d85e4610bb3f_0#spare_row. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
397 }
398
399 build_ycc_rgb_tablecxx . . $ build_ycc_rgb_table(3d26031805684a5f).(cinfo);
400 }
401
402 #endif /* UPSAMPLE_MERGING_SUPPORTED */